linux/drivers/media/i2c/tc358743_regs.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * tc358743 - Toshiba HDMI to CSI-2 bridge - register names and bit masks
 *
 * Copyright 2015 Cisco Systems, Inc. and/or its affiliates. All rights
 * reserved.
 */

/*
 * References (c = chapter, p = page):
 * REF_01 - Toshiba, TC358743XBG (H2C), Functional Specification, Rev 0.60
 */

/* Bit masks has prefix 'MASK_' and options after '_'. */

#ifndef __TC358743_REGS_H
#define __TC358743_REGS_H

#define CHIPID
#define MASK_CHIPID
#define MASK_REVID

#define SYSCTL
#define MASK_IRRST
#define MASK_CECRST
#define MASK_CTXRST
#define MASK_HDMIRST
#define MASK_SLEEP

#define CONFCTL
#define MASK_PWRISO
#define MASK_ACLKOPT
#define MASK_AUDCHNUM
#define MASK_AUDCHNUM_8
#define MASK_AUDCHNUM_6
#define MASK_AUDCHNUM_4
#define MASK_AUDCHNUM_2
#define MASK_AUDCHSEL
#define MASK_I2SDLYOPT
#define MASK_YCBCRFMT
#define MASK_YCBCRFMT_444
#define MASK_YCBCRFMT_422_12_BIT
#define MASK_YCBCRFMT_COLORBAR
#define MASK_YCBCRFMT_422_8_BIT
#define MASK_INFRMEN
#define MASK_AUDOUTSEL
#define MASK_AUDOUTSEL_CSI
#define MASK_AUDOUTSEL_I2S
#define MASK_AUDOUTSEL_TDM
#define MASK_AUTOINDEX
#define MASK_ABUFEN
#define MASK_VBUFEN

#define FIFOCTL

#define INTSTATUS
#define MASK_AMUTE_INT
#define MASK_HDMI_INT
#define MASK_CSI_INT
#define MASK_SYS_INT
#define MASK_CEC_EINT
#define MASK_CEC_TINT
#define MASK_CEC_RINT
#define MASK_IR_EINT
#define MASK_IR_DINT

#define INTMASK
#define MASK_AMUTE_MSK
#define MASK_HDMI_MSK
#define MASK_CSI_MSK
#define MASK_SYS_MSK
#define MASK_CEC_EMSK
#define MASK_CEC_TMSK
#define MASK_CEC_RMSK
#define MASK_IR_EMSK
#define MASK_IR_DMSK

#define INTFLAG
#define INTSYSSTATUS

#define PLLCTL0
#define MASK_PLL_PRD
#define SET_PLL_PRD(prd)
#define MASK_PLL_FBD
#define SET_PLL_FBD(fbd)

#define PLLCTL1
#define MASK_PLL_FRS
#define SET_PLL_FRS(frs)
#define MASK_PLL_LBWS
#define MASK_LFBREN
#define MASK_BYPCKEN
#define MASK_CKEN
#define MASK_RESETB
#define MASK_PLL_EN

#define CLW_CNTRL
#define MASK_CLW_LANEDISABLE

#define D0W_CNTRL
#define MASK_D0W_LANEDISABLE

#define D1W_CNTRL
#define MASK_D1W_LANEDISABLE

#define D2W_CNTRL
#define MASK_D2W_LANEDISABLE

#define D3W_CNTRL
#define MASK_D3W_LANEDISABLE

#define STARTCNTRL
#define MASK_START

#define LINEINITCNT
#define LPTXTIMECNT
#define TCLK_HEADERCNT
#define TCLK_TRAILCNT
#define THS_HEADERCNT
#define TWAKEUP
#define TCLK_POSTCNT
#define THS_TRAILCNT
#define HSTXVREGCNT

#define HSTXVREGEN
#define MASK_D3M_HSTXVREGEN
#define MASK_D2M_HSTXVREGEN
#define MASK_D1M_HSTXVREGEN
#define MASK_D0M_HSTXVREGEN
#define MASK_CLM_HSTXVREGEN


