linux/drivers/media/i2c/tda1997x_regs.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (C) 2018 Gateworks Corporation
 */

/* Page 0x00 - General Control */
#define REG_VERSION
#define REG_INPUT_SEL
#define REG_SVC_MODE
#define REG_HPD_MAN_CTRL
#define REG_RT_MAN_CTRL
#define REG_STANDBY_SOFT_RST
#define REG_HDMI_SOFT_RST
#define REG_HDMI_INFO_RST
#define REG_INT_FLG_CLR_TOP
#define REG_INT_FLG_CLR_SUS
#define REG_INT_FLG_CLR_DDC
#define REG_INT_FLG_CLR_RATE
#define REG_INT_FLG_CLR_MODE
#define REG_INT_FLG_CLR_INFO
#define REG_INT_FLG_CLR_AUDIO
#define REG_INT_FLG_CLR_HDCP
#define REG_INT_FLG_CLR_AFE
#define REG_INT_MASK_TOP
#define REG_INT_MASK_SUS
#define REG_INT_MASK_DDC
#define REG_INT_MASK_RATE
#define REG_INT_MASK_MODE
#define REG_INT_MASK_INFO
#define REG_INT_MASK_AUDIO
#define REG_INT_MASK_HDCP
#define REG_INT_MASK_AFE
#define REG_DETECT_5V
#define REG_SUS_STATUS
#define REG_V_PER
#define REG_H_PER
#define REG_HS_WIDTH
#define REG_FMT_H_TOT
#define REG_FMT_H_ACT
#define REG_FMT_H_FRONT
#define REG_FMT_H_SYNC
#define REG_FMT_H_BACK
#define REG_FMT_V_TOT
#define REG_FMT_V_ACT
#define REG_FMT_V_FRONT_F1
#define REG_FMT_V_FRONT_F2
#define REG_FMT_V_SYNC
#define REG_FMT_V_BACK_F1
#define REG_FMT_V_BACK_F2
#define REG_FMT_DE_ACT
#define REG_RATE_CTRL
#define REG_CLK_MIN_RATE
#define REG_CLK_MAX_RATE
#define REG_CLK_A_STATUS
#define REG_CLK_A_RATE
#define REG_DRIFT_CLK_A_REG
#define REG_CLK_B_STATUS
#define REG_CLK_B_RATE
#define REG_DRIFT_CLK_B_REG
#define REG_HDCP_CTRL
#define REG_HDCP_KDS
#define REG_HDCP_BCAPS
#define REG_HDCP_KEY_CTRL
#define REG_INFO_CTRL
#define REG_INFO_EXCEED
#define REG_PIX_REPEAT
#define REG_AUDIO_PATH
#define REG_AUDCFG
#define REG_AUDIO_OUT_ENABLE
#define REG_AUDIO_OUT_HIZ
#define REG_VDP_CTRL
#define REG_VDP_MATRIX
#define REG_VHREF_CTRL
#define REG_PXCNT_PR
#define REG_PXCNT_NPIX
#define REG_LCNT_PR
#define REG_LCNT_NLIN
#define REG_HREF_S
#define REG_HREF_E
#define REG_HS_S
#define REG_HS_E
#define REG_VREF_F1_S
#define REG_VREF_F1_WIDTH
#define REG_VREF_F2_S
#define REG_VREF_F2_WIDTH
#define REG_VS_F1_LINE_S
#define REG_VS_F1_LINE_WIDTH
#define REG_VS_F2_LINE_S
#define REG_VS_F2_LINE_WIDTH
#define REG_VS_F1_PIX_S
#define REG_VS_F1_PIX_E
#define REG_VS_F2_PIX_S
#define REG_VS_F2_PIX_E
#define REG_FREF_F1_S
#define REG_FREF_F2_S
#define REG_FDW_S
#define REG_FDW_E
#define REG_BLK_GY
#define REG_BLK_BU
#define REG_BLK_RV
#define REG_FILTERS_CTRL
#define REG_DITHERING_CTRL
#define REG_OF
#define REG_PCLK
#define REG_HS_HREF
#define REG_VS_VREF
#define REG_DE_FREF
#define REG_VP35_32_CTRL
#define REG_VP31_28_CTRL
#define REG_VP27_24_CTRL
#define REG_VP23_20_CTRL
#define REG_VP19_16_CTRL
#define REG_VP15_12_CTRL
#define REG_VP11_08_CTRL
#define REG_VP07_04_CTRL
#define REG_VP03_00_CTRL
#define REG_CURPAGE_00H

