analogix-anx78xx.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719
  1. /*
  2. * Copyright(c) 2016, Analogix Semiconductor. All rights reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 and
  6. * only version 2 as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. */
  14. #ifndef __ANX78xx_H
  15. #define __ANX78xx_H
  16. #define TX_P0 0x70
  17. #define TX_P1 0x7a
  18. #define TX_P2 0x72
  19. #define RX_P0 0x7e
  20. #define RX_P1 0x80
  21. /***************************************************************/
  22. /* Register definition of device address 0x7e */
  23. /***************************************************************/
  24. /*
  25. * System Control and Status
  26. */
  27. /* Software Reset Register 1 */
  28. #define SP_SOFTWARE_RESET1_REG 0x11
  29. #define SP_VIDEO_RST BIT(4)
  30. #define SP_HDCP_MAN_RST BIT(2)
  31. #define SP_TMDS_RST BIT(1)
  32. #define SP_SW_MAN_RST BIT(0)
  33. /* System Status Register */
  34. #define SP_SYSTEM_STATUS_REG 0x14
  35. #define SP_TMDS_CLOCK_DET BIT(1)
  36. #define SP_TMDS_DE_DET BIT(0)
  37. /* HDMI Status Register */
  38. #define SP_HDMI_STATUS_REG 0x15
  39. #define SP_HDMI_AUD_LAYOUT BIT(3)
  40. #define SP_HDMI_DET BIT(0)
  41. # define SP_DVI_MODE 0
  42. # define SP_HDMI_MODE 1
  43. /* HDMI Mute Control Register */
  44. #define SP_HDMI_MUTE_CTRL_REG 0x16
  45. #define SP_AUD_MUTE BIT(1)
  46. #define SP_VID_MUTE BIT(0)
  47. /* System Power Down Register 1 */
  48. #define SP_SYSTEM_POWER_DOWN1_REG 0x18
  49. #define SP_PWDN_CTRL BIT(0)
  50. /*
  51. * Audio and Video Auto Control
  52. */
  53. /* Auto Audio and Video Control register */
  54. #define SP_AUDVID_CTRL_REG 0x20
  55. #define SP_AVC_OE BIT(7)
  56. #define SP_AAC_OE BIT(6)
  57. #define SP_AVC_EN BIT(1)
  58. #define SP_AAC_EN BIT(0)
  59. /* Audio Exception Enable Registers */
  60. #define SP_AUD_EXCEPTION_ENABLE_BASE (0x24 - 1)
  61. /* Bits for Audio Exception Enable Register 3 */
  62. #define SP_AEC_EN21 BIT(5)
  63. /*
  64. * Interrupt
  65. */
  66. /* Interrupt Status Register 1 */
  67. #define SP_INT_STATUS1_REG 0x31
  68. /* Bits for Interrupt Status Register 1 */
  69. #define SP_HDMI_DVI BIT(7)
  70. #define SP_CKDT_CHG BIT(6)
  71. #define SP_SCDT_CHG BIT(5)
  72. #define SP_PCLK_CHG BIT(4)
  73. #define SP_PLL_UNLOCK BIT(3)
  74. #define SP_CABLE_PLUG_CHG BIT(2)
  75. #define SP_SET_MUTE BIT(1)
  76. #define SP_SW_INTR BIT(0)
  77. /* Bits for Interrupt Status Register 2 */
  78. #define SP_HDCP_ERR BIT(5)
  79. #define SP_AUDIO_SAMPLE_CHG BIT(0) /* undocumented */
  80. /* Bits for Interrupt Status Register 3 */
  81. #define SP_AUD_MODE_CHG BIT(0)
  82. /* Bits for Interrupt Status Register 5 */
  83. #define SP_AUDIO_RCV BIT(0)
  84. /* Bits for Interrupt Status Register 6 */
  85. #define SP_INT_STATUS6_REG 0x36
  86. #define SP_CTS_RCV BIT(7)
  87. #define SP_NEW_AUD_PKT BIT(4)
  88. #define SP_NEW_AVI_PKT BIT(1)
  89. #define SP_NEW_CP_PKT BIT(0)
  90. /* Bits for Interrupt Status Register 7 */
  91. #define SP_NO_VSI BIT(7)
  92. #define SP_NEW_VS BIT(4)
  93. /* Interrupt Mask 1 Status Registers */
  94. #define SP_INT_MASK1_REG 0x41
  95. /* HDMI US TIMER Control Register */
  96. #define SP_HDMI_US_TIMER_CTRL_REG 0x49
  97. #define SP_MS_TIMER_MARGIN_10_8_MASK 0x07
  98. /*
  99. * TMDS Control
  100. */
  101. /* TMDS Control Registers */
  102. #define SP_TMDS_CTRL_BASE (0x50 - 1)
  103. /* Bits for TMDS Control Register 7 */
  104. #define SP_PD_RT BIT(0)
  105. /*
  106. * Video Control
  107. */
  108. /* Video Status Register */
  109. #define SP_VIDEO_STATUS_REG 0x70
  110. #define SP_COLOR_DEPTH_MASK 0xf0
  111. #define SP_COLOR_DEPTH_SHIFT 4
  112. # define SP_COLOR_DEPTH_MODE_LEGACY 0x00
  113. # define SP_COLOR_DEPTH_MODE_24BIT 0x04
  114. # define SP_COLOR_DEPTH_MODE_30BIT 0x05
  115. # define SP_COLOR_DEPTH_MODE_36BIT 0x06
  116. # define SP_COLOR_DEPTH_MODE_48BIT 0x07
  117. /* Video Data Range Control Register */
  118. #define SP_VID_DATA_RANGE_CTRL_REG 0x83
  119. #define SP_R2Y_INPUT_LIMIT BIT(1)
  120. /* Pixel Clock High Resolution Counter Registers */
  121. #define SP_PCLK_HIGHRES_CNT_BASE (0x8c - 1)
  122. /*
  123. * Audio Control
  124. */
  125. /* Number of Audio Channels Status Registers */
  126. #define SP_AUD_CH_STATUS_REG_NUM 6
  127. /* Audio IN S/PDIF Channel Status Registers */
  128. #define SP_AUD_SPDIF_CH_STATUS_BASE 0xc7
  129. /* Audio IN S/PDIF Channel Status Register 4 */
  130. #define SP_FS_FREQ_MASK 0x0f
  131. # define SP_FS_FREQ_44100HZ 0x00
  132. # define SP_FS_FREQ_48000HZ 0x02
  133. # define SP_FS_FREQ_32000HZ 0x03
  134. # define SP_FS_FREQ_88200HZ 0x08
  135. # define SP_FS_FREQ_96000HZ 0x0a
  136. # define SP_FS_FREQ_176400HZ 0x0c
  137. # define SP_FS_FREQ_192000HZ 0x0e
  138. /*
  139. * Micellaneous Control Block
  140. */
  141. /* CHIP Control Register */
  142. #define SP_CHIP_CTRL_REG 0xe3
  143. #define SP_MAN_HDMI5V_DET BIT(3)
  144. #define SP_PLLLOCK_CKDT_EN BIT(2)
  145. #define SP_ANALOG_CKDT_EN BIT(1)
  146. #define SP_DIGITAL_CKDT_EN BIT(0)
  147. /* Packet Receiving Status Register */
  148. #define SP_PACKET_RECEIVING_STATUS_REG 0xf3
  149. #define SP_AVI_RCVD BIT(5)
  150. #define SP_VSI_RCVD BIT(1)
  151. /***************************************************************/
  152. /* Register definition of device address 0x80 */
  153. /***************************************************************/
  154. /* HDCP BCAPS Shadow Register */
  155. #define SP_HDCP_BCAPS_SHADOW_REG 0x2a
  156. #define SP_BCAPS_REPEATER BIT(5)
  157. /* HDCP Status Register */
  158. #define SP_RX_HDCP_STATUS_REG 0x3f
  159. #define SP_AUTH_EN BIT(4)
  160. /*
  161. * InfoFrame and Control Packet Registers
  162. */
  163. /* AVI InfoFrame packet checksum */
  164. #define SP_AVI_INFOFRAME_CHECKSUM 0xa3
  165. /* AVI InfoFrame Registers */
  166. #define SP_AVI_INFOFRAME_DATA_BASE 0xa4
  167. #define SP_AVI_COLOR_F_MASK 0x60
  168. #define SP_AVI_COLOR_F_SHIFT 5
  169. /* Audio InfoFrame Registers */
  170. #define SP_AUD_INFOFRAME_DATA_BASE 0xc4
  171. #define SP_AUD_INFOFRAME_LAYOUT_MASK 0x0f
  172. /* MPEG/HDMI Vendor Specific InfoFrame Packet type code */
  173. #define SP_MPEG_VS_INFOFRAME_TYPE_REG 0xe0
  174. /* MPEG/HDMI Vendor Specific InfoFrame Packet length */
  175. #define SP_MPEG_VS_INFOFRAME_LEN_REG 0xe2
  176. /* MPEG/HDMI Vendor Specific InfoFrame Packet version number */
  177. #define SP_MPEG_VS_INFOFRAME_VER_REG 0xe1
  178. /* MPEG/HDMI Vendor Specific InfoFrame Packet content */
  179. #define SP_MPEG_VS_INFOFRAME_DATA_BASE 0xe4
  180. /* General Control Packet Register */
  181. #define SP_GENERAL_CTRL_PACKET_REG 0x9f
  182. #define SP_CLEAR_AVMUTE BIT(4)
  183. #define SP_SET_AVMUTE BIT(0)
  184. /***************************************************************/
  185. /* Register definition of device address 0x70 */
  186. /***************************************************************/
  187. /* HDCP Status Register */
  188. #define SP_TX_HDCP_STATUS_REG 0x00
  189. #define SP_AUTH_FAIL BIT(5)
  190. #define SP_AUTHEN_PASS BIT(1)
  191. /* HDCP Control Register 0 */
  192. #define SP_HDCP_CTRL0_REG 0x01
  193. #define SP_RX_REPEATER BIT(6)
  194. #define SP_RE_AUTH BIT(5)
  195. #define SP_SW_AUTH_OK BIT(4)
  196. #define SP_HARD_AUTH_EN BIT(3)
  197. #define SP_HDCP_ENC_EN BIT(2)
  198. #define SP_BKSV_SRM_PASS BIT(1)
  199. #define SP_KSVLIST_VLD BIT(0)
  200. /* HDCP Function Enabled */
  201. #define SP_HDCP_FUNCTION_ENABLED (BIT(0) | BIT(1) | BIT(2) | BIT(3))
  202. /* HDCP Receiver BSTATUS Register 0 */
  203. #define SP_HDCP_RX_BSTATUS0_REG 0x1b
  204. /* HDCP Receiver BSTATUS Register 1 */
  205. #define SP_HDCP_RX_BSTATUS1_REG 0x1c
  206. /* HDCP Embedded "Blue Screen" Content Registers */
  207. #define SP_HDCP_VID0_BLUE_SCREEN_REG 0x2c
  208. #define SP_HDCP_VID1_BLUE_SCREEN_REG 0x2d
  209. #define SP_HDCP_VID2_BLUE_SCREEN_REG 0x2e
  210. /* HDCP Wait R0 Timing Register */
  211. #define SP_HDCP_WAIT_R0_TIME_REG 0x40
  212. /* HDCP Link Integrity Check Timer Register */
  213. #define SP_HDCP_LINK_CHECK_TIMER_REG 0x41
  214. /* HDCP Repeater Ready Wait Timer Register */
  215. #define SP_HDCP_RPTR_RDY_WAIT_TIME_REG 0x42
  216. /* HDCP Auto Timer Register */
  217. #define SP_HDCP_AUTO_TIMER_REG 0x51
  218. /* HDCP Key Status Register */
  219. #define SP_HDCP_KEY_STATUS_REG 0x5e
  220. /* HDCP Key Command Register */
  221. #define SP_HDCP_KEY_COMMAND_REG 0x5f
  222. #define SP_DISABLE_SYNC_HDCP BIT(2)
  223. /* OTP Memory Key Protection Registers */
  224. #define SP_OTP_KEY_PROTECT1_REG 0x60
  225. #define SP_OTP_KEY_PROTECT2_REG 0x61
  226. #define SP_OTP_KEY_PROTECT3_REG 0x62
  227. #define SP_OTP_PSW1 0xa2
  228. #define SP_OTP_PSW2 0x7e
  229. #define SP_OTP_PSW3 0xc6
  230. /* DP System Control Registers */
  231. #define SP_DP_SYSTEM_CTRL_BASE (0x80 - 1)
  232. /* Bits for DP System Control Register 2 */
  233. #define SP_CHA_STA BIT(2)
  234. /* Bits for DP System Control Register 3 */
  235. #define SP_HPD_STATUS BIT(6)
  236. #define SP_STRM_VALID BIT(2)
  237. /* Bits for DP System Control Register 4 */
  238. #define SP_ENHANCED_MODE BIT(3)
  239. /* DP Video Control Register */
  240. #define SP_DP_VIDEO_CTRL_REG 0x84
  241. #define SP_COLOR_F_MASK 0x06
  242. #define SP_COLOR_F_SHIFT 1
  243. #define SP_BPC_MASK 0xe0
  244. #define SP_BPC_SHIFT 5
  245. # define SP_BPC_6BITS 0x00
  246. # define SP_BPC_8BITS 0x01
  247. # define SP_BPC_10BITS 0x02
  248. # define SP_BPC_12BITS 0x03
  249. /* DP Audio Control Register */
  250. #define SP_DP_AUDIO_CTRL_REG 0x87
  251. #define SP_AUD_EN BIT(0)
  252. /* 10us Pulse Generate Timer Registers */
  253. #define SP_I2C_GEN_10US_TIMER0_REG 0x88
  254. #define SP_I2C_GEN_10US_TIMER1_REG 0x89
  255. /* Packet Send Control Register */
  256. #define SP_PACKET_SEND_CTRL_REG 0x90
  257. #define SP_AUD_IF_UP BIT(7)
  258. #define SP_AVI_IF_UD BIT(6)
  259. #define SP_MPEG_IF_UD BIT(5)
  260. #define SP_SPD_IF_UD BIT(4)
  261. #define SP_AUD_IF_EN BIT(3)
  262. #define SP_AVI_IF_EN BIT(2)
  263. #define SP_MPEG_IF_EN BIT(1)
  264. #define SP_SPD_IF_EN BIT(0)
  265. /* DP HDCP Control Register */
  266. #define SP_DP_HDCP_CTRL_REG 0x92
  267. #define SP_AUTO_EN BIT(7)
  268. #define SP_AUTO_START BIT(5)
  269. #define SP_LINK_POLLING BIT(1)
  270. /* DP Main Link Bandwidth Setting Register */
  271. #define SP_DP_MAIN_LINK_BW_SET_REG 0xa0
  272. #define SP_LINK_BW_SET_MASK 0x1f
  273. #define SP_INITIAL_SLIM_M_AUD_SEL BIT(5)
  274. /* DP Training Pattern Set Register */
  275. #define SP_DP_TRAINING_PATTERN_SET_REG 0xa2
  276. /* DP Lane 0 Link Training Control Register */
  277. #define SP_DP_LANE0_LT_CTRL_REG 0xa3
  278. #define SP_TX_SW_SET_MASK 0x1b
  279. #define SP_MAX_PRE_REACH BIT(5)
  280. #define SP_MAX_DRIVE_REACH BIT(4)
  281. #define SP_PRE_EMP_LEVEL1 BIT(3)
  282. #define SP_DRVIE_CURRENT_LEVEL1 BIT(0)
  283. /* DP Link Training Control Register */
  284. #define SP_DP_LT_CTRL_REG 0xa8
  285. #define SP_LT_ERROR_TYPE_MASK 0x70
  286. # define SP_LT_NO_ERROR 0x00
  287. # define SP_LT_AUX_WRITE_ERROR 0x01
  288. # define SP_LT_MAX_DRIVE_REACHED 0x02
  289. # define SP_LT_WRONG_LANE_COUNT_SET 0x03
  290. # define SP_LT_LOOP_SAME_5_TIME 0x04
  291. # define SP_LT_CR_FAIL_IN_EQ 0x05
  292. # define SP_LT_EQ_LOOP_5_TIME 0x06
  293. #define SP_LT_EN BIT(0)
  294. /* DP CEP Training Control Registers */
  295. #define SP_DP_CEP_TRAINING_CTRL0_REG 0xa9
  296. #define SP_DP_CEP_TRAINING_CTRL1_REG 0xaa
  297. /* DP Debug Register 1 */
  298. #define SP_DP_DEBUG1_REG 0xb0
  299. #define SP_DEBUG_PLL_LOCK BIT(4)
  300. #define SP_POLLING_EN BIT(1)
  301. /* DP Polling Control Register */
  302. #define SP_DP_POLLING_CTRL_REG 0xb4
  303. #define SP_AUTO_POLLING_DISABLE BIT(0)
  304. /* DP Link Debug Control Register */
  305. #define SP_DP_LINK_DEBUG_CTRL_REG 0xb8
  306. #define SP_M_VID_DEBUG BIT(5)
  307. #define SP_NEW_PRBS7 BIT(4)
  308. #define SP_INSERT_ER BIT(1)
  309. #define SP_PRBS31_EN BIT(0)
  310. /* AUX Misc control Register */
  311. #define SP_AUX_MISC_CTRL_REG 0xbf
  312. /* DP PLL control Register */
  313. #define SP_DP_PLL_CTRL_REG 0xc7
  314. #define SP_PLL_RST BIT(6)
  315. /* DP Analog Power Down Register */
  316. #define SP_DP_ANALOG_POWER_DOWN_REG 0xc8
  317. #define SP_CH0_PD BIT(0)
  318. /* DP Misc Control Register */
  319. #define SP_DP_MISC_CTRL_REG 0xcd
  320. #define SP_EQ_TRAINING_LOOP BIT(6)
  321. /* DP Extra I2C Device Address Register */
  322. #define SP_DP_EXTRA_I2C_DEV_ADDR_REG 0xce
  323. #define SP_I2C_STRETCH_DISABLE BIT(7)
  324. #define SP_I2C_EXTRA_ADDR 0x50
  325. /* DP Downspread Control Register 1 */
  326. #define SP_DP_DOWNSPREAD_CTRL1_REG 0xd0
  327. /* DP M Value Calculation Control Register */
  328. #define SP_DP_M_CALCULATION_CTRL_REG 0xd9
  329. #define SP_M_GEN_CLK_SEL BIT(0)
  330. /* AUX Channel Access Status Register */
  331. #define SP_AUX_CH_STATUS_REG 0xe0
  332. #define SP_AUX_STATUS 0x0f
  333. /* AUX Channel DEFER Control Register */
  334. #define SP_AUX_DEFER_CTRL_REG 0xe2
  335. #define SP_DEFER_CTRL_EN BIT(7)
  336. /* DP Buffer Data Count Register */
  337. #define SP_BUF_DATA_COUNT_REG 0xe4
  338. #define SP_BUF_DATA_COUNT_MASK 0x1f
  339. #define SP_BUF_CLR BIT(7)
  340. /* DP AUX Channel Control Register 1 */
  341. #define SP_DP_AUX_CH_CTRL1_REG 0xe5
  342. #define SP_AUX_TX_COMM_MASK 0x0f
  343. #define SP_AUX_LENGTH_MASK 0xf0
  344. #define SP_AUX_LENGTH_SHIFT 4
  345. /* DP AUX CH Address Register 0 */
  346. #define SP_AUX_ADDR_7_0_REG 0xe6
  347. /* DP AUX CH Address Register 1 */
  348. #define SP_AUX_ADDR_15_8_REG 0xe7
  349. /* DP AUX CH Address Register 2 */
  350. #define SP_AUX_ADDR_19_16_REG 0xe8
  351. #define SP_AUX_ADDR_19_16_MASK 0x0f
  352. /* DP AUX Channel Control Register 2 */
  353. #define SP_DP_AUX_CH_CTRL2_REG 0xe9
  354. #define SP_AUX_SEL_RXCM BIT(6)
  355. #define SP_AUX_CHSEL BIT(3)
  356. #define SP_AUX_PN_INV BIT(2)
  357. #define SP_ADDR_ONLY BIT(1)
  358. #define SP_AUX_EN BIT(0)
  359. /* DP Video Stream Control InfoFrame Register */
  360. #define SP_DP_3D_VSC_CTRL_REG 0xea
  361. #define SP_INFO_FRAME_VSC_EN BIT(0)
  362. /* DP Video Stream Data Byte 1 Register */
  363. #define SP_DP_VSC_DB1_REG 0xeb
  364. /* DP AUX Channel Control Register 3 */
  365. #define SP_DP_AUX_CH_CTRL3_REG 0xec
  366. #define SP_WAIT_COUNTER_7_0_MASK 0xff
  367. /* DP AUX Channel Control Register 4 */
  368. #define SP_DP_AUX_CH_CTRL4_REG 0xed
  369. /* DP AUX Buffer Data Registers */
  370. #define SP_DP_BUF_DATA0_REG 0xf0
  371. /***************************************************************/
  372. /* Register definition of device address 0x72 */
  373. /***************************************************************/
  374. /*
  375. * Core Register Definitions
  376. */
  377. /* Device ID Low Byte Register */
  378. #define SP_DEVICE_IDL_REG 0x02
  379. /* Device ID High Byte Register */
  380. #define SP_DEVICE_IDH_REG 0x03
  381. /* Device version register */
  382. #define SP_DEVICE_VERSION_REG 0x04
  383. /* Power Down Control Register */
  384. #define SP_POWERDOWN_CTRL_REG 0x05
  385. #define SP_REGISTER_PD BIT(7)
  386. #define SP_HDCP_PD BIT(5)
  387. #define SP_AUDIO_PD BIT(4)
  388. #define SP_VIDEO_PD BIT(3)
  389. #define SP_LINK_PD BIT(2)
  390. #define SP_TOTAL_PD BIT(1)
  391. /* Reset Control Register 1 */
  392. #define SP_RESET_CTRL1_REG 0x06
  393. #define SP_MISC_RST BIT(7)
  394. #define SP_VIDCAP_RST BIT(6)
  395. #define SP_VIDFIF_RST BIT(5)
  396. #define SP_AUDFIF_RST BIT(4)
  397. #define SP_AUDCAP_RST BIT(3)
  398. #define SP_HDCP_RST BIT(2)
  399. #define SP_SW_RST BIT(1)
  400. #define SP_HW_RST BIT(0)
  401. /* Reset Control Register 2 */
  402. #define SP_RESET_CTRL2_REG 0x07
  403. #define SP_AUX_RST BIT(2)
  404. #define SP_SERDES_FIFO_RST BIT(1)
  405. #define SP_I2C_REG_RST BIT(0)
  406. /* Video Control Register 1 */
  407. #define SP_VID_CTRL1_REG 0x08
  408. #define SP_VIDEO_EN BIT(7)
  409. #define SP_VIDEO_MUTE BIT(2)
  410. #define SP_DE_GEN BIT(1)
  411. #define SP_DEMUX BIT(0)
  412. /* Video Control Register 2 */
  413. #define SP_VID_CTRL2_REG 0x09
  414. #define SP_IN_COLOR_F_MASK 0x03
  415. #define SP_IN_YC_BIT_SEL BIT(2)
  416. #define SP_IN_BPC_MASK 0x70
  417. #define SP_IN_BPC_SHIFT 4
  418. # define SP_IN_BPC_12BIT 0x03
  419. # define SP_IN_BPC_10BIT 0x02
  420. # define SP_IN_BPC_8BIT 0x01
  421. # define SP_IN_BPC_6BIT 0x00
  422. #define SP_IN_D_RANGE BIT(7)
  423. /* Video Control Register 3 */
  424. #define SP_VID_CTRL3_REG 0x0a
  425. #define SP_HPD_OUT BIT(6)
  426. /* Video Control Register 5 */
  427. #define SP_VID_CTRL5_REG 0x0c
  428. #define SP_CSC_STD_SEL BIT(7)
  429. #define SP_XVYCC_RNG_LMT BIT(6)
  430. #define SP_RANGE_Y2R BIT(5)
  431. #define SP_CSPACE_Y2R BIT(4)
  432. #define SP_RGB_RNG_LMT BIT(3)
  433. #define SP_Y_RNG_LMT BIT(2)
  434. #define SP_RANGE_R2Y BIT(1)
  435. #define SP_CSPACE_R2Y BIT(0)
  436. /* Video Control Register 6 */
  437. #define SP_VID_CTRL6_REG 0x0d
  438. #define SP_TEST_PATTERN_EN BIT(7)
  439. #define SP_VIDEO_PROCESS_EN BIT(6)
  440. #define SP_VID_US_MODE BIT(3)
  441. #define SP_VID_DS_MODE BIT(2)
  442. #define SP_UP_SAMPLE BIT(1)
  443. #define SP_DOWN_SAMPLE BIT(0)
  444. /* Video Control Register 8 */
  445. #define SP_VID_CTRL8_REG 0x0f
  446. #define SP_VID_VRES_TH BIT(0)
  447. /* Total Line Status Low Byte Register */
  448. #define SP_TOTAL_LINE_STAL_REG 0x24
  449. /* Total Line Status High Byte Register */
  450. #define SP_TOTAL_LINE_STAH_REG 0x25
  451. /* Active Line Status Low Byte Register */
  452. #define SP_ACT_LINE_STAL_REG 0x26
  453. /* Active Line Status High Byte Register */
  454. #define SP_ACT_LINE_STAH_REG 0x27
  455. /* Vertical Front Porch Status Register */
  456. #define SP_V_F_PORCH_STA_REG 0x28
  457. /* Vertical SYNC Width Status Register */
  458. #define SP_V_SYNC_STA_REG 0x29
  459. /* Vertical Back Porch Status Register */
  460. #define SP_V_B_PORCH_STA_REG 0x2a
  461. /* Total Pixel Status Low Byte Register */
  462. #define SP_TOTAL_PIXEL_STAL_REG 0x2b
  463. /* Total Pixel Status High Byte Register */
  464. #define SP_TOTAL_PIXEL_STAH_REG 0x2c
  465. /* Active Pixel Status Low Byte Register */
  466. #define SP_ACT_PIXEL_STAL_REG 0x2d
  467. /* Active Pixel Status High Byte Register */
  468. #define SP_ACT_PIXEL_STAH_REG 0x2e
  469. /* Horizontal Front Porch Status Low Byte Register */
  470. #define SP_H_F_PORCH_STAL_REG 0x2f
  471. /* Horizontal Front Porch Statys High Byte Register */
  472. #define SP_H_F_PORCH_STAH_REG 0x30
  473. /* Horizontal SYNC Width Status Low Byte Register */
  474. #define SP_H_SYNC_STAL_REG 0x31
  475. /* Horizontal SYNC Width Status High Byte Register */
  476. #define SP_H_SYNC_STAH_REG 0x32
  477. /* Horizontal Back Porch Status Low Byte Register */
  478. #define SP_H_B_PORCH_STAL_REG 0x33
  479. /* Horizontal Back Porch Status High Byte Register */
  480. #define SP_H_B_PORCH_STAH_REG 0x34
  481. /* InfoFrame AVI Packet DB1 Register */
  482. #define SP_INFOFRAME_AVI_DB1_REG 0x70
  483. /* Bit Control Specific Register */
  484. #define SP_BIT_CTRL_SPECIFIC_REG 0x80
  485. #define SP_BIT_CTRL_SELECT_SHIFT 1
  486. #define SP_ENABLE_BIT_CTRL BIT(0)
  487. /* InfoFrame Audio Packet DB1 Register */
  488. #define SP_INFOFRAME_AUD_DB1_REG 0x83
  489. /* InfoFrame MPEG Packet DB1 Register */
  490. #define SP_INFOFRAME_MPEG_DB1_REG 0xb0
  491. /* Audio Channel Status Registers */
  492. #define SP_AUD_CH_STATUS_BASE 0xd0
  493. /* Audio Channel Num Register 5 */
  494. #define SP_I2S_CHANNEL_NUM_MASK 0xe0
  495. # define SP_I2S_CH_NUM_1 (0x00 << 5)
  496. # define SP_I2S_CH_NUM_2 (0x01 << 5)
  497. # define SP_I2S_CH_NUM_3 (0x02 << 5)
  498. # define SP_I2S_CH_NUM_4 (0x03 << 5)
  499. # define SP_I2S_CH_NUM_5 (0x04 << 5)
  500. # define SP_I2S_CH_NUM_6 (0x05 << 5)
  501. # define SP_I2S_CH_NUM_7 (0x06 << 5)
  502. # define SP_I2S_CH_NUM_8 (0x07 << 5)
  503. #define SP_EXT_VUCP BIT(2)
  504. #define SP_VBIT BIT(1)
  505. #define SP_AUDIO_LAYOUT BIT(0)
  506. /* Analog Debug Register 2 */
  507. #define SP_ANALOG_DEBUG2_REG 0xdd
  508. #define SP_FORCE_SW_OFF_BYPASS 0x20
  509. #define SP_XTAL_FRQ 0x1c
  510. # define SP_XTAL_FRQ_19M2 (0x00 << 2)
  511. # define SP_XTAL_FRQ_24M (0x01 << 2)
  512. # define SP_XTAL_FRQ_25M (0x02 << 2)
  513. # define SP_XTAL_FRQ_26M (0x03 << 2)
  514. # define SP_XTAL_FRQ_27M (0x04 << 2)
  515. # define SP_XTAL_FRQ_38M4 (0x05 << 2)
  516. # define SP_XTAL_FRQ_52M (0x06 << 2)
  517. #define SP_POWERON_TIME_1P5MS 0x03
  518. /* Analog Control 0 Register */
  519. #define SP_ANALOG_CTRL0_REG 0xe1
  520. /* Common Interrupt Status Register 1 */
  521. #define SP_COMMON_INT_STATUS_BASE (0xf1 - 1)
  522. #define SP_PLL_LOCK_CHG 0x40
  523. /* Common Interrupt Status Register 2 */
  524. #define SP_COMMON_INT_STATUS2 0xf2
  525. #define SP_HDCP_AUTH_CHG BIT(1)
  526. #define SP_HDCP_AUTH_DONE BIT(0)
  527. #define SP_HDCP_LINK_CHECK_FAIL BIT(0)
  528. /* Common Interrupt Status Register 4 */
  529. #define SP_COMMON_INT_STATUS4_REG 0xf4
  530. #define SP_HPD_IRQ BIT(6)
  531. #define SP_HPD_ESYNC_ERR BIT(4)
  532. #define SP_HPD_CHG BIT(2)
  533. #define SP_HPD_LOST BIT(1)
  534. #define SP_HPD_PLUG BIT(0)
  535. /* DP Interrupt Status Register */
  536. #define SP_DP_INT_STATUS1_REG 0xf7
  537. #define SP_TRAINING_FINISH BIT(5)
  538. #define SP_POLLING_ERR BIT(4)
  539. /* Common Interrupt Mask Register */
  540. #define SP_COMMON_INT_MASK_BASE (0xf8 - 1)
  541. #define SP_COMMON_INT_MASK4_REG 0xfb
  542. /* DP Interrupts Mask Register */
  543. #define SP_DP_INT_MASK1_REG 0xfe
  544. /* Interrupt Control Register */
  545. #define SP_INT_CTRL_REG 0xff
  546. /***************************************************************/
  547. /* Register definition of device address 0x7a */
  548. /***************************************************************/
  549. /* DP TX Link Training Control Register */
  550. #define SP_DP_TX_LT_CTRL0_REG 0x30
  551. /* PD 1.2 Lint Training 80bit Pattern Register */
  552. #define SP_DP_LT_80BIT_PATTERN0_REG 0x80
  553. #define SP_DP_LT_80BIT_PATTERN_REG_NUM 10
  554. /* Audio Interface Control Register 0 */
  555. #define SP_AUD_INTERFACE_CTRL0_REG 0x5f
  556. #define SP_AUD_INTERFACE_DISABLE 0x80
  557. /* Audio Interface Control Register 2 */
  558. #define SP_AUD_INTERFACE_CTRL2_REG 0x60
  559. #define SP_M_AUD_ADJUST_ST 0x04
  560. /* Audio Interface Control Register 3 */
  561. #define SP_AUD_INTERFACE_CTRL3_REG 0x62
  562. /* Audio Interface Control Register 4 */
  563. #define SP_AUD_INTERFACE_CTRL4_REG 0x67
  564. /* Audio Interface Control Register 5 */
  565. #define SP_AUD_INTERFACE_CTRL5_REG 0x68
  566. /* Audio Interface Control Register 6 */
  567. #define SP_AUD_INTERFACE_CTRL6_REG 0x69
  568. /* Firmware Version Register */
  569. #define SP_FW_VER_REG 0xb7
  570. #endif