1*ad9301a2SIcenowy Zheng /* SPDX-License-Identifier: GPL-2.0-only */ 2*ad9301a2SIcenowy Zheng /* 3*ad9301a2SIcenowy Zheng * Copyright(c) 2016, Analogix Semiconductor. 4*ad9301a2SIcenowy Zheng * 5*ad9301a2SIcenowy Zheng * Based on anx7808 driver obtained from chromeos with copyright: 6*ad9301a2SIcenowy Zheng * Copyright(c) 2013, Google Inc. 7*ad9301a2SIcenowy Zheng */ 8*ad9301a2SIcenowy Zheng #ifndef _ANALOGIX_I2C_DPTX_H_ 9*ad9301a2SIcenowy Zheng #define _ANALOGIX_I2C_DPTX_H_ 10*ad9301a2SIcenowy Zheng 11*ad9301a2SIcenowy Zheng /***************************************************************/ 12*ad9301a2SIcenowy Zheng /* Register definitions for TX_P0 */ 13*ad9301a2SIcenowy Zheng /***************************************************************/ 14*ad9301a2SIcenowy Zheng 15*ad9301a2SIcenowy Zheng /* HDCP Status Register */ 16*ad9301a2SIcenowy Zheng #define SP_TX_HDCP_STATUS_REG 0x00 17*ad9301a2SIcenowy Zheng #define SP_AUTH_FAIL BIT(5) 18*ad9301a2SIcenowy Zheng #define SP_AUTHEN_PASS BIT(1) 19*ad9301a2SIcenowy Zheng 20*ad9301a2SIcenowy Zheng /* HDCP Control Register 0 */ 21*ad9301a2SIcenowy Zheng #define SP_HDCP_CTRL0_REG 0x01 22*ad9301a2SIcenowy Zheng #define SP_RX_REPEATER BIT(6) 23*ad9301a2SIcenowy Zheng #define SP_RE_AUTH BIT(5) 24*ad9301a2SIcenowy Zheng #define SP_SW_AUTH_OK BIT(4) 25*ad9301a2SIcenowy Zheng #define SP_HARD_AUTH_EN BIT(3) 26*ad9301a2SIcenowy Zheng #define SP_HDCP_ENC_EN BIT(2) 27*ad9301a2SIcenowy Zheng #define SP_BKSV_SRM_PASS BIT(1) 28*ad9301a2SIcenowy Zheng #define SP_KSVLIST_VLD BIT(0) 29*ad9301a2SIcenowy Zheng /* HDCP Function Enabled */ 30*ad9301a2SIcenowy Zheng #define SP_HDCP_FUNCTION_ENABLED (BIT(0) | BIT(1) | BIT(2) | BIT(3)) 31*ad9301a2SIcenowy Zheng 32*ad9301a2SIcenowy Zheng /* HDCP Receiver BSTATUS Register 0 */ 33*ad9301a2SIcenowy Zheng #define SP_HDCP_RX_BSTATUS0_REG 0x1b 34*ad9301a2SIcenowy Zheng /* HDCP Receiver BSTATUS Register 1 */ 35*ad9301a2SIcenowy Zheng #define SP_HDCP_RX_BSTATUS1_REG 0x1c 36*ad9301a2SIcenowy Zheng 37*ad9301a2SIcenowy Zheng /* HDCP Embedded "Blue Screen" Content Registers */ 38*ad9301a2SIcenowy Zheng #define SP_HDCP_VID0_BLUE_SCREEN_REG 0x2c 39*ad9301a2SIcenowy Zheng #define SP_HDCP_VID1_BLUE_SCREEN_REG 0x2d 40*ad9301a2SIcenowy Zheng #define SP_HDCP_VID2_BLUE_SCREEN_REG 0x2e 41*ad9301a2SIcenowy Zheng 42*ad9301a2SIcenowy Zheng /* HDCP Wait R0 Timing Register */ 43*ad9301a2SIcenowy Zheng #define SP_HDCP_WAIT_R0_TIME_REG 0x40 44*ad9301a2SIcenowy Zheng 45*ad9301a2SIcenowy Zheng /* HDCP Link Integrity Check Timer Register */ 46*ad9301a2SIcenowy Zheng #define SP_HDCP_LINK_CHECK_TIMER_REG 0x41 47*ad9301a2SIcenowy Zheng 48*ad9301a2SIcenowy Zheng /* HDCP Repeater Ready Wait Timer Register */ 49*ad9301a2SIcenowy Zheng #define SP_HDCP_RPTR_RDY_WAIT_TIME_REG 0x42 50*ad9301a2SIcenowy Zheng 51*ad9301a2SIcenowy Zheng /* HDCP Auto Timer Register */ 52*ad9301a2SIcenowy Zheng #define SP_HDCP_AUTO_TIMER_REG 0x51 53*ad9301a2SIcenowy Zheng 54*ad9301a2SIcenowy Zheng /* HDCP Key Status Register */ 55*ad9301a2SIcenowy Zheng #define SP_HDCP_KEY_STATUS_REG 0x5e 56*ad9301a2SIcenowy Zheng 57*ad9301a2SIcenowy Zheng /* HDCP Key Command Register */ 58*ad9301a2SIcenowy Zheng #define SP_HDCP_KEY_COMMAND_REG 0x5f 59*ad9301a2SIcenowy Zheng #define SP_DISABLE_SYNC_HDCP BIT(2) 60*ad9301a2SIcenowy Zheng 61*ad9301a2SIcenowy Zheng /* OTP Memory Key Protection Registers */ 62*ad9301a2SIcenowy Zheng #define SP_OTP_KEY_PROTECT1_REG 0x60 63*ad9301a2SIcenowy Zheng #define SP_OTP_KEY_PROTECT2_REG 0x61 64*ad9301a2SIcenowy Zheng #define SP_OTP_KEY_PROTECT3_REG 0x62 65*ad9301a2SIcenowy Zheng #define SP_OTP_PSW1 0xa2 66*ad9301a2SIcenowy Zheng #define SP_OTP_PSW2 0x7e 67*ad9301a2SIcenowy Zheng #define SP_OTP_PSW3 0xc6 68*ad9301a2SIcenowy Zheng 69*ad9301a2SIcenowy Zheng /* DP System Control Registers */ 70*ad9301a2SIcenowy Zheng #define SP_DP_SYSTEM_CTRL_BASE (0x80 - 1) 71*ad9301a2SIcenowy Zheng /* Bits for DP System Control Register 2 */ 72*ad9301a2SIcenowy Zheng #define SP_CHA_STA BIT(2) 73*ad9301a2SIcenowy Zheng /* Bits for DP System Control Register 3 */ 74*ad9301a2SIcenowy Zheng #define SP_HPD_STATUS BIT(6) 75*ad9301a2SIcenowy Zheng #define SP_STRM_VALID BIT(2) 76*ad9301a2SIcenowy Zheng /* Bits for DP System Control Register 4 */ 77*ad9301a2SIcenowy Zheng #define SP_ENHANCED_MODE BIT(3) 78*ad9301a2SIcenowy Zheng 79*ad9301a2SIcenowy Zheng /* DP Video Control Register */ 80*ad9301a2SIcenowy Zheng #define SP_DP_VIDEO_CTRL_REG 0x84 81*ad9301a2SIcenowy Zheng #define SP_COLOR_F_MASK 0x06 82*ad9301a2SIcenowy Zheng #define SP_COLOR_F_SHIFT 1 83*ad9301a2SIcenowy Zheng #define SP_BPC_MASK 0xe0 84*ad9301a2SIcenowy Zheng #define SP_BPC_SHIFT 5 85*ad9301a2SIcenowy Zheng # define SP_BPC_6BITS 0x00 86*ad9301a2SIcenowy Zheng # define SP_BPC_8BITS 0x01 87*ad9301a2SIcenowy Zheng # define SP_BPC_10BITS 0x02 88*ad9301a2SIcenowy Zheng # define SP_BPC_12BITS 0x03 89*ad9301a2SIcenowy Zheng 90*ad9301a2SIcenowy Zheng /* DP Audio Control Register */ 91*ad9301a2SIcenowy Zheng #define SP_DP_AUDIO_CTRL_REG 0x87 92*ad9301a2SIcenowy Zheng #define SP_AUD_EN BIT(0) 93*ad9301a2SIcenowy Zheng 94*ad9301a2SIcenowy Zheng /* 10us Pulse Generate Timer Registers */ 95*ad9301a2SIcenowy Zheng #define SP_I2C_GEN_10US_TIMER0_REG 0x88 96*ad9301a2SIcenowy Zheng #define SP_I2C_GEN_10US_TIMER1_REG 0x89 97*ad9301a2SIcenowy Zheng 98*ad9301a2SIcenowy Zheng /* Packet Send Control Register */ 99*ad9301a2SIcenowy Zheng #define SP_PACKET_SEND_CTRL_REG 0x90 100*ad9301a2SIcenowy Zheng #define SP_AUD_IF_UP BIT(7) 101*ad9301a2SIcenowy Zheng #define SP_AVI_IF_UD BIT(6) 102*ad9301a2SIcenowy Zheng #define SP_MPEG_IF_UD BIT(5) 103*ad9301a2SIcenowy Zheng #define SP_SPD_IF_UD BIT(4) 104*ad9301a2SIcenowy Zheng #define SP_AUD_IF_EN BIT(3) 105*ad9301a2SIcenowy Zheng #define SP_AVI_IF_EN BIT(2) 106*ad9301a2SIcenowy Zheng #define SP_MPEG_IF_EN BIT(1) 107*ad9301a2SIcenowy Zheng #define SP_SPD_IF_EN BIT(0) 108*ad9301a2SIcenowy Zheng 109*ad9301a2SIcenowy Zheng /* DP HDCP Control Register */ 110*ad9301a2SIcenowy Zheng #define SP_DP_HDCP_CTRL_REG 0x92 111*ad9301a2SIcenowy Zheng #define SP_AUTO_EN BIT(7) 112*ad9301a2SIcenowy Zheng #define SP_AUTO_START BIT(5) 113*ad9301a2SIcenowy Zheng #define SP_LINK_POLLING BIT(1) 114*ad9301a2SIcenowy Zheng 115*ad9301a2SIcenowy Zheng /* DP Main Link Bandwidth Setting Register */ 116*ad9301a2SIcenowy Zheng #define SP_DP_MAIN_LINK_BW_SET_REG 0xa0 117*ad9301a2SIcenowy Zheng #define SP_LINK_BW_SET_MASK 0x1f 118*ad9301a2SIcenowy Zheng #define SP_INITIAL_SLIM_M_AUD_SEL BIT(5) 119*ad9301a2SIcenowy Zheng 120*ad9301a2SIcenowy Zheng /* DP Training Pattern Set Register */ 121*ad9301a2SIcenowy Zheng #define SP_DP_TRAINING_PATTERN_SET_REG 0xa2 122*ad9301a2SIcenowy Zheng 123*ad9301a2SIcenowy Zheng /* DP Lane 0 Link Training Control Register */ 124*ad9301a2SIcenowy Zheng #define SP_DP_LANE0_LT_CTRL_REG 0xa3 125*ad9301a2SIcenowy Zheng #define SP_TX_SW_SET_MASK 0x1b 126*ad9301a2SIcenowy Zheng #define SP_MAX_PRE_REACH BIT(5) 127*ad9301a2SIcenowy Zheng #define SP_MAX_DRIVE_REACH BIT(4) 128*ad9301a2SIcenowy Zheng #define SP_PRE_EMP_LEVEL1 BIT(3) 129*ad9301a2SIcenowy Zheng #define SP_DRVIE_CURRENT_LEVEL1 BIT(0) 130*ad9301a2SIcenowy Zheng 131*ad9301a2SIcenowy Zheng /* DP Link Training Control Register */ 132*ad9301a2SIcenowy Zheng #define SP_DP_LT_CTRL_REG 0xa8 133*ad9301a2SIcenowy Zheng #define SP_LT_ERROR_TYPE_MASK 0x70 134*ad9301a2SIcenowy Zheng # define SP_LT_NO_ERROR 0x00 135*ad9301a2SIcenowy Zheng # define SP_LT_AUX_WRITE_ERROR 0x01 136*ad9301a2SIcenowy Zheng # define SP_LT_MAX_DRIVE_REACHED 0x02 137*ad9301a2SIcenowy Zheng # define SP_LT_WRONG_LANE_COUNT_SET 0x03 138*ad9301a2SIcenowy Zheng # define SP_LT_LOOP_SAME_5_TIME 0x04 139*ad9301a2SIcenowy Zheng # define SP_LT_CR_FAIL_IN_EQ 0x05 140*ad9301a2SIcenowy Zheng # define SP_LT_EQ_LOOP_5_TIME 0x06 141*ad9301a2SIcenowy Zheng #define SP_LT_EN BIT(0) 142*ad9301a2SIcenowy Zheng 143*ad9301a2SIcenowy Zheng /* DP CEP Training Control Registers */ 144*ad9301a2SIcenowy Zheng #define SP_DP_CEP_TRAINING_CTRL0_REG 0xa9 145*ad9301a2SIcenowy Zheng #define SP_DP_CEP_TRAINING_CTRL1_REG 0xaa 146*ad9301a2SIcenowy Zheng 147*ad9301a2SIcenowy Zheng /* DP Debug Register 1 */ 148*ad9301a2SIcenowy Zheng #define SP_DP_DEBUG1_REG 0xb0 149*ad9301a2SIcenowy Zheng #define SP_DEBUG_PLL_LOCK BIT(4) 150*ad9301a2SIcenowy Zheng #define SP_POLLING_EN BIT(1) 151*ad9301a2SIcenowy Zheng 152*ad9301a2SIcenowy Zheng /* DP Polling Control Register */ 153*ad9301a2SIcenowy Zheng #define SP_DP_POLLING_CTRL_REG 0xb4 154*ad9301a2SIcenowy Zheng #define SP_AUTO_POLLING_DISABLE BIT(0) 155*ad9301a2SIcenowy Zheng 156*ad9301a2SIcenowy Zheng /* DP Link Debug Control Register */ 157*ad9301a2SIcenowy Zheng #define SP_DP_LINK_DEBUG_CTRL_REG 0xb8 158*ad9301a2SIcenowy Zheng #define SP_M_VID_DEBUG BIT(5) 159*ad9301a2SIcenowy Zheng #define SP_NEW_PRBS7 BIT(4) 160*ad9301a2SIcenowy Zheng #define SP_INSERT_ER BIT(1) 161*ad9301a2SIcenowy Zheng #define SP_PRBS31_EN BIT(0) 162*ad9301a2SIcenowy Zheng 163*ad9301a2SIcenowy Zheng /* AUX Misc control Register */ 164*ad9301a2SIcenowy Zheng #define SP_AUX_MISC_CTRL_REG 0xbf 165*ad9301a2SIcenowy Zheng 166*ad9301a2SIcenowy Zheng /* DP PLL control Register */ 167*ad9301a2SIcenowy Zheng #define SP_DP_PLL_CTRL_REG 0xc7 168*ad9301a2SIcenowy Zheng #define SP_PLL_RST BIT(6) 169*ad9301a2SIcenowy Zheng 170*ad9301a2SIcenowy Zheng /* DP Analog Power Down Register */ 171*ad9301a2SIcenowy Zheng #define SP_DP_ANALOG_POWER_DOWN_REG 0xc8 172*ad9301a2SIcenowy Zheng #define SP_CH0_PD BIT(0) 173*ad9301a2SIcenowy Zheng 174*ad9301a2SIcenowy Zheng /* DP Misc Control Register */ 175*ad9301a2SIcenowy Zheng #define SP_DP_MISC_CTRL_REG 0xcd 176*ad9301a2SIcenowy Zheng #define SP_EQ_TRAINING_LOOP BIT(6) 177*ad9301a2SIcenowy Zheng 178*ad9301a2SIcenowy Zheng /* DP Extra I2C Device Address Register */ 179*ad9301a2SIcenowy Zheng #define SP_DP_EXTRA_I2C_DEV_ADDR_REG 0xce 180*ad9301a2SIcenowy Zheng #define SP_I2C_STRETCH_DISABLE BIT(7) 181*ad9301a2SIcenowy Zheng 182*ad9301a2SIcenowy Zheng #define SP_I2C_EXTRA_ADDR 0x50 183*ad9301a2SIcenowy Zheng 184*ad9301a2SIcenowy Zheng /* DP Downspread Control Register 1 */ 185*ad9301a2SIcenowy Zheng #define SP_DP_DOWNSPREAD_CTRL1_REG 0xd0 186*ad9301a2SIcenowy Zheng 187*ad9301a2SIcenowy Zheng /* DP M Value Calculation Control Register */ 188*ad9301a2SIcenowy Zheng #define SP_DP_M_CALCULATION_CTRL_REG 0xd9 189*ad9301a2SIcenowy Zheng #define SP_M_GEN_CLK_SEL BIT(0) 190*ad9301a2SIcenowy Zheng 191*ad9301a2SIcenowy Zheng /* AUX Channel Access Status Register */ 192*ad9301a2SIcenowy Zheng #define SP_AUX_CH_STATUS_REG 0xe0 193*ad9301a2SIcenowy Zheng #define SP_AUX_STATUS 0x0f 194*ad9301a2SIcenowy Zheng 195*ad9301a2SIcenowy Zheng /* AUX Channel DEFER Control Register */ 196*ad9301a2SIcenowy Zheng #define SP_AUX_DEFER_CTRL_REG 0xe2 197*ad9301a2SIcenowy Zheng #define SP_DEFER_CTRL_EN BIT(7) 198*ad9301a2SIcenowy Zheng 199*ad9301a2SIcenowy Zheng /* DP Buffer Data Count Register */ 200*ad9301a2SIcenowy Zheng #define SP_BUF_DATA_COUNT_REG 0xe4 201*ad9301a2SIcenowy Zheng #define SP_BUF_DATA_COUNT_MASK 0x1f 202*ad9301a2SIcenowy Zheng #define SP_BUF_CLR BIT(7) 203*ad9301a2SIcenowy Zheng 204*ad9301a2SIcenowy Zheng /* DP AUX Channel Control Register 1 */ 205*ad9301a2SIcenowy Zheng #define SP_DP_AUX_CH_CTRL1_REG 0xe5 206*ad9301a2SIcenowy Zheng #define SP_AUX_TX_COMM_MASK 0x0f 207*ad9301a2SIcenowy Zheng #define SP_AUX_LENGTH_MASK 0xf0 208*ad9301a2SIcenowy Zheng #define SP_AUX_LENGTH_SHIFT 4 209*ad9301a2SIcenowy Zheng 210*ad9301a2SIcenowy Zheng /* DP AUX CH Address Register 0 */ 211*ad9301a2SIcenowy Zheng #define SP_AUX_ADDR_7_0_REG 0xe6 212*ad9301a2SIcenowy Zheng 213*ad9301a2SIcenowy Zheng /* DP AUX CH Address Register 1 */ 214*ad9301a2SIcenowy Zheng #define SP_AUX_ADDR_15_8_REG 0xe7 215*ad9301a2SIcenowy Zheng 216*ad9301a2SIcenowy Zheng /* DP AUX CH Address Register 2 */ 217*ad9301a2SIcenowy Zheng #define SP_AUX_ADDR_19_16_REG 0xe8 218*ad9301a2SIcenowy Zheng #define SP_AUX_ADDR_19_16_MASK 0x0f 219*ad9301a2SIcenowy Zheng 220*ad9301a2SIcenowy Zheng /* DP AUX Channel Control Register 2 */ 221*ad9301a2SIcenowy Zheng #define SP_DP_AUX_CH_CTRL2_REG 0xe9 222*ad9301a2SIcenowy Zheng #define SP_AUX_SEL_RXCM BIT(6) 223*ad9301a2SIcenowy Zheng #define SP_AUX_CHSEL BIT(3) 224*ad9301a2SIcenowy Zheng #define SP_AUX_PN_INV BIT(2) 225*ad9301a2SIcenowy Zheng #define SP_ADDR_ONLY BIT(1) 226*ad9301a2SIcenowy Zheng #define SP_AUX_EN BIT(0) 227*ad9301a2SIcenowy Zheng 228*ad9301a2SIcenowy Zheng /* DP Video Stream Control InfoFrame Register */ 229*ad9301a2SIcenowy Zheng #define SP_DP_3D_VSC_CTRL_REG 0xea 230*ad9301a2SIcenowy Zheng #define SP_INFO_FRAME_VSC_EN BIT(0) 231*ad9301a2SIcenowy Zheng 232*ad9301a2SIcenowy Zheng /* DP Video Stream Data Byte 1 Register */ 233*ad9301a2SIcenowy Zheng #define SP_DP_VSC_DB1_REG 0xeb 234*ad9301a2SIcenowy Zheng 235*ad9301a2SIcenowy Zheng /* DP AUX Channel Control Register 3 */ 236*ad9301a2SIcenowy Zheng #define SP_DP_AUX_CH_CTRL3_REG 0xec 237*ad9301a2SIcenowy Zheng #define SP_WAIT_COUNTER_7_0_MASK 0xff 238*ad9301a2SIcenowy Zheng 239*ad9301a2SIcenowy Zheng /* DP AUX Channel Control Register 4 */ 240*ad9301a2SIcenowy Zheng #define SP_DP_AUX_CH_CTRL4_REG 0xed 241*ad9301a2SIcenowy Zheng 242*ad9301a2SIcenowy Zheng /* DP AUX Buffer Data Registers */ 243*ad9301a2SIcenowy Zheng #define SP_DP_BUF_DATA0_REG 0xf0 244*ad9301a2SIcenowy Zheng 245*ad9301a2SIcenowy Zheng #endif 246