#define MASK_VPER
#define MASK_VPER_SYNC_POS
#define MASK_VHREF
#define MASK_HPER
#define MASK_HPER_SYNC_POS
#define MASK_HSWIDTH
#define MASK_HSWIDTH_INTERLACED

/* HPD Detection */
#define DETECT_UTIL
#define DETECT_HPD
#define DETECT_5V_SEL
#define DETECT_5V_B
#define DETECT_5V_A

/* Input Select */
#define INPUT_SEL_RST_FMT
#define INPUT_SEL_RST_VDP
#define INPUT_SEL_OUT_MODE
#define INPUT_SEL_B

/* Service Mode */
#define SVC_MODE_CLK2_MASK
#define SVC_MODE_CLK2_SHIFT
#define SVC_MODE_CLK2_XTL
#define SVC_MODE_CLK2_XTLDIV2
#define SVC_MODE_CLK2_HDMIX2
#define SVC_MODE_CLK1_MASK
#define SVC_MODE_CLK1_SHIFT
#define SVC_MODE_CLK1_XTAL
#define SVC_MODE_CLK1_XTLDIV2
#define SVC_MODE_CLK1_HDMI
#define SVC_MODE_RAMP
#define SVC_MODE_PAL
#define SVC_MODE_INT_PROG
#define SVC_MODE_SM_ON

/* HDP Manual Control */
#define HPD_MAN_CTRL_HPD_PULSE
#define HPD_MAN_CTRL_5VEN
#define HPD_MAN_CTRL_HPD_B
#define HPD_MAN_CTRL_HPD_A

/* RT_MAN_CTRL */
#define RT_MAN_CTRL_RT_AUTO
#define RT_MAN_CTRL_RT
#define RT_MAN_CTRL_RT_B
#define RT_MAN_CTRL_RT_A

/* VDP_CTRL */
#define VDP_CTRL_COMPDEL_BP
#define VDP_CTRL_FORMATTER_BP
#define VDP_CTRL_PREFILTER_BP
#define VDP_CTRL_MATRIX_BP

/* REG_VHREF_CTRL */
#define VHREF_INT_DET
#define VHREF_VSYNC_MASK
#define VHREF_VSYNC_SHIFT
#define VHREF_VSYNC_AUTO
#define VHREF_VSYNC_FDW
#define VHREF_VSYNC_EVEN
#define VHREF_VSYNC_ODD
#define VHREF_STD_DET_MASK
#define VHREF_STD_DET_SHIFT
#define VHREF_STD_DET_PAL
#define VHREF_STD_DET_NTSC
#define VHREF_STD_DET_AUTO
#define VHREF_STD_DET_OFF
#define VHREF_VREF_SRC_STD
#define VHREF_HREF_SRC_STD
#define VHREF_HSYNC_SEL_HS

/* AUDIO_OUT_ENABLE */
#define AUDIO_OUT_ENABLE_ACLK
#define AUDIO_OUT_ENABLE_WS
#define AUDIO_OUT_ENABLE_AP3
#define AUDIO_OUT_ENABLE_AP2
#define AUDIO_OUT_ENABLE_AP1
#define AUDIO_OUT_ENABLE_AP0

/* Prefilter Control */
#define FILTERS_CTRL_BU_MASK
#define FILTERS_CTRL_BU_SHIFT
#define FILTERS_CTRL_RV_MASK
#define FILTERS_CTRL_RV_SHIFT
#define FILTERS_CTRL_OFF
#define FILTERS_CTRL_2TAP
#define FILTERS_CTRL_7TAP
#define FILTERS_CTRL_2_7TAP