#define TXOPTIONCNTRL
#define MASK_CONTCLKMODE

#define CSI_CONTROL
#define MASK_CSI_MODE
#define MASK_HTXTOEN
#define MASK_TXHSMD
#define MASK_HSCKMD
#define MASK_NOL
#define MASK_NOL_1
#define MASK_NOL_2
#define MASK_NOL_3
#define MASK_NOL_4
#define MASK_EOTDIS

#define CSI_INT
#define MASK_INTHLT
#define MASK_INTER

#define CSI_INT_ENA
#define MASK_IENHLT
#define MASK_IENER

#define CSI_ERR
#define MASK_INER
#define MASK_WCER
#define MASK_QUNK
#define MASK_TXBRK

#define CSI_ERR_INTENA
#define CSI_ERR_HALT

#define CSI_CONFW
#define MASK_MODE
#define MASK_MODE_SET
#define MASK_MODE_CLEAR
#define MASK_ADDRESS
#define MASK_ADDRESS_CSI_CONTROL
#define MASK_ADDRESS_CSI_INT_ENA
#define MASK_ADDRESS_CSI_ERR_INTENA
#define MASK_ADDRESS_CSI_ERR_HALT
#define MASK_DATA

#define CSI_INT_CLR
#define MASK_ICRER

#define CSI_START
#define MASK_STRT

/* *** CEC (32 bit) *** */
#define CECHCLK
#define MASK_CECHCLK

#define CECLCLK
#define MASK_CECLCLK

#define CECEN
#define MASK_CECEN

#define CECADD
#define CECRST
#define MASK_CECRESET

#define CECREN
#define MASK_CECREN

#define CECRCTL1
#define MASK_CECACKDIS
#define MASK_CECHNC
#define MASK_CECLNC
#define MASK_CECMIN
#define MASK_CECMAX
#define MASK_CECDAT
#define MASK_CECTOUT
#define MASK_CECRIHLD
#define MASK_CECOTH

#define CECRCTL2
#define MASK_CECSWAV3
#define MASK_CECSWAV2
#define MASK_CECSWAV1
#define MASK_CECSWAV0

#define CECRCTL3
#define MASK_CECWAV3
#define MASK_CECWAV2
#define MASK_CECWAV1
#define MASK_CECWAV0
#define MASK_CECACKEI
#define MASK_CECMINEI
#define MASK_CECMAXEI
#define MASK_CECRSTEI
#define MASK_CECWAVEI

#define CECTEN
#define MASK_CECTBUSY
#define MASK_CECTEN

#define CECTCTL
#define MASK_CECSTRS
#define MASK_CECSPRD
#define MASK_CECDTRS
#define MASK_CECDPRD
#define MASK_CECBRD
#define MASK_CECFREE

#define CECRSTAT
#define MASK_CECRIWA
#define MASK_CECRIOR
#define MASK_CECRIACK
#define MASK_CECRIMIN
#define MASK_CECRIMAX
#define MASK_CECRISTA
#define MASK_CECRIEND

#define CECTSTAT
#define MASK_CECTIUR
#define MASK_CECTIACK
#define MASK_CECTIAL
#define MASK_CECTIEND

#define CECRBUF1
#define MASK_CECRACK
#define MASK_CECEOM
#define MASK_CECRBYTE

#define CECTBUF1
#define MASK_CECTEOM
#define MASK_CECTBYTE

#define CECRCTR
#define MASK_CECRCTR

#define CECIMSK
#define MASK_CECTIM
#define MASK_CECRIM

#define CECICLR
#define MASK_CECTICLR
#define MASK_CECRICLR


#define HDMI_INT0
#define MASK_I_KEY
#define MASK_I_MISC
#define MASK_I_PHYERR

#define HDMI_INT1
#define MASK_I_GBD
#define MASK_I_HDCP
#define MASK_I_ERR
#define MASK_I_AUD
#define MASK_I_CBIT
#define MASK_I_PACKET
#define MASK_I_CLK
#define MASK_I_SYS

