18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */ 28c2ecf20Sopenharmony_ci/* Texas Instruments Triple 8-/10-BIT 165-/110-MSPS Video and Graphics 38c2ecf20Sopenharmony_ci * Digitizer with Horizontal PLL registers 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Copyright (C) 2009 Texas Instruments Inc 68c2ecf20Sopenharmony_ci * Author: Santiago Nunez-Corrales <santiago.nunez@ridgerun.com> 78c2ecf20Sopenharmony_ci * 88c2ecf20Sopenharmony_ci * This code is partially based upon the TVP5150 driver 98c2ecf20Sopenharmony_ci * written by Mauro Carvalho Chehab <mchehab@kernel.org>, 108c2ecf20Sopenharmony_ci * the TVP514x driver written by Vaibhav Hiremath <hvaibhav@ti.com> 118c2ecf20Sopenharmony_ci * and the TVP7002 driver in the TI LSP 2.10.00.14 128c2ecf20Sopenharmony_ci */ 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_ci/* Naming conventions 158c2ecf20Sopenharmony_ci * ------------------ 168c2ecf20Sopenharmony_ci * 178c2ecf20Sopenharmony_ci * FDBK: Feedback 188c2ecf20Sopenharmony_ci * DIV: Divider 198c2ecf20Sopenharmony_ci * CTL: Control 208c2ecf20Sopenharmony_ci * SEL: Select 218c2ecf20Sopenharmony_ci * IN: Input 228c2ecf20Sopenharmony_ci * OUT: Output 238c2ecf20Sopenharmony_ci * R: Red 248c2ecf20Sopenharmony_ci * G: Green 258c2ecf20Sopenharmony_ci * B: Blue 268c2ecf20Sopenharmony_ci * OFF: Offset 278c2ecf20Sopenharmony_ci * THRS: Threshold 288c2ecf20Sopenharmony_ci * DGTL: Digital 298c2ecf20Sopenharmony_ci * LVL: Level 308c2ecf20Sopenharmony_ci * PWR: Power 318c2ecf20Sopenharmony_ci * MVIS: Macrovision 328c2ecf20Sopenharmony_ci * W: Width 338c2ecf20Sopenharmony_ci * H: Height 348c2ecf20Sopenharmony_ci * ALGN: Alignment 358c2ecf20Sopenharmony_ci * CLK: Clocks 368c2ecf20Sopenharmony_ci * TOL: Tolerance 378c2ecf20Sopenharmony_ci * BWTH: Bandwidth 388c2ecf20Sopenharmony_ci * COEF: Coefficient 398c2ecf20Sopenharmony_ci * STAT: Status 408c2ecf20Sopenharmony_ci * AUTO: Automatic 418c2ecf20Sopenharmony_ci * FLD: Field 428c2ecf20Sopenharmony_ci * L: Line 438c2ecf20Sopenharmony_ci */ 448c2ecf20Sopenharmony_ci 458c2ecf20Sopenharmony_ci#define TVP7002_CHIP_REV 0x00 468c2ecf20Sopenharmony_ci#define TVP7002_HPLL_FDBK_DIV_MSBS 0x01 478c2ecf20Sopenharmony_ci#define TVP7002_HPLL_FDBK_DIV_LSBS 0x02 488c2ecf20Sopenharmony_ci#define TVP7002_HPLL_CRTL 0x03 498c2ecf20Sopenharmony_ci#define TVP7002_HPLL_PHASE_SEL 0x04 508c2ecf20Sopenharmony_ci#define TVP7002_CLAMP_START 0x05 518c2ecf20Sopenharmony_ci#define TVP7002_CLAMP_W 0x06 528c2ecf20Sopenharmony_ci#define TVP7002_HSYNC_OUT_W 0x07 538c2ecf20Sopenharmony_ci#define TVP7002_B_FINE_GAIN 0x08 548c2ecf20Sopenharmony_ci#define TVP7002_G_FINE_GAIN 0x09 558c2ecf20Sopenharmony_ci#define TVP7002_R_FINE_GAIN 0x0a 568c2ecf20Sopenharmony_ci#define TVP7002_B_FINE_OFF_MSBS 0x0b 578c2ecf20Sopenharmony_ci#define TVP7002_G_FINE_OFF_MSBS 0x0c 588c2ecf20Sopenharmony_ci#define TVP7002_R_FINE_OFF_MSBS 0x0d 598c2ecf20Sopenharmony_ci#define TVP7002_SYNC_CTL_1 0x0e 608c2ecf20Sopenharmony_ci#define TVP7002_HPLL_AND_CLAMP_CTL 0x0f 618c2ecf20Sopenharmony_ci#define TVP7002_SYNC_ON_G_THRS 0x10 628c2ecf20Sopenharmony_ci#define TVP7002_SYNC_SEPARATOR_THRS 0x11 638c2ecf20Sopenharmony_ci#define TVP7002_HPLL_PRE_COAST 0x12 648c2ecf20Sopenharmony_ci#define TVP7002_HPLL_POST_COAST 0x13 658c2ecf20Sopenharmony_ci#define TVP7002_SYNC_DETECT_STAT 0x14 668c2ecf20Sopenharmony_ci#define TVP7002_OUT_FORMATTER 0x15 678c2ecf20Sopenharmony_ci#define TVP7002_MISC_CTL_1 0x16 688c2ecf20Sopenharmony_ci#define TVP7002_MISC_CTL_2 0x17 698c2ecf20Sopenharmony_ci#define TVP7002_MISC_CTL_3 0x18 708c2ecf20Sopenharmony_ci#define TVP7002_IN_MUX_SEL_1 0x19 718c2ecf20Sopenharmony_ci#define TVP7002_IN_MUX_SEL_2 0x1a 728c2ecf20Sopenharmony_ci#define TVP7002_B_AND_G_COARSE_GAIN 0x1b 738c2ecf20Sopenharmony_ci#define TVP7002_R_COARSE_GAIN 0x1c 748c2ecf20Sopenharmony_ci#define TVP7002_FINE_OFF_LSBS 0x1d 758c2ecf20Sopenharmony_ci#define TVP7002_B_COARSE_OFF 0x1e 768c2ecf20Sopenharmony_ci#define TVP7002_G_COARSE_OFF 0x1f 778c2ecf20Sopenharmony_ci#define TVP7002_R_COARSE_OFF 0x20 788c2ecf20Sopenharmony_ci#define TVP7002_HSOUT_OUT_START 0x21 798c2ecf20Sopenharmony_ci#define TVP7002_MISC_CTL_4 0x22 808c2ecf20Sopenharmony_ci#define TVP7002_B_DGTL_ALC_OUT_LSBS 0x23 818c2ecf20Sopenharmony_ci#define TVP7002_G_DGTL_ALC_OUT_LSBS 0x24 828c2ecf20Sopenharmony_ci#define TVP7002_R_DGTL_ALC_OUT_LSBS 0x25 838c2ecf20Sopenharmony_ci#define TVP7002_AUTO_LVL_CTL_ENABLE 0x26 848c2ecf20Sopenharmony_ci#define TVP7002_DGTL_ALC_OUT_MSBS 0x27 858c2ecf20Sopenharmony_ci#define TVP7002_AUTO_LVL_CTL_FILTER 0x28 868c2ecf20Sopenharmony_ci/* Reserved 0x29*/ 878c2ecf20Sopenharmony_ci#define TVP7002_FINE_CLAMP_CTL 0x2a 888c2ecf20Sopenharmony_ci#define TVP7002_PWR_CTL 0x2b 898c2ecf20Sopenharmony_ci#define TVP7002_ADC_SETUP 0x2c 908c2ecf20Sopenharmony_ci#define TVP7002_COARSE_CLAMP_CTL 0x2d 918c2ecf20Sopenharmony_ci#define TVP7002_SOG_CLAMP 0x2e 928c2ecf20Sopenharmony_ci#define TVP7002_RGB_COARSE_CLAMP_CTL 0x2f 938c2ecf20Sopenharmony_ci#define TVP7002_SOG_COARSE_CLAMP_CTL 0x30 948c2ecf20Sopenharmony_ci#define TVP7002_ALC_PLACEMENT 0x31 958c2ecf20Sopenharmony_ci/* Reserved 0x32 */ 968c2ecf20Sopenharmony_ci/* Reserved 0x33 */ 978c2ecf20Sopenharmony_ci#define TVP7002_MVIS_STRIPPER_W 0x34 988c2ecf20Sopenharmony_ci#define TVP7002_VSYNC_ALGN 0x35 998c2ecf20Sopenharmony_ci#define TVP7002_SYNC_BYPASS 0x36 1008c2ecf20Sopenharmony_ci#define TVP7002_L_FRAME_STAT_LSBS 0x37 1018c2ecf20Sopenharmony_ci#define TVP7002_L_FRAME_STAT_MSBS 0x38 1028c2ecf20Sopenharmony_ci#define TVP7002_CLK_L_STAT_LSBS 0x39 1038c2ecf20Sopenharmony_ci#define TVP7002_CLK_L_STAT_MSBS 0x3a 1048c2ecf20Sopenharmony_ci#define TVP7002_HSYNC_W 0x3b 1058c2ecf20Sopenharmony_ci#define TVP7002_VSYNC_W 0x3c 1068c2ecf20Sopenharmony_ci#define TVP7002_L_LENGTH_TOL 0x3d 1078c2ecf20Sopenharmony_ci/* Reserved 0x3e */ 1088c2ecf20Sopenharmony_ci#define TVP7002_VIDEO_BWTH_CTL 0x3f 1098c2ecf20Sopenharmony_ci#define TVP7002_AVID_START_PIXEL_LSBS 0x40 1108c2ecf20Sopenharmony_ci#define TVP7002_AVID_START_PIXEL_MSBS 0x41 1118c2ecf20Sopenharmony_ci#define TVP7002_AVID_STOP_PIXEL_LSBS 0x42 1128c2ecf20Sopenharmony_ci#define TVP7002_AVID_STOP_PIXEL_MSBS 0x43 1138c2ecf20Sopenharmony_ci#define TVP7002_VBLK_F_0_START_L_OFF 0x44 1148c2ecf20Sopenharmony_ci#define TVP7002_VBLK_F_1_START_L_OFF 0x45 1158c2ecf20Sopenharmony_ci#define TVP7002_VBLK_F_0_DURATION 0x46 1168c2ecf20Sopenharmony_ci#define TVP7002_VBLK_F_1_DURATION 0x47 1178c2ecf20Sopenharmony_ci#define TVP7002_FBIT_F_0_START_L_OFF 0x48 1188c2ecf20Sopenharmony_ci#define TVP7002_FBIT_F_1_START_L_OFF 0x49 1198c2ecf20Sopenharmony_ci#define TVP7002_YUV_Y_G_COEF_LSBS 0x4a 1208c2ecf20Sopenharmony_ci#define TVP7002_YUV_Y_G_COEF_MSBS 0x4b 1218c2ecf20Sopenharmony_ci#define TVP7002_YUV_Y_B_COEF_LSBS 0x4c 1228c2ecf20Sopenharmony_ci#define TVP7002_YUV_Y_B_COEF_MSBS 0x4d 1238c2ecf20Sopenharmony_ci#define TVP7002_YUV_Y_R_COEF_LSBS 0x4e 1248c2ecf20Sopenharmony_ci#define TVP7002_YUV_Y_R_COEF_MSBS 0x4f 1258c2ecf20Sopenharmony_ci#define TVP7002_YUV_U_G_COEF_LSBS 0x50 1268c2ecf20Sopenharmony_ci#define TVP7002_YUV_U_G_COEF_MSBS 0x51 1278c2ecf20Sopenharmony_ci#define TVP7002_YUV_U_B_COEF_LSBS 0x52 1288c2ecf20Sopenharmony_ci#define TVP7002_YUV_U_B_COEF_MSBS 0x53 1298c2ecf20Sopenharmony_ci#define TVP7002_YUV_U_R_COEF_LSBS 0x54 1308c2ecf20Sopenharmony_ci#define TVP7002_YUV_U_R_COEF_MSBS 0x55 1318c2ecf20Sopenharmony_ci#define TVP7002_YUV_V_G_COEF_LSBS 0x56 1328c2ecf20Sopenharmony_ci#define TVP7002_YUV_V_G_COEF_MSBS 0x57 1338c2ecf20Sopenharmony_ci#define TVP7002_YUV_V_B_COEF_LSBS 0x58 1348c2ecf20Sopenharmony_ci#define TVP7002_YUV_V_B_COEF_MSBS 0x59 1358c2ecf20Sopenharmony_ci#define TVP7002_YUV_V_R_COEF_LSBS 0x5a 1368c2ecf20Sopenharmony_ci#define TVP7002_YUV_V_R_COEF_MSBS 0x5b 1378c2ecf20Sopenharmony_ci 138