/* PCLK Configuration */
#define PCLK_DELAY_MASK
#define PCLK_DELAY_SHIFT
#define PCLK_INV_SHIFT
#define PCLK_SEL_MASK
#define PCLK_SEL_SHIFT
#define PCLK_SEL_X1
#define PCLK_SEL_X2
#define PCLK_SEL_DIV2
#define PCLK_SEL_DIV4

/* Pixel Repeater */
#define PIX_REPEAT_MASK_UP_SEL
#define PIX_REPEAT_MASK_REP
#define PIX_REPEAT_SHIFT
#define PIX_REPEAT_CHROMA

/* Page 0x01 - HDMI info and packets */
#define REG_HDMI_FLAGS
#define REG_DEEP_COLOR_MODE
#define REG_AUDIO_FLAGS
#define REG_AUDIO_FREQ
#define REG_ACP_PACKET_TYPE
#define REG_ISRC1_PACKET_TYPE
#define REG_ISRC2_PACKET_TYPE
#define REG_GBD_PACKET_TYPE

/* HDMI_FLAGS */
#define HDMI_FLAGS_AUDIO
#define HDMI_FLAGS_HDMI
#define HDMI_FLAGS_EESS
#define HDMI_FLAGS_HDCP
#define HDMI_FLAGS_AVMUTE
#define HDMI_FLAGS_AUD_LAYOUT
#define HDMI_FLAGS_AUD_FIFO_OF
#define HDMI_FLAGS_AUD_FIFO_LOW

/* Page 0x12 - HDMI Extra control and debug */
#define REG_CLK_CFG
#define REG_CLK_OUT_CFG
#define REG_CFG1
#define REG_CFG2
#define REG_WDL_CFG
#define REG_DELOCK_DELAY
#define REG_PON_OVR_EN
#define REG_PON_CBIAS
#define REG_PON_RESCAL
#define REG_PON_RES
#define REG_PON_CLK
#define REG_PON_PLL
#define REG_PON_EQ
#define REG_PON_DES
#define REG_PON_OUT
#define REG_PON_MUX
#define REG_MODE_REC_CFG1
#define REG_MODE_REC_CFG2
#define REG_MODE_REC_STS
#define REG_AUDIO_LAYOUT

#define PON_EN
#define PON_DIS

/* CLK CFG */
#define CLK_CFG_INV_OUT_CLK
#define CLK_CFG_INV_BUS_CLK
#define CLK_CFG_SEL_ACLK_EN
#define CLK_CFG_SEL_ACLK
#define CLK_CFG_DIS

/* Page 0x13 - HDMI Extra control and debug */
#define REG_DEEP_COLOR_CTRL
#define REG_CGU_DBG_SEL
#define REG_HDCP_DDC_ADDR
#define REG_HDCP_KIDX
#define REG_DEEP_PLL7_BYP
#define REG_HDCP_DE_CTRL
#define REG_HDCP_EP_FILT_CTRL
#define REG_HDMI_CTRL
#define REG_HMTP_CTRL
#define REG_TIMER_D
#define REG_SUS_SET_RGB0
#define REG_SUS_SET_RGB1
#define REG_SUS_SET_RGB2
#define REG_SUS_SET_RGB3
#define REG_SUS_SET_RGB4
#define REG_MAN_SUS_HDMI_SEL
#define REG_MAN_HDMI_SET
#define REG_SUS_CLOCK_GOOD

/* HDCP DE Control */
#define HDCP_DE_MODE_MASK
#define HDCP_DE_MODE_SHIFT
#define HDCP_DE_REGEN_EN
#define HDCP_DE_FILTER_MASK
#define HDCP_DE_FILTER_SHIFT
#define HDCP_DE_COMP_MASK
#define HDCP_DE_COMP_MIXED
#define HDCP_DE_COMP_OR
#define HDCP_DE_COMP_AND
#define HDCP_DE_COMP_CH3
#define HDCP_DE_COMP_CH2
#define HDCP_DE_COMP_CH1
#define HDCP_DE_COMP_CH0

/* HDCP EP Filter Control */
#define HDCP_EP_FIL_CTL_MASK
#define HDCP_EP_FIL_CTL_SHIFT
#define HDCP_EP_FIL_VS_MASK
#define HDCP_EP_FIL_VS_SHIFT
#define HDCP_EP_FIL_HS_MASK
#define HDCP_EP_FIL_HS_SHIFT