#define SYS_INT
#define MASK_I_ACR_CTS
#define MASK_I_ACRN
#define MASK_I_DVI
#define MASK_I_HDMI
#define MASK_I_NOPMBDET
#define MASK_I_DPMBDET
#define MASK_I_TMDS
#define MASK_I_DDC

#define CLK_INT
#define MASK_I_OUT_H_CHG
#define MASK_I_IN_DE_CHG
#define MASK_I_IN_HV_CHG
#define MASK_I_DC_CHG
#define MASK_I_PXCLK_CHG
#define MASK_I_PHYCLK_CHG
#define MASK_I_TMDSCLK_CHG

#define CBIT_INT
#define MASK_I_AF_LOCK
#define MASK_I_AF_UNLOCK
#define MASK_I_CBIT_FS

#define AUDIO_INT

#define ERR_INT
#define MASK_I_EESS_ERR

#define HDCP_INT
#define MASK_I_AVM_SET
#define MASK_I_AVM_CLR
#define MASK_I_LINKERR
#define MASK_I_SHA_END
#define MASK_I_R0_END
#define MASK_I_KM_END
#define MASK_I_AKSV_END
#define MASK_I_AN_END

#define MISC_INT
#define MASK_I_AS_LAYOUT
#define MASK_I_NO_SPD
#define MASK_I_NO_VS
#define MASK_I_SYNC_CHG
#define MASK_I_AUDIO_MUTE

#define KEY_INT

#define SYS_INTM
#define MASK_M_ACR_CTS
#define MASK_M_ACR_N
#define MASK_M_DVI_DET
#define MASK_M_HDMI_DET
#define MASK_M_NOPMBDET
#define MASK_M_BPMBDET
#define MASK_M_TMDS
#define MASK_M_DDC

#define CLK_INTM
#define MASK_M_OUT_H_CHG
#define MASK_M_IN_DE_CHG
#define MASK_M_IN_HV_CHG
#define MASK_M_DC_CHG
#define MASK_M_PXCLK_CHG
#define MASK_M_PHYCLK_CHG
#define MASK_M_TMDS_CHG

#define PACKET_INTM

#define CBIT_INTM
#define MASK_M_AF_LOCK
#define MASK_M_AF_UNLOCK
#define MASK_M_CBIT_FS

#define AUDIO_INTM
#define MASK_M_BUFINIT_END

#define ERR_INTM
#define MASK_M_EESS_ERR

#define HDCP_INTM
#define MASK_M_AVM_SET
#define MASK_M_AVM_CLR
#define MASK_M_LINKERR
#define MASK_M_SHA_END
#define MASK_M_R0_END
#define MASK_M_KM_END
#define MASK_M_AKSV_END
#define MASK_M_AN_END

#define MISC_INTM
#define MASK_M_AS_LAYOUT
#define MASK_M_NO_SPD
#define MASK_M_NO_VS
#define MASK_M_SYNC_CHG
#define MASK_M_AUDIO_MUTE

#define KEY_INTM

#define SYS_STATUS
#define MASK_S_SYNC
#define MASK_S_AVMUTE
#define MASK_S_HDCP
#define MASK_S_HDMI
#define MASK_S_PHY_SCDT
#define MASK_S_PHY_PLL
#define MASK_S_TMDS
#define MASK_S_DDC5V

#define CSI_STATUS
#define MASK_S_WSYNC
#define MASK_S_TXACT
#define MASK_S_RXACT
#define MASK_S_HLT

#define VI_STATUS1
#define MASK_S_V_GBD
#define MASK_S_DEEPCOLOR
#define MASK_S_V_422
#define MASK_S_V_INTERLACE

#define AU_STATUS0
#define MASK_S_A_SAMPLE

#define VI_STATUS3
#define MASK_S_V_COLOR
#define MASK_LIMITED

