Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Copyright(c) 2016, Analogix Semiconductor. All rights reserved.
0004  */
0005 #ifndef _ANALOGIX_I2C_TXCOMMON_H_
0006 #define _ANALOGIX_I2C_TXCOMMON_H_
0007 
0008 /***************************************************************/
0009 /* Register definitions for TX_P2                              */
0010 /***************************************************************/
0011 
0012 /*
0013  * Core Register Definitions
0014  */
0015 
0016 /* Device ID Low Byte Register */
0017 #define SP_DEVICE_IDL_REG       0x02
0018 
0019 /* Device ID High Byte Register */
0020 #define SP_DEVICE_IDH_REG       0x03
0021 
0022 /* Device version register */
0023 #define SP_DEVICE_VERSION_REG       0x04
0024 
0025 /* Power Down Control Register */
0026 #define SP_POWERDOWN_CTRL_REG       0x05
0027 #define SP_REGISTER_PD          BIT(7)
0028 #define SP_HDCP_PD          BIT(5)
0029 #define SP_AUDIO_PD         BIT(4)
0030 #define SP_VIDEO_PD         BIT(3)
0031 #define SP_LINK_PD          BIT(2)
0032 #define SP_TOTAL_PD         BIT(1)
0033 
0034 /* Reset Control Register 1 */
0035 #define SP_RESET_CTRL1_REG      0x06
0036 #define SP_MISC_RST         BIT(7)
0037 #define SP_VIDCAP_RST           BIT(6)
0038 #define SP_VIDFIF_RST           BIT(5)
0039 #define SP_AUDFIF_RST           BIT(4)
0040 #define SP_AUDCAP_RST           BIT(3)
0041 #define SP_HDCP_RST         BIT(2)
0042 #define SP_SW_RST           BIT(1)
0043 #define SP_HW_RST           BIT(0)
0044 
0045 /* Reset Control Register 2 */
0046 #define SP_RESET_CTRL2_REG      0x07
0047 #define SP_AUX_RST          BIT(2)
0048 #define SP_SERDES_FIFO_RST      BIT(1)
0049 #define SP_I2C_REG_RST          BIT(0)
0050 
0051 /* Video Control Register 1 */
0052 #define SP_VID_CTRL1_REG        0x08
0053 #define SP_VIDEO_EN         BIT(7)
0054 #define SP_VIDEO_MUTE           BIT(2)
0055 #define SP_DE_GEN           BIT(1)
0056 #define SP_DEMUX            BIT(0)
0057 
0058 /* Video Control Register 2 */
0059 #define SP_VID_CTRL2_REG        0x09
0060 #define SP_IN_COLOR_F_MASK      0x03
0061 #define SP_IN_YC_BIT_SEL        BIT(2)
0062 #define SP_IN_BPC_MASK          0x70
0063 #define SP_IN_BPC_SHIFT         4
0064 #  define SP_IN_BPC_12BIT       0x03
0065 #  define SP_IN_BPC_10BIT       0x02
0066 #  define SP_IN_BPC_8BIT        0x01
0067 #  define SP_IN_BPC_6BIT        0x00
0068 #define SP_IN_D_RANGE           BIT(7)
0069 
0070 /* Video Control Register 3 */
0071 #define SP_VID_CTRL3_REG        0x0a
0072 #define SP_HPD_OUT          BIT(6)
0073 
0074 /* Video Control Register 5 */
0075 #define SP_VID_CTRL5_REG        0x0c
0076 #define SP_CSC_STD_SEL          BIT(7)
0077 #define SP_XVYCC_RNG_LMT        BIT(6)
0078 #define SP_RANGE_Y2R            BIT(5)
0079 #define SP_CSPACE_Y2R           BIT(4)
0080 #define SP_RGB_RNG_LMT          BIT(3)
0081 #define SP_Y_RNG_LMT            BIT(2)
0082 #define SP_RANGE_R2Y            BIT(1)
0083 #define SP_CSPACE_R2Y           BIT(0)
0084 
0085 /* Video Control Register 6 */
0086 #define SP_VID_CTRL6_REG        0x0d
0087 #define SP_TEST_PATTERN_EN      BIT(7)
0088 #define SP_VIDEO_PROCESS_EN     BIT(6)
0089 #define SP_VID_US_MODE          BIT(3)
0090 #define SP_VID_DS_MODE          BIT(2)
0091 #define SP_UP_SAMPLE            BIT(1)
0092 #define SP_DOWN_SAMPLE          BIT(0)
0093 
0094 /* Video Control Register 8 */
0095 #define SP_VID_CTRL8_REG        0x0f
0096 #define SP_VID_VRES_TH          BIT(0)
0097 
0098 /* Total Line Status Low Byte Register */
0099 #define SP_TOTAL_LINE_STAL_REG      0x24
0100 
0101 /* Total Line Status High Byte Register */
0102 #define SP_TOTAL_LINE_STAH_REG      0x25
0103 
0104 /* Active Line Status Low Byte Register */
0105 #define SP_ACT_LINE_STAL_REG        0x26
0106 
0107 /* Active Line Status High Byte Register */
0108 #define SP_ACT_LINE_STAH_REG        0x27
0109 
0110 /* Vertical Front Porch Status Register */
0111 #define SP_V_F_PORCH_STA_REG        0x28
0112 
0113 /* Vertical SYNC Width Status Register */
0114 #define SP_V_SYNC_STA_REG       0x29
0115 
0116 /* Vertical Back Porch Status Register */
0117 #define SP_V_B_PORCH_STA_REG        0x2a
0118 
0119 /* Total Pixel Status Low Byte Register */
0120 #define SP_TOTAL_PIXEL_STAL_REG     0x2b
0121 
0122 /* Total Pixel Status High Byte Register */
0123 #define SP_TOTAL_PIXEL_STAH_REG     0x2c
0124 
0125 /* Active Pixel Status Low Byte Register */
0126 #define SP_ACT_PIXEL_STAL_REG       0x2d
0127 
0128 /* Active Pixel Status High Byte Register */
0129 #define SP_ACT_PIXEL_STAH_REG       0x2e
0130 
0131 /* Horizontal Front Porch Status Low Byte Register */
0132 #define SP_H_F_PORCH_STAL_REG       0x2f
0133 
0134 /* Horizontal Front Porch Statys High Byte Register */
0135 #define SP_H_F_PORCH_STAH_REG       0x30
0136 
0137 /* Horizontal SYNC Width Status Low Byte Register */
0138 #define SP_H_SYNC_STAL_REG      0x31
0139 
0140 /* Horizontal SYNC Width Status High Byte Register */
0141 #define SP_H_SYNC_STAH_REG      0x32
0142 
0143 /* Horizontal Back Porch Status Low Byte Register */
0144 #define SP_H_B_PORCH_STAL_REG       0x33
0145 
0146 /* Horizontal Back Porch Status High Byte Register */
0147 #define SP_H_B_PORCH_STAH_REG       0x34
0148 
0149 /* InfoFrame AVI Packet DB1 Register */
0150 #define SP_INFOFRAME_AVI_DB1_REG    0x70
0151 
0152 /* Bit Control Specific Register */
0153 #define SP_BIT_CTRL_SPECIFIC_REG    0x80
0154 #define SP_BIT_CTRL_SELECT_SHIFT    1
0155 #define SP_ENABLE_BIT_CTRL      BIT(0)
0156 
0157 /* InfoFrame Audio Packet DB1 Register */
0158 #define SP_INFOFRAME_AUD_DB1_REG    0x83
0159 
0160 /* InfoFrame MPEG Packet DB1 Register */
0161 #define SP_INFOFRAME_MPEG_DB1_REG   0xb0
0162 
0163 /* Audio Channel Status Registers */
0164 #define SP_AUD_CH_STATUS_BASE       0xd0
0165 
0166 /* Audio Channel Num Register 5 */
0167 #define SP_I2S_CHANNEL_NUM_MASK     0xe0
0168 #  define SP_I2S_CH_NUM_1       (0x00 << 5)
0169 #  define SP_I2S_CH_NUM_2       (0x01 << 5)
0170 #  define SP_I2S_CH_NUM_3       (0x02 << 5)
0171 #  define SP_I2S_CH_NUM_4       (0x03 << 5)
0172 #  define SP_I2S_CH_NUM_5       (0x04 << 5)
0173 #  define SP_I2S_CH_NUM_6       (0x05 << 5)
0174 #  define SP_I2S_CH_NUM_7       (0x06 << 5)
0175 #  define SP_I2S_CH_NUM_8       (0x07 << 5)
0176 #define SP_EXT_VUCP         BIT(2)
0177 #define SP_VBIT             BIT(1)
0178 #define SP_AUDIO_LAYOUT         BIT(0)
0179 
0180 /* Analog Debug Register 1 */
0181 #define SP_ANALOG_DEBUG1_REG        0xdc
0182 
0183 /* Analog Debug Register 2 */
0184 #define SP_ANALOG_DEBUG2_REG        0xdd
0185 #define SP_FORCE_SW_OFF_BYPASS      0x20
0186 #define SP_XTAL_FRQ         0x1c
0187 #  define SP_XTAL_FRQ_19M2      (0x00 << 2)
0188 #  define SP_XTAL_FRQ_24M       (0x01 << 2)
0189 #  define SP_XTAL_FRQ_25M       (0x02 << 2)
0190 #  define SP_XTAL_FRQ_26M       (0x03 << 2)
0191 #  define SP_XTAL_FRQ_27M       (0x04 << 2)
0192 #  define SP_XTAL_FRQ_38M4      (0x05 << 2)
0193 #  define SP_XTAL_FRQ_52M       (0x06 << 2)
0194 #define SP_POWERON_TIME_1P5MS       0x03
0195 
0196 /* Analog Control 0 Register */
0197 #define SP_ANALOG_CTRL0_REG     0xe1
0198 
0199 /* Common Interrupt Status Register 1 */
0200 #define SP_COMMON_INT_STATUS_BASE   (0xf1 - 1)
0201 #define SP_PLL_LOCK_CHG         0x40
0202 
0203 /* Common Interrupt Status Register 2 */
0204 #define SP_COMMON_INT_STATUS2       0xf2
0205 #define SP_HDCP_AUTH_CHG        BIT(1)
0206 #define SP_HDCP_AUTH_DONE       BIT(0)
0207 
0208 #define SP_HDCP_LINK_CHECK_FAIL     BIT(0)
0209 
0210 /* Common Interrupt Status Register 4 */
0211 #define SP_COMMON_INT_STATUS4_REG   0xf4
0212 #define SP_HPD_IRQ          BIT(6)
0213 #define SP_HPD_ESYNC_ERR        BIT(4)
0214 #define SP_HPD_CHG          BIT(2)
0215 #define SP_HPD_LOST         BIT(1)
0216 #define SP_HPD_PLUG         BIT(0)
0217 
0218 /* DP Interrupt Status Register */
0219 #define SP_DP_INT_STATUS1_REG       0xf7
0220 #define SP_TRAINING_FINISH      BIT(5)
0221 #define SP_POLLING_ERR          BIT(4)
0222 
0223 /* Common Interrupt Mask Register */
0224 #define SP_COMMON_INT_MASK_BASE     (0xf8 - 1)
0225 
0226 #define SP_COMMON_INT_MASK4_REG     0xfb
0227 
0228 /* DP Interrupts Mask Register */
0229 #define SP_DP_INT_MASK1_REG     0xfe
0230 
0231 /* Interrupt Control Register */
0232 #define SP_INT_CTRL_REG         0xff
0233 
0234 #endif /* _ANALOGIX_I2C_TXCOMMON_H_ */