/* HDMI_CTRL */
#define HDMI_CTRL_MUTE_MASK
#define HDMI_CTRL_MUTE_SHIFT
#define HDMI_CTRL_MUTE_AUTO
#define HDMI_CTRL_MUTE_OFF
#define HDMI_CTRL_MUTE_ON
#define HDMI_CTRL_HDCP_MASK
#define HDMI_CTRL_HDCP_SHIFT
#define HDMI_CTRL_HDCP_EESS
#define HDMI_CTRL_HDCP_OESS
#define HDMI_CTRL_HDCP_AUTO

/* CGU_DBG_SEL bits */
#define CGU_DBG_CLK_SEL_MASK
#define CGU_DBG_CLK_SEL_SHIFT
#define CGU_DBG_XO_FRO_SEL
#define CGU_DBG_VDP_CLK_SEL
#define CGU_DBG_PIX_CLK_SEL

/* REG_MAN_SUS_HDMI_SEL / REG_MAN_HDMI_SET bits */
#define MAN_DIS_OUT_BUF
#define MAN_DIS_ANA_PATH
#define MAN_DIS_HDCP
#define MAN_DIS_TMDS_ENC
#define MAN_DIS_TMDS_FLOW
#define MAN_RST_HDCP
#define MAN_RST_TMDS_ENC
#define MAN_RST_TMDS_FLOW

/* Page 0x14 - Audio Extra control and debug */
#define REG_FIFO_LATENCY_VAL
#define REG_AUDIO_CLOCK
#define REG_TEST_NCTS_CTRL
#define REG_TEST_AUDIO_FREQ
#define REG_TEST_MODE

/* Audio Clock Configuration */
#define AUDIO_CLOCK_PLL_PD
#define AUDIO_CLOCK_SEL_MASK
#define AUDIO_CLOCK_SEL_16FS
#define AUDIO_CLOCK_SEL_32FS
#define AUDIO_CLOCK_SEL_64FS
#define AUDIO_CLOCK_SEL_128FS
#define AUDIO_CLOCK_SEL_256FS
#define AUDIO_CLOCK_SEL_512FS

/* Page 0x20: EDID and Hotplug Detect */
#define REG_EDID_IN_BYTE0
#define REG_EDID_IN_VERSION
#define REG_EDID_ENABLE
#define REG_HPD_POWER
#define REG_HPD_AUTO_CTRL
#define REG_HPD_DURATION
#define REG_RX_HPD_HEAC

/* EDID_ENABLE */
#define EDID_ENABLE_NACK_OFF
#define EDID_ENABLE_EDID_ONLY
#define EDID_ENABLE_B_EN
#define EDID_ENABLE_A_EN

/* HPD Power */
#define HPD_POWER_BP_MASK
#define HPD_POWER_BP_SHIFT
#define HPD_POWER_BP_LOW
#define HPD_POWER_BP_HIGH
#define HPD_POWER_EDID_ONLY

/* HPD Auto control */
#define HPD_AUTO_READ_EDID
#define HPD_AUTO_HPD_F3TECH
#define HPD_AUTO_HP_OTHER
#define HPD_AUTO_HPD_UNSEL
#define HPD_AUTO_HPD_ALL_CH
#define HPD_AUTO_HPD_PRV_CH
#define HPD_AUTO_HPD_NEW_CH

/* Page 0x21 - EDID content */
#define REG_EDID_IN_BYTE128
#define REG_EDID_IN_SPA_SUB
#define REG_EDID_IN_SPA_AB_A
#define REG_EDID_IN_SPA_CD_A
#define REG_EDID_IN_CKSUM_A
#define REG_EDID_IN_SPA_AB_B
#define REG_EDID_IN_SPA_CD_B
#define REG_EDID_IN_CKSUM_B

