1*59d8bf5dSNishad Kamdar /* SPDX-License-Identifier: GPL-2.0 */ 2cb7a01acSMauro Carvalho Chehab /* 3459ee17cSMauro Carvalho Chehab * 4cb7a01acSMauro Carvalho Chehab * tvp5150 - Texas Instruments TVP5150A/AM1 video decoder registers 5cb7a01acSMauro Carvalho Chehab * 632590819SMauro Carvalho Chehab * Copyright (c) 2005,2006 Mauro Carvalho Chehab <mchehab@kernel.org> 7cb7a01acSMauro Carvalho Chehab */ 8cb7a01acSMauro Carvalho Chehab 9cb7a01acSMauro Carvalho Chehab #define TVP5150_VD_IN_SRC_SEL_1 0x00 /* Video input source selection #1 */ 10cb7a01acSMauro Carvalho Chehab #define TVP5150_ANAL_CHL_CTL 0x01 /* Analog channel controls */ 11cb7a01acSMauro Carvalho Chehab #define TVP5150_OP_MODE_CTL 0x02 /* Operation mode controls */ 12cb7a01acSMauro Carvalho Chehab #define TVP5150_MISC_CTL 0x03 /* Miscellaneous controls */ 13b4b2de38SLaurent Pinchart #define TVP5150_MISC_CTL_VBLK_GPCL BIT(7) 14b4b2de38SLaurent Pinchart #define TVP5150_MISC_CTL_GPCL BIT(6) 15b4b2de38SLaurent Pinchart #define TVP5150_MISC_CTL_INTREQ_OE BIT(5) 16b4b2de38SLaurent Pinchart #define TVP5150_MISC_CTL_HVLK BIT(4) 17b4b2de38SLaurent Pinchart #define TVP5150_MISC_CTL_YCBCR_OE BIT(3) 18b4b2de38SLaurent Pinchart #define TVP5150_MISC_CTL_SYNC_OE BIT(2) 19b4b2de38SLaurent Pinchart #define TVP5150_MISC_CTL_VBLANK BIT(1) 20b4b2de38SLaurent Pinchart #define TVP5150_MISC_CTL_CLOCK_OE BIT(0) 21b4b2de38SLaurent Pinchart 22cb7a01acSMauro Carvalho Chehab #define TVP5150_AUTOSW_MSK 0x04 /* Autoswitch mask: TVP5150A / TVP5150AM */ 23cb7a01acSMauro Carvalho Chehab 24cb7a01acSMauro Carvalho Chehab /* Reserved 05h */ 25cb7a01acSMauro Carvalho Chehab 26cb7a01acSMauro Carvalho Chehab #define TVP5150_COLOR_KIL_THSH_CTL 0x06 /* Color killer threshold control */ 27cb7a01acSMauro Carvalho Chehab #define TVP5150_LUMA_PROC_CTL_1 0x07 /* Luminance processing control #1 */ 28cb7a01acSMauro Carvalho Chehab #define TVP5150_LUMA_PROC_CTL_2 0x08 /* Luminance processing control #2 */ 29cb7a01acSMauro Carvalho Chehab #define TVP5150_BRIGHT_CTL 0x09 /* Brightness control */ 30cb7a01acSMauro Carvalho Chehab #define TVP5150_SATURATION_CTL 0x0a /* Color saturation control */ 31cb7a01acSMauro Carvalho Chehab #define TVP5150_HUE_CTL 0x0b /* Hue control */ 32cb7a01acSMauro Carvalho Chehab #define TVP5150_CONTRAST_CTL 0x0c /* Contrast control */ 33cb7a01acSMauro Carvalho Chehab #define TVP5150_DATA_RATE_SEL 0x0d /* Outputs and data rates select */ 34cb7a01acSMauro Carvalho Chehab #define TVP5150_LUMA_PROC_CTL_3 0x0e /* Luminance processing control #3 */ 35cb7a01acSMauro Carvalho Chehab #define TVP5150_CONF_SHARED_PIN 0x0f /* Configuration shared pins */ 36cb7a01acSMauro Carvalho Chehab 37cb7a01acSMauro Carvalho Chehab /* Reserved 10h */ 38cb7a01acSMauro Carvalho Chehab 39cb7a01acSMauro Carvalho Chehab #define TVP5150_ACT_VD_CROP_ST_MSB 0x11 /* Active video cropping start MSB */ 40cb7a01acSMauro Carvalho Chehab #define TVP5150_ACT_VD_CROP_ST_LSB 0x12 /* Active video cropping start LSB */ 41cb7a01acSMauro Carvalho Chehab #define TVP5150_ACT_VD_CROP_STP_MSB 0x13 /* Active video cropping stop MSB */ 42cb7a01acSMauro Carvalho Chehab #define TVP5150_ACT_VD_CROP_STP_LSB 0x14 /* Active video cropping stop LSB */ 43cb7a01acSMauro Carvalho Chehab #define TVP5150_GENLOCK 0x15 /* Genlock/RTC */ 44cb7a01acSMauro Carvalho Chehab #define TVP5150_HORIZ_SYNC_START 0x16 /* Horizontal sync start */ 45cb7a01acSMauro Carvalho Chehab 46cb7a01acSMauro Carvalho Chehab /* Reserved 17h */ 47cb7a01acSMauro Carvalho Chehab 48cb7a01acSMauro Carvalho Chehab #define TVP5150_VERT_BLANKING_START 0x18 /* Vertical blanking start */ 49cb7a01acSMauro Carvalho Chehab #define TVP5150_VERT_BLANKING_STOP 0x19 /* Vertical blanking stop */ 50cb7a01acSMauro Carvalho Chehab #define TVP5150_CHROMA_PROC_CTL_1 0x1a /* Chrominance processing control #1 */ 51cb7a01acSMauro Carvalho Chehab #define TVP5150_CHROMA_PROC_CTL_2 0x1b /* Chrominance processing control #2 */ 52cb7a01acSMauro Carvalho Chehab #define TVP5150_INT_RESET_REG_B 0x1c /* Interrupt reset register B */ 53cb7a01acSMauro Carvalho Chehab #define TVP5150_INT_ENABLE_REG_B 0x1d /* Interrupt enable register B */ 54cb7a01acSMauro Carvalho Chehab #define TVP5150_INTT_CONFIG_REG_B 0x1e /* Interrupt configuration register B */ 55cb7a01acSMauro Carvalho Chehab 56cb7a01acSMauro Carvalho Chehab /* Reserved 1Fh-27h */ 57cb7a01acSMauro Carvalho Chehab 58cb7a01acSMauro Carvalho Chehab #define VIDEO_STD_MASK (0x07 >> 1) 59cb7a01acSMauro Carvalho Chehab #define TVP5150_VIDEO_STD 0x28 /* Video standard */ 60cb7a01acSMauro Carvalho Chehab #define VIDEO_STD_AUTO_SWITCH_BIT 0x00 61cb7a01acSMauro Carvalho Chehab #define VIDEO_STD_NTSC_MJ_BIT 0x02 62cb7a01acSMauro Carvalho Chehab #define VIDEO_STD_PAL_BDGHIN_BIT 0x04 63cb7a01acSMauro Carvalho Chehab #define VIDEO_STD_PAL_M_BIT 0x06 64cb7a01acSMauro Carvalho Chehab #define VIDEO_STD_PAL_COMBINATION_N_BIT 0x08 65cb7a01acSMauro Carvalho Chehab #define VIDEO_STD_NTSC_4_43_BIT 0x0a 66cb7a01acSMauro Carvalho Chehab #define VIDEO_STD_SECAM_BIT 0x0c 67cb7a01acSMauro Carvalho Chehab 68cb7a01acSMauro Carvalho Chehab #define VIDEO_STD_NTSC_MJ_BIT_AS 0x01 69cb7a01acSMauro Carvalho Chehab #define VIDEO_STD_PAL_BDGHIN_BIT_AS 0x03 70cb7a01acSMauro Carvalho Chehab #define VIDEO_STD_PAL_M_BIT_AS 0x05 71cb7a01acSMauro Carvalho Chehab #define VIDEO_STD_PAL_COMBINATION_N_BIT_AS 0x07 72cb7a01acSMauro Carvalho Chehab #define VIDEO_STD_NTSC_4_43_BIT_AS 0x09 73cb7a01acSMauro Carvalho Chehab #define VIDEO_STD_SECAM_BIT_AS 0x0b 74cb7a01acSMauro Carvalho Chehab 75cb7a01acSMauro Carvalho Chehab /* Reserved 29h-2bh */ 76cb7a01acSMauro Carvalho Chehab 77cb7a01acSMauro Carvalho Chehab #define TVP5150_CB_GAIN_FACT 0x2c /* Cb gain factor */ 78cb7a01acSMauro Carvalho Chehab #define TVP5150_CR_GAIN_FACTOR 0x2d /* Cr gain factor */ 79cb7a01acSMauro Carvalho Chehab #define TVP5150_MACROVISION_ON_CTR 0x2e /* Macrovision on counter */ 80cb7a01acSMauro Carvalho Chehab #define TVP5150_MACROVISION_OFF_CTR 0x2f /* Macrovision off counter */ 81cb7a01acSMauro Carvalho Chehab #define TVP5150_REV_SELECT 0x30 /* revision select (TVP5150AM1 only) */ 82cb7a01acSMauro Carvalho Chehab 83cb7a01acSMauro Carvalho Chehab /* Reserved 31h-7Fh */ 84cb7a01acSMauro Carvalho Chehab 85cb7a01acSMauro Carvalho Chehab #define TVP5150_MSB_DEV_ID 0x80 /* MSB of device ID */ 86cb7a01acSMauro Carvalho Chehab #define TVP5150_LSB_DEV_ID 0x81 /* LSB of device ID */ 87cb7a01acSMauro Carvalho Chehab #define TVP5150_ROM_MAJOR_VER 0x82 /* ROM major version */ 88cb7a01acSMauro Carvalho Chehab #define TVP5150_ROM_MINOR_VER 0x83 /* ROM minor version */ 89cb7a01acSMauro Carvalho Chehab #define TVP5150_VERT_LN_COUNT_MSB 0x84 /* Vertical line count MSB */ 90cb7a01acSMauro Carvalho Chehab #define TVP5150_VERT_LN_COUNT_LSB 0x85 /* Vertical line count LSB */ 91cb7a01acSMauro Carvalho Chehab #define TVP5150_INT_STATUS_REG_B 0x86 /* Interrupt status register B */ 92cb7a01acSMauro Carvalho Chehab #define TVP5150_INT_ACTIVE_REG_B 0x87 /* Interrupt active register B */ 93cb7a01acSMauro Carvalho Chehab #define TVP5150_STATUS_REG_1 0x88 /* Status register #1 */ 94cb7a01acSMauro Carvalho Chehab #define TVP5150_STATUS_REG_2 0x89 /* Status register #2 */ 95cb7a01acSMauro Carvalho Chehab #define TVP5150_STATUS_REG_3 0x8a /* Status register #3 */ 96cb7a01acSMauro Carvalho Chehab #define TVP5150_STATUS_REG_4 0x8b /* Status register #4 */ 97cb7a01acSMauro Carvalho Chehab #define TVP5150_STATUS_REG_5 0x8c /* Status register #5 */ 98cb7a01acSMauro Carvalho Chehab /* Reserved 8Dh-8Fh */ 99cb7a01acSMauro Carvalho Chehab /* Closed caption data registers */ 100cb7a01acSMauro Carvalho Chehab #define TVP5150_CC_DATA_INI 0x90 101cb7a01acSMauro Carvalho Chehab #define TVP5150_CC_DATA_END 0x93 102cb7a01acSMauro Carvalho Chehab 103cb7a01acSMauro Carvalho Chehab /* WSS data registers */ 104cb7a01acSMauro Carvalho Chehab #define TVP5150_WSS_DATA_INI 0x94 105cb7a01acSMauro Carvalho Chehab #define TVP5150_WSS_DATA_END 0x99 106cb7a01acSMauro Carvalho Chehab 107cb7a01acSMauro Carvalho Chehab /* VPS data registers */ 108cb7a01acSMauro Carvalho Chehab #define TVP5150_VPS_DATA_INI 0x9a 109cb7a01acSMauro Carvalho Chehab #define TVP5150_VPS_DATA_END 0xa6 110cb7a01acSMauro Carvalho Chehab 111cb7a01acSMauro Carvalho Chehab /* VITC data registers */ 112cb7a01acSMauro Carvalho Chehab #define TVP5150_VITC_DATA_INI 0xa7 113cb7a01acSMauro Carvalho Chehab #define TVP5150_VITC_DATA_END 0xaf 114cb7a01acSMauro Carvalho Chehab 115cb7a01acSMauro Carvalho Chehab #define TVP5150_VBI_FIFO_READ_DATA 0xb0 /* VBI FIFO read data */ 116cb7a01acSMauro Carvalho Chehab 117cb7a01acSMauro Carvalho Chehab /* Teletext filter 1 */ 118cb7a01acSMauro Carvalho Chehab #define TVP5150_TELETEXT_FIL1_INI 0xb1 119cb7a01acSMauro Carvalho Chehab #define TVP5150_TELETEXT_FIL1_END 0xb5 120cb7a01acSMauro Carvalho Chehab 121cb7a01acSMauro Carvalho Chehab /* Teletext filter 2 */ 122cb7a01acSMauro Carvalho Chehab #define TVP5150_TELETEXT_FIL2_INI 0xb6 123cb7a01acSMauro Carvalho Chehab #define TVP5150_TELETEXT_FIL2_END 0xba 124cb7a01acSMauro Carvalho Chehab 125cb7a01acSMauro Carvalho Chehab #define TVP5150_TELETEXT_FIL_ENA 0xbb /* Teletext filter enable */ 126cb7a01acSMauro Carvalho Chehab /* Reserved BCh-BFh */ 127cb7a01acSMauro Carvalho Chehab #define TVP5150_INT_STATUS_REG_A 0xc0 /* Interrupt status register A */ 1288e4c97e0SPhilipp Zabel #define TVP5150_INT_A_LOCK_STATUS BIT(7) 1298e4c97e0SPhilipp Zabel #define TVP5150_INT_A_LOCK BIT(6) 130cb7a01acSMauro Carvalho Chehab #define TVP5150_INT_ENABLE_REG_A 0xc1 /* Interrupt enable register A */ 131cb7a01acSMauro Carvalho Chehab #define TVP5150_INT_CONF 0xc2 /* Interrupt configuration */ 1328e4c97e0SPhilipp Zabel #define TVP5150_VDPOE BIT(2) 133cb7a01acSMauro Carvalho Chehab #define TVP5150_VDP_CONF_RAM_DATA 0xc3 /* VDP configuration RAM data */ 134cb7a01acSMauro Carvalho Chehab #define TVP5150_CONF_RAM_ADDR_LOW 0xc4 /* Configuration RAM address low byte */ 135cb7a01acSMauro Carvalho Chehab #define TVP5150_CONF_RAM_ADDR_HIGH 0xc5 /* Configuration RAM address high byte */ 136cb7a01acSMauro Carvalho Chehab #define TVP5150_VDP_STATUS_REG 0xc6 /* VDP status register */ 137cb7a01acSMauro Carvalho Chehab #define TVP5150_FIFO_WORD_COUNT 0xc7 /* FIFO word count */ 138cb7a01acSMauro Carvalho Chehab #define TVP5150_FIFO_INT_THRESHOLD 0xc8 /* FIFO interrupt threshold */ 139cb7a01acSMauro Carvalho Chehab #define TVP5150_FIFO_RESET 0xc9 /* FIFO reset */ 140cb7a01acSMauro Carvalho Chehab #define TVP5150_LINE_NUMBER_INT 0xca /* Line number interrupt */ 141cb7a01acSMauro Carvalho Chehab #define TVP5150_PIX_ALIGN_REG_LOW 0xcb /* Pixel alignment register low byte */ 142cb7a01acSMauro Carvalho Chehab #define TVP5150_PIX_ALIGN_REG_HIGH 0xcc /* Pixel alignment register high byte */ 143cb7a01acSMauro Carvalho Chehab #define TVP5150_FIFO_OUT_CTRL 0xcd /* FIFO output control */ 144cb7a01acSMauro Carvalho Chehab /* Reserved CEh */ 145cb7a01acSMauro Carvalho Chehab #define TVP5150_FULL_FIELD_ENA 0xcf /* Full field enable 1 */ 146cb7a01acSMauro Carvalho Chehab 147cb7a01acSMauro Carvalho Chehab /* Line mode registers */ 148cb7a01acSMauro Carvalho Chehab #define TVP5150_LINE_MODE_INI 0xd0 149cb7a01acSMauro Carvalho Chehab #define TVP5150_LINE_MODE_END 0xfb 150cb7a01acSMauro Carvalho Chehab 151cb7a01acSMauro Carvalho Chehab #define TVP5150_FULL_FIELD_MODE_REG 0xfc /* Full field mode register */ 152cb7a01acSMauro Carvalho Chehab /* Reserved FDh-FFh */ 153