#define PHY_CTL0
#define MASK_PHY_SYSCLK_IND
#define MASK_PHY_CTL


#define PHY_CTL1
#define MASK_PHY_AUTO_RST1
#define MASK_PHY_AUTO_RST1_OFF
#define SET_PHY_AUTO_RST1_US(us)
#define MASK_FREQ_RANGE_MODE
#define SET_FREQ_RANGE_MODE_CYCLES(cycles)

#define PHY_CTL2
#define MASK_PHY_AUTO_RST4
#define MASK_PHY_AUTO_RST3
#define MASK_PHY_AUTO_RST2
#define MASK_PHY_AUTO_RSTn

#define PHY_EN
#define MASK_ENABLE_PHY

#define PHY_RST
#define MASK_RESET_CTRL

#define PHY_BIAS

#define PHY_CSQ
#define MASK_CSQ_CNT
#define SET_CSQ_CNT_LEVEL(n)

#define SYS_FREQ0
#define SYS_FREQ1

#define SYS_CLK
#define MASK_CLK_DIFF
#define MASK_CLK_DIV

#define DDC_CTL
#define MASK_DDC_ACK_POL
#define MASK_DDC_ACTION
#define MASK_DDC5V_MODE
#define MASK_DDC5V_MODE_0MS
#define MASK_DDC5V_MODE_50MS
#define MASK_DDC5V_MODE_100MS
#define MASK_DDC5V_MODE_200MS

#define HPD_CTL
#define MASK_HPD_CTL0
#define MASK_HPD_OUT0

#define ANA_CTL
#define MASK_APPL_PCSX
#define MASK_APPL_PCSX_HIZ
#define MASK_APPL_PCSX_L_FIX
#define MASK_APPL_PCSX_H_FIX
#define MASK_APPL_PCSX_NORMAL
#define MASK_ANALOG_ON

#define AVM_CTL

#define INIT_END
#define MASK_INIT_END

#define HDMI_DET
#define MASK_HDMI_DET_MOD1
#define MASK_HDMI_DET_MOD0
#define MASK_HDMI_DET_V
#define MASK_HDMI_DET_V_SYNC
#define MASK_HDMI_DET_V_ASYNC_25MS
#define MASK_HDMI_DET_V_ASYNC_50MS
#define MASK_HDMI_DET_V_ASYNC_100MS
#define MASK_HDMI_DET_NUM

#define HDCP_MODE
#define MASK_MODE_RST_TN
#define MASK_LINE_REKEY
#define MASK_AUTO_CLR
#define MASK_MANUAL_AUTHENTICATION

#define HDCP_REG1
#define MASK_AUTH_UNAUTH_SEL
#define MASK_AUTH_UNAUTH_SEL_12_FRAMES
#define MASK_AUTH_UNAUTH_SEL_8_FRAMES
#define MASK_AUTH_UNAUTH_SEL_4_FRAMES
#define MASK_AUTH_UNAUTH_SEL_2_FRAMES
#define MASK_AUTH_UNAUTH_SEL_64_FRAMES
#define MASK_AUTH_UNAUTH_SEL_32_FRAMES
#define MASK_AUTH_UNAUTH_SEL_16_FRAMES
#define MASK_AUTH_UNAUTH_SEL_ONCE
#define MASK_AUTH_UNAUTH
#define MASK_AUTH_UNAUTH_AUTO

#define HDCP_REG2
#define MASK_AUTO_P3_RESET
#define SET_AUTO_P3_RESET_FRAMES(n)
#define MASK_AUTO_P3_RESET_OFF

#define VI_MODE
#define MASK_RGB_DVI

#define VOUT_SET2
#define MASK_SEL422
#define MASK_VOUT_422FIL_100
#define MASK_VOUTCOLORMODE
#define MASK_VOUTCOLORMODE_THROUGH
#define MASK_VOUTCOLORMODE_AUTO
#define MASK_VOUTCOLORMODE_MANUAL