/* Page 0x30 - NV Configuration */
#define REG_RT_AUTO_CTRL
#define REG_EQ_MAN_CTRL0
#define REG_EQ_MAN_CTRL1
#define REG_OUTPUT_CFG
#define REG_MUTE_CTRL
#define REG_SLAVE_ADDR
#define REG_CMTP_REG6
#define REG_CMTP_REG7
#define REG_CMTP_REG8
#define REG_CMTP_REG9
#define REG_CMTP_REGA
#define REG_CMTP_REGB
#define REG_CMTP_REGC
#define REG_CMTP_REGD
#define REG_CMTP_REGE
#define REG_CMTP_REGF
#define REG_CMTP_REG10
#define REG_CMTP_REG11

/* Page 0x80 - CEC */
#define REG_PWR_CONTROL
#define REG_OSC_DIVIDER
#define REG_EN_OSC_PERIOD_LSB
#define REG_CONTROL

/* global interrupt flags (INT_FLG_CRL_TOP) */
#define INTERRUPT_AFE
#define INTERRUPT_HDCP
#define INTERRUPT_AUDIO
#define INTERRUPT_INFO
#define INTERRUPT_MODE
#define INTERRUPT_RATE
#define INTERRUPT_DDC
#define INTERRUPT_SUS

/* INT_FLG_CLR_HDCP bits */
#define MASK_HDCP_MTP
#define MASK_HDCP_DLMTP
#define MASK_HDCP_DLRAM
#define MASK_HDCP_ENC
#define MASK_STATE_C5
#define MASK_AKSV

/* INT_FLG_CLR_RATE bits */
#define MASK_RATE_B_DRIFT
#define MASK_RATE_B_ST
#define MASK_RATE_B_ACT
#define MASK_RATE_B_PST
#define MASK_RATE_A_DRIFT
#define MASK_RATE_A_ST
#define MASK_RATE_A_ACT
#define MASK_RATE_A_PST

/* INT_FLG_CLR_SUS (Start Up Sequencer) bits */
#define MASK_MPT
#define MASK_FMT
#define MASK_RT_PULSE
#define MASK_SUS_END
#define MASK_SUS_ACT
#define MASK_SUS_CH
#define MASK_SUS_ST

/* INT_FLG_CLR_DDC bits */
#define MASK_EDID_MTP
#define MASK_DDC_ERR
#define MASK_DDC_CMD_DONE
#define MASK_READ_DONE
#define MASK_RX_DDC_SW
#define MASK_HDCP_DDC_SW
#define MASK_HDP_PULSE_END
#define MASK_DET_5V

/* INT_FLG_CLR_MODE bits */
#define MASK_HDMI_FLG
#define MASK_GAMUT
#define MASK_ISRC2
#define MASK_ISRC1
#define MASK_ACP
#define MASK_DC_NO_GCP
#define MASK_DC_PHASE
#define MASK_DC_MODE

/* INT_FLG_CLR_INFO bits (Infoframe Change Status) */
#define MASK_MPS_IF
#define MASK_AUD_IF
#define MASK_SPD_IF
#define MASK_AVI_IF
#define MASK_VS_IF_OTHER_BK2
#define MASK_VS_IF_OTHER_BK1
#define MASK_VS_IF_HDMI

/* INT_FLG_CLR_AUDIO bits */
#define MASK_AUDIO_FREQ_FLG
#define MASK_AUDIO_FLG
#define MASK_MUTE_FLG
#define MASK_CH_STATE
#define MASK_UNMUTE_FIFO
#define MASK_ERROR_FIFO_PT

/* INT_FLG_CLR_AFE bits */
#define MASK_AFE_WDL_UNLOCKED
#define MASK_AFE_GAIN_DONE
#define MASK_AFE_OFFSET_DONE
#define MASK_AFE_ACTIVITY_DET
#define MASK_AFE_PLL_LOCK
#define MASK_AFE_TRMCAL_DONE
#define MASK_AFE_ASU_STATE
#define MASK_AFE_ASU_READY

/* Audio Output */
#define AUDCFG_CLK_INVERT
#define AUDCFG_TEST_TONE
#define AUDCFG_BUS_SHIFT
#define AUDCFG_BUS_I2S
#define AUDCFG_BUS_SPDIF
#define AUDCFG_I2SW_SHIFT
#define AUDCFG_I2SW_16
#define AUDCFG_I2SW_32
#define AUDCFG_AUTO_MUTE_EN
#define AUDCFG_HBR_SHIFT
#define AUDCFG_HBR_STRAIGHT
#define AUDCFG_HBR_DEMUX
#define AUDCFG_TYPE_MASK
#define AUDCFG_TYPE_SHIFT
#define AUDCFG_TYPE_DST
#define AUDCFG_TYPE_OBA
#define AUDCFG_TYPE_HBR
#define AUDCFG_TYPE_PCM

/* Video Formatter */
#define OF_VP_ENABLE
#define OF_BLK
#define OF_TRC
#define OF_FMT_MASK
#define OF_FMT_444
#define OF_FMT_422_SMPT
#define OF_FMT_422_CCIR

/* HS/HREF output control */
#define HS_HREF_DELAY_MASK
#define HS_HREF_DELAY_SHIFT
#define HS_HREF_PXQ_SHIFT
#define HS_HREF_INV_SHIFT
#define HS_HREF_SEL_MASK
#define HS_HREF_SEL_SHIFT
#define HS_HREF_SEL_HS_VHREF
#define HS_HREF_SEL_HREF_VHREF
#define HS_HREF_SEL_HREF_HDMI
#define HS_HREF_SEL_NONE

/* VS output control */
#define VS_VREF_DELAY_MASK
#define VS_VREF_DELAY_SHIFT
#define VS_VREF_INV_SHIFT
#define VS_VREF_SEL_MASK
#define VS_VREF_SEL_SHIFT
#define VS_VREF_SEL_VS_VHREF
#define VS_VREF_SEL_VREF_VHREF
#define VS_VREF_SEL_VREF_HDMI
#define VS_VREF_SEL_NONE

/* DE/FREF output control */
#define DE_FREF_DELAY_MASK
#define DE_FREF_DELAY_SHIFT
#define DE_FREF_DE_PXQ_SHIFT
#define DE_FREF_INV_SHIFT
#define DE_FREF_SEL_MASK
#define DE_FREF_SEL_SHIFT
#define DE_FREF_SEL_DE_VHREF
#define DE_FREF_SEL_FREF_VHREF
#define DE_FREF_SEL_FREF_HDMI
#define DE_FREF_SEL_NONE

/* HDMI_SOFT_RST bits */
#define RESET_DC
#define RESET_HDCP
#define RESET_KSV
#define RESET_SCFG
#define RESET_HCFG
#define RESET_PA
#define RESET_EP
#define RESET_TMDS

/* HDMI_INFO_RST bits */
#define NACK_HDCP
#define RESET_FIFO
#define RESET_GAMUT
#define RESET_AI
#define RESET_IF
#define RESET_AUDIO

/* HDCP_BCAPS bits */
#define HDCP_HDMI
#define HDCP_REPEATER
#define HDCP_READY
#define HDCP_FAST
#define HDCP_11
#define HDCP_FAST_REAUTH

/* Audio output formatter */
#define AUDIO_LAYOUT_SP_FLAG
#define AUDIO_LAYOUT_MANUAL
#define AUDIO_LAYOUT_LAYOUT1

/* masks for interrupt status registers */
#define MASK_SUS_STATUS
#define LAST_STATE_REACHED
#define MASK_CLK_STABLE
#define MASK_CLK_ACTIVE
#define MASK_SUS_STATE
#define MASK_SR_FIFO_FIFO_CTRL
#define MASK_AUDIO_FLAG

/* Rate measurement */
#define RATE_REFTIM_ENABLE
#define CLK_MIN_RATE
#define CLK_MAX_RATE
#define WDL_CFG_VAL
#define DC_FILTER_VAL

/* Infoframe */
#define VS_HDMI_IF_UPDATE
#define VS_HDMI_IF
#define VS_BK1_IF_UPDATE
#define VS_BK1_IF
#define VS_BK2_IF_UPDATE
#define VS_BK2_IF
#define AVI_IF_UPDATE
#define AVI_IF
#define SPD_IF_UPDATE
#define SPD_IF
#define AUD_IF_UPDATE
#define AUD_IF
#define MPS_IF_UPDATE
#define MPS_IF