#define VOUT_SET3
#define MASK_VOUT_EXTCNT

#define VI_REP
#define MASK_VOUT_COLOR_SEL
#define MASK_VOUT_COLOR_RGB_FULL
#define MASK_VOUT_COLOR_RGB_LIMITED
#define MASK_VOUT_COLOR_601_YCBCR_FULL
#define MASK_VOUT_COLOR_601_YCBCR_LIMITED
#define MASK_VOUT_COLOR_709_YCBCR_FULL
#define MASK_VOUT_COLOR_709_YCBCR_LIMITED
#define MASK_VOUT_COLOR_FULL_TO_LIMITED
#define MASK_VOUT_COLOR_LIMITED_TO_FULL
#define MASK_IN_REP_HEN
#define MASK_IN_REP

#define VI_MUTE
#define MASK_AUTO_MUTE
#define MASK_VI_MUTE

#define DE_WIDTH_H_LO
#define DE_WIDTH_H_HI
#define DE_WIDTH_V_LO
#define DE_WIDTH_V_HI
#define H_SIZE_LO
#define H_SIZE_HI
#define V_SIZE_LO
#define V_SIZE_HI
#define FV_CNT_LO
#define FV_CNT_HI

#define FH_MIN0
#define FH_MIN1
#define FH_MAX0
#define FH_MAX1

#define HV_RST
#define MASK_H_PI_RST
#define MASK_V_PI_RST

#define EDID_MODE
#define MASK_EDID_SPEED
#define MASK_EDID_MODE
#define MASK_EDID_MODE_DISABLE
#define MASK_EDID_MODE_DDC2B
#define MASK_EDID_MODE_E_DDC

#define EDID_LEN1
#define EDID_LEN2

#define HDCP_REG3
#define KEY_RD_CMD

#define FORCE_MUTE
#define MASK_FORCE_AMUTE
#define MASK_FORCE_DMUTE

#define CMD_AUD
#define MASK_CMD_BUFINIT
#define MASK_CMD_LOCKDET
#define MASK_CMD_MUTE

#define AUTO_CMD0
#define MASK_AUTO_MUTE7
#define MASK_AUTO_MUTE6
#define MASK_AUTO_MUTE5
#define MASK_AUTO_MUTE4
#define MASK_AUTO_MUTE3
#define MASK_AUTO_MUTE2
#define MASK_AUTO_MUTE1
#define MASK_AUTO_MUTE0

#define AUTO_CMD1
#define MASK_AUTO_MUTE10
#define MASK_AUTO_MUTE9
#define MASK_AUTO_MUTE8

#define AUTO_CMD2
#define MASK_AUTO_PLAY3
#define MASK_AUTO_PLAY2

#define BUFINIT_START
#define SET_BUFINIT_START_MS(milliseconds)

#define FS_MUTE
#define MASK_FS_ELSE_MUTE
#define MASK_FS22_MUTE
#define MASK_FS24_MUTE
#define MASK_FS88_MUTE
#define MASK_FS96_MUTE
#define MASK_FS176_MUTE
#define MASK_FS192_MUTE
#define MASK_FS_NO_MUTE

#define FS_IMODE
#define MASK_NLPCM_HMODE
#define MASK_NLPCM_SMODE
#define MASK_NLPCM_IMODE
#define MASK_FS_HMODE
#define MASK_FS_AMODE
#define MASK_FS_SMODE
#define MASK_FS_IMODE

#define FS_SET
#define MASK_FS

#define LOCKDET_REF0
#define LOCKDET_REF1
#define LOCKDET_REF2

#define ACR_MODE
#define MASK_ACR_LOAD
#define MASK_N_MODE
#define MASK_CTS_MODE

#define ACR_MDF0
#define MASK_ACR_L2MDF
#define MASK_ACR_L2MDF_0_PPM
#define MASK_ACR_L2MDF_61_PPM
#define MASK_ACR_L2MDF_122_PPM
#define MASK_ACR_L2MDF_244_PPM
#define MASK_ACR_L2MDF_488_PPM
#define MASK_ACR_L2MDF_976_PPM
#define MASK_ACR_L2MDF_1976_PPM
#define MASK_ACR_L2MDF_3906_PPM
#define MASK_ACR_L1MDF
#define MASK_ACR_L1MDF_0_PPM
#define MASK_ACR_L1MDF_61_PPM
#define MASK_ACR_L1MDF_122_PPM
#define MASK_ACR_L1MDF_244_PPM
#define MASK_ACR_L1MDF_488_PPM
#define MASK_ACR_L1MDF_976_PPM
#define MASK_ACR_L1MDF_1976_PPM
#define MASK_ACR_L1MDF_3906_PPM

#define ACR_MDF1
#define MASK_ACR_L3MDF
#define MASK_ACR_L3MDF_0_PPM
#define MASK_ACR_L3MDF_61_PPM
#define MASK_ACR_L3MDF_122_PPM
#define MASK_ACR_L3MDF_244_PPM
#define MASK_ACR_L3MDF_488_PPM
#define MASK_ACR_L3MDF_976_PPM
#define MASK_ACR_L3MDF_1976_PPM
#define MASK_ACR_L3MDF_3906_PPM

#define SDO_MODE1
#define MASK_SDO_BIT_LENG
#define MASK_SDO_FMT
#define MASK_SDO_FMT_RIGHT
#define MASK_SDO_FMT_LEFT
#define MASK_SDO_FMT_I2S

#define DIV_MODE
#define MASK_DIV_DLY
#define SET_DIV_DLY_MS(milliseconds)
#define MASK_DIV_MODE

#define NCO_F0_MOD
#define MASK_NCO_F0_MOD
#define MASK_NCO_F0_MOD_42MHZ
#define MASK_NCO_F0_MOD_27MHZ

#define PK_INT_MODE
#define MASK_ISRC2_INT_MODE
#define MASK_ISRC_INT_MODE
#define MASK_ACP_INT_MODE
#define MASK_VS_INT_MODE
#define MASK_SPD_INT_MODE
#define MASK_MS_INT_MODE
#define MASK_AUD_INT_MODE
#define MASK_AVI_INT_MODE

#define NO_PKT_LIMIT
#define MASK_NO_ACP_LIMIT
#define SET_NO_ACP_LIMIT_MS(milliseconds)
#define MASK_NO_AVI_LIMIT
#define SET_NO_AVI_LIMIT_MS(milliseconds)

#define NO_PKT_CLR
#define MASK_NO_VS_CLR
#define MASK_NO_SPD_CLR
#define MASK_NO_ACP_CLR
#define MASK_NO_AVI_CLR1
#define MASK_NO_AVI_CLR0

#define ERR_PK_LIMIT
#define NO_PKT_LIMIT2
#define PK_AVI_0HEAD
#define PK_AVI_1HEAD
#define PK_AVI_2HEAD
#define PK_AVI_0BYTE
#define PK_AVI_1BYTE
#define PK_AVI_2BYTE
#define PK_AVI_3BYTE
#define PK_AVI_4BYTE
#define PK_AVI_5BYTE
#define PK_AVI_6BYTE
#define PK_AVI_7BYTE
#define PK_AVI_8BYTE
#define PK_AVI_9BYTE
#define PK_AVI_10BYTE
#define PK_AVI_11BYTE
#define PK_AVI_12BYTE
#define PK_AVI_13BYTE
#define PK_AVI_14BYTE
#define PK_AVI_15BYTE
#define PK_AVI_16BYTE

#define BKSV

#define BCAPS
#define MASK_HDMI_RSVD
#define MASK_REPEATER
#define MASK_READY
#define MASK_FASTI2C
#define MASK_1_1_FEA
#define MASK_FAST_REAU

#define BSTATUS1
#define MASK_MAX_EXCED

#define EDID_RAM
#define NO_GDB_LIMIT

#endif