/drivers/video/tegra/dc/dc_reg.h

https://bitbucket.org/cyanogenmod/android_kernel_asus_tf300t · C Header · 564 lines · 480 code · 65 blank · 19 comment · 0 complexity · 3675835c5dd4fd35f3806b8695ec453a MD5 · raw file

  1. /*
  2. * drivers/video/tegra/dc/dc_reg.h
  3. *
  4. * Copyright (C) 2010 Google, Inc.
  5. * Author: Erik Gilling <konkers@android.com>
  6. *
  7. * Copyright (c) 2010-2012, NVIDIA CORPORATION, All rights reserved.
  8. *
  9. * This software is licensed under the terms of the GNU General Public
  10. * License version 2, as published by the Free Software Foundation, and
  11. * may be copied, distributed, and modified under those terms.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. */
  19. #ifndef __DRIVERS_VIDEO_TEGRA_DC_DC_REG_H
  20. #define __DRIVERS_VIDEO_TEGRA_DC_DC_REG_H
  21. #define DC_CMD_GENERAL_INCR_SYNCPT 0x000
  22. #define DC_CMD_GENERAL_INCR_SYNCPT_CNTRL 0x001
  23. #define DC_CMD_GENERAL_INCR_SYNCPT_ERROR 0x002
  24. #define DC_CMD_WIN_A_INCR_SYNCPT 0x008
  25. #define DC_CMD_WIN_A_INCR_SYNCPT_CNTRL 0x009
  26. #define DC_CMD_WIN_A_INCR_SYNCPT_ERROR 0x00a
  27. #define DC_CMD_WIN_B_INCR_SYNCPT 0x010
  28. #define DC_CMD_WIN_B_INCR_SYNCPT_CNTRL 0x011
  29. #define DC_CMD_WIN_B_INCR_SYNCPT_ERROR 0x012
  30. #define DC_CMD_WIN_C_INCR_SYNCPT 0x018
  31. #define DC_CMD_WIN_C_INCR_SYNCPT_CNTRL 0x019
  32. #define DC_CMD_WIN_C_INCR_SYNCPT_ERROR 0x01a
  33. #define DC_CMD_CONT_SYNCPT_VSYNC 0x028
  34. #define DC_CMD_DISPLAY_COMMAND_OPTION0 0x031
  35. #define MSF_POLARITY_HIGH (0 << 0)
  36. #define MSF_POLARITY_LOW (1 << 0)
  37. #define MSF_DISABLE (0 << 1)
  38. #define MSF_ENABLE (1 << 1)
  39. #define MSF_LSPI (0 << 2)
  40. #define MSF_LDC (1 << 2)
  41. #define MSF_LSDI (2 << 2)
  42. #define DC_CMD_DISPLAY_COMMAND 0x032
  43. #define DISP_COMMAND_RAISE (1 << 0)
  44. #define DISP_CTRL_MODE_STOP (0 << 5)
  45. #define DISP_CTRL_MODE_C_DISPLAY (1 << 5)
  46. #define DISP_CTRL_MODE_NC_DISPLAY (2 << 5)
  47. #define DISP_COMMAND_RAISE_VECTOR(x) (((x) & 0x1f) << 22)
  48. #define DISP_COMMAND_RAISE_CHANNEL_ID(x) (((x) & 0xf) << 27)
  49. #define DC_CMD_SIGNAL_RAISE 0x033
  50. #define DC_CMD_DISPLAY_POWER_CONTROL 0x036
  51. #define PW0_ENABLE (1 << 0)
  52. #define PW1_ENABLE (1 << 2)
  53. #define PW2_ENABLE (1 << 4)
  54. #define PW3_ENABLE (1 << 6)
  55. #define PW4_ENABLE (1 << 8)
  56. #define PM0_ENABLE (1 << 16)
  57. #define PM1_ENABLE (1 << 18)
  58. #define SPI_ENABLE (1 << 24)
  59. #define HSPI_ENABLE (1 << 25)
  60. #define DC_CMD_INT_STATUS 0x037
  61. #define DC_CMD_INT_MASK 0x038
  62. #define DC_CMD_INT_ENABLE 0x039
  63. #define DC_CMD_INT_TYPE 0x03a
  64. #define DC_CMD_INT_POLARITY 0x03b
  65. #define CTXSW_INT (1 << 0)
  66. #define FRAME_END_INT (1 << 1)
  67. #define V_BLANK_INT (1 << 2)
  68. #define H_BLANK_INT (1 << 3)
  69. #define V_PULSE3_INT (1 << 4)
  70. #define SPI_BUSY_INT (1 << 7)
  71. #define WIN_A_UF_INT (1 << 8)
  72. #define WIN_B_UF_INT (1 << 9)
  73. #define WIN_C_UF_INT (1 << 10)
  74. #define MSF_INT (1 << 12)
  75. #define SSF_INT (1 << 13)
  76. #define WIN_A_OF_INT (1 << 14)
  77. #define WIN_B_OF_INT (1 << 15)
  78. #define WIN_C_OF_INT (1 << 16)
  79. #define GPIO_0_INT (1 << 18)
  80. #define GPIO_1_INT (1 << 19)
  81. #define GPIO_2_INT (1 << 20)
  82. #define DC_CMD_SIGNAL_RAISE1 0x03c
  83. #define DC_CMD_SIGNAL_RAISE2 0x03d
  84. #define DC_CMD_SIGNAL_RAISE3 0x03e
  85. #define DC_CMD_STATE_ACCESS 0x040
  86. #define READ_MUX_ASSEMBLY (0 << 0)
  87. #define READ_MUX_ACTIVE (1 << 0)
  88. #define WRITE_MUX_ASSEMBLY (0 << 2)
  89. #define WRITE_MUX_ACTIVE (1 << 2)
  90. #define DC_CMD_STATE_CONTROL 0x041
  91. #define GENERAL_ACT_REQ (1 << 0)
  92. #define WIN_A_ACT_REQ (1 << 1)
  93. #define WIN_B_ACT_REQ (1 << 2)
  94. #define WIN_C_ACT_REQ (1 << 3)
  95. #define GENERAL_UPDATE (1 << 8)
  96. #define WIN_A_UPDATE (1 << 9)
  97. #define WIN_B_UPDATE (1 << 10)
  98. #define WIN_C_UPDATE (1 << 11)
  99. #define NC_HOST_TRIG (1 << 24)
  100. #define DC_CMD_DISPLAY_WINDOW_HEADER 0x042
  101. #define WINDOW_A_SELECT (1 << 4)
  102. #define WINDOW_B_SELECT (1 << 5)
  103. #define WINDOW_C_SELECT (1 << 6)
  104. #define DC_CMD_REG_ACT_CONTROL 0x043
  105. #define DC_COM_CRC_CONTROL 0x300
  106. #define CRC_ALWAYS_ENABLE (1 << 3)
  107. #define CRC_ALWAYS_DISABLE (0 << 3)
  108. #define CRC_INPUT_DATA_ACTIVE_DATA (1 << 2)
  109. #define CRC_INPUT_DATA_FULL_FRAME (0 << 2)
  110. #define CRC_WAIT_TWO_VSYNC (1 << 1)
  111. #define CRC_WAIT_ONE_VSYNC (0 << 1)
  112. #define CRC_ENABLE_ENABLE (1 << 0)
  113. #define CRC_ENABLE_DISABLE (0 << 0)
  114. #define DC_COM_CRC_CHECKSUM 0x301
  115. #define DC_COM_PIN_OUTPUT_ENABLE0 0x302
  116. #define DC_COM_PIN_OUTPUT_ENABLE1 0x303
  117. #define DC_COM_PIN_OUTPUT_ENABLE2 0x304
  118. #define DC_COM_PIN_OUTPUT_ENABLE3 0x305
  119. #define PIN_OUTPUT_LSPI_OUTPUT_EN (1 << 8)
  120. #define PIN_OUTPUT_LSPI_OUTPUT_DIS (1 << 8)
  121. #define DC_COM_PIN_OUTPUT_POLARITY0 0x306
  122. #define DC_COM_PIN_OUTPUT_POLARITY1 0x307
  123. #define LHS_OUTPUT_POLARITY_LOW (1 << 30)
  124. #define LVS_OUTPUT_POLARITY_LOW (1 << 28)
  125. #define LSC0_OUTPUT_POLARITY_LOW (1 << 24)
  126. #define DC_COM_PIN_OUTPUT_POLARITY2 0x308
  127. #define DC_COM_PIN_OUTPUT_POLARITY3 0x309
  128. #define LSPI_OUTPUT_POLARITY_LOW (1 << 8)
  129. #define DC_COM_PIN_OUTPUT_DATA0 0x30a
  130. #define DC_COM_PIN_OUTPUT_DATA1 0x30b
  131. #define DC_COM_PIN_OUTPUT_DATA2 0x30c
  132. #define DC_COM_PIN_OUTPUT_DATA3 0x30d
  133. #define DC_COM_PIN_INPUT_ENABLE0 0x30e
  134. #define DC_COM_PIN_INPUT_ENABLE1 0x30f
  135. #define DC_COM_PIN_INPUT_ENABLE2 0x310
  136. #define DC_COM_PIN_INPUT_ENABLE3 0x311
  137. #define PIN_INPUT_LSPI_INPUT_EN (1 << 8)
  138. #define PIN_INPUT_LSPI_INPUT_DIS (1 << 8)
  139. #define DC_COM_PIN_INPUT_DATA0 0x312
  140. #define DC_COM_PIN_INPUT_DATA1 0x313
  141. #define DC_COM_PIN_OUTPUT_SELECT0 0x314
  142. #define DC_COM_PIN_OUTPUT_SELECT1 0x315
  143. #define DC_COM_PIN_OUTPUT_SELECT2 0x316
  144. #define DC_COM_PIN_OUTPUT_SELECT3 0x317
  145. #define DC_COM_PIN_OUTPUT_SELECT4 0x318
  146. #define DC_COM_PIN_OUTPUT_SELECT5 0x319
  147. #define DC_COM_PIN_OUTPUT_SELECT6 0x31a
  148. #define PIN5_LM1_LCD_M1_OUTPUT_MASK (7 << 4)
  149. #define PIN5_LM1_LCD_M1_OUTPUT_M1 (0 << 4)
  150. #define PIN5_LM1_LCD_M1_OUTPUT_LD21 (2 << 4)
  151. #define PIN5_LM1_LCD_M1_OUTPUT_PM1 (3 << 4)
  152. #define PIN1_LHS_OUTPUT (1 << 30)
  153. #define PIN1_LVS_OUTPUT (1 << 28)
  154. #define DC_COM_PIN_MISC_CONTROL 0x31b
  155. #define DC_COM_PM0_CONTROL 0x31c
  156. #define DC_COM_PM0_DUTY_CYCLE 0x31d
  157. #define DC_COM_PM1_CONTROL 0x31e
  158. #define DC_COM_PM1_DUTY_CYCLE 0x31f
  159. #define PM_PERIOD_SHIFT 18
  160. #define PM_CLK_DIVIDER_SHIFT 4
  161. #define DC_COM_SPI_CONTROL 0x320
  162. #define DC_COM_SPI_START_BYTE 0x321
  163. #define DC_COM_HSPI_WRITE_DATA_AB 0x322
  164. #define DC_COM_HSPI_WRITE_DATA_CD 0x323
  165. #define DC_COM_HSPI_CS_DC 0x324
  166. #define DC_COM_SCRATCH_REGISTER_A 0x325
  167. #define DC_COM_SCRATCH_REGISTER_B 0x326
  168. #define DC_COM_GPIO_CTRL 0x327
  169. #define DC_COM_GPIO_DEBOUNCE_COUNTER 0x328
  170. #define DC_COM_CRC_CHECKSUM_LATCHED 0x329
  171. #define DC_DISP_DISP_SIGNAL_OPTIONS0 0x400
  172. #define H_PULSE_0_ENABLE (1 << 8)
  173. #define H_PULSE_1_ENABLE (1 << 10)
  174. #define H_PULSE_2_ENABLE (1 << 12)
  175. #define V_PULSE_0_ENABLE (1 << 16)
  176. #define V_PULSE_1_ENABLE (1 << 18)
  177. #define V_PULSE_2_ENABLE (1 << 19)
  178. #define V_PULSE_3_ENABLE (1 << 20)
  179. #define M0_ENABLE (1 << 24)
  180. #define M1_ENABLE (1 << 26)
  181. #define DC_DISP_DISP_SIGNAL_OPTIONS1 0x401
  182. #define DI_ENABLE (1 << 16)
  183. #define PP_ENABLE (1 << 18)
  184. #define DC_DISP_DISP_WIN_OPTIONS 0x402
  185. #define CURSOR_ENABLE (1 << 16)
  186. #define TVO_ENABLE (1 << 28)
  187. #define DSI_ENABLE (1 << 29)
  188. #define HDMI_ENABLE (1 << 30)
  189. #define DC_DISP_MEM_HIGH_PRIORITY 0x403
  190. #define DC_DISP_MEM_HIGH_PRIORITY_TIMER 0x404
  191. #define DC_DISP_DISP_TIMING_OPTIONS 0x405
  192. #define VSYNC_H_POSITION(x) ((x) & 0xfff)
  193. #define DC_DISP_REF_TO_SYNC 0x406
  194. #define DC_DISP_SYNC_WIDTH 0x407
  195. #define DC_DISP_BACK_PORCH 0x408
  196. #define DC_DISP_DISP_ACTIVE 0x409
  197. #define DC_DISP_FRONT_PORCH 0x40a
  198. #define DC_DISP_H_PULSE0_CONTROL 0x40b
  199. #define DC_DISP_H_PULSE0_POSITION_A 0x40c
  200. #define DC_DISP_H_PULSE0_POSITION_B 0x40d
  201. #define DC_DISP_H_PULSE0_POSITION_C 0x40e
  202. #define DC_DISP_H_PULSE0_POSITION_D 0x40f
  203. #define DC_DISP_H_PULSE1_CONTROL 0x410
  204. #define DC_DISP_H_PULSE1_POSITION_A 0x411
  205. #define DC_DISP_H_PULSE1_POSITION_B 0x412
  206. #define DC_DISP_H_PULSE1_POSITION_C 0x413
  207. #define DC_DISP_H_PULSE1_POSITION_D 0x414
  208. #define DC_DISP_H_PULSE2_CONTROL 0x415
  209. #define DC_DISP_H_PULSE2_POSITION_A 0x416
  210. #define DC_DISP_H_PULSE2_POSITION_B 0x417
  211. #define DC_DISP_H_PULSE2_POSITION_C 0x418
  212. #define DC_DISP_H_PULSE2_POSITION_D 0x419
  213. #define DC_DISP_V_PULSE0_CONTROL 0x41a
  214. #define DC_DISP_V_PULSE0_POSITION_A 0x41b
  215. #define DC_DISP_V_PULSE0_POSITION_B 0x41c
  216. #define DC_DISP_V_PULSE0_POSITION_C 0x41d
  217. #define DC_DISP_V_PULSE1_CONTROL 0x41e
  218. #define DC_DISP_V_PULSE1_POSITION_A 0x41f
  219. #define DC_DISP_V_PULSE1_POSITION_B 0x420
  220. #define DC_DISP_V_PULSE1_POSITION_C 0x421
  221. #define DC_DISP_V_PULSE2_CONTROL 0x422
  222. #define DC_DISP_V_PULSE2_POSITION_A 0x423
  223. #define DC_DISP_V_PULSE3_CONTROL 0x424
  224. #define DC_DISP_V_PULSE3_POSITION_A 0x425
  225. #define DC_DISP_M0_CONTROL 0x426
  226. #define DC_DISP_M1_CONTROL 0x427
  227. #define DC_DISP_DI_CONTROL 0x428
  228. #define DC_DISP_PP_CONTROL 0x429
  229. #define DC_DISP_PP_SELECT_A 0x42a
  230. #define DC_DISP_PP_SELECT_B 0x42b
  231. #define DC_DISP_PP_SELECT_C 0x42c
  232. #define DC_DISP_PP_SELECT_D 0x42d
  233. #define PULSE_MODE_NORMAL (0 << 3)
  234. #define PULSE_MODE_ONE_CLOCK (1 << 3)
  235. #define PULSE_POLARITY_HIGH (0 << 4)
  236. #define PULSE_POLARITY_LOW (1 << 4)
  237. #define PULSE_QUAL_ALWAYS (0 << 6)
  238. #define PULSE_QUAL_VACTIVE (2 << 6)
  239. #define PULSE_QUAL_VACTIVE1 (3 << 6)
  240. #define PULSE_LAST_START_A (0 << 8)
  241. #define PULSE_LAST_END_A (1 << 8)
  242. #define PULSE_LAST_START_B (2 << 8)
  243. #define PULSE_LAST_END_B (3 << 8)
  244. #define PULSE_LAST_START_C (4 << 8)
  245. #define PULSE_LAST_END_C (5 << 8)
  246. #define PULSE_LAST_START_D (6 << 8)
  247. #define PULSE_LAST_END_D (7 << 8)
  248. #define PULSE_START(x) ((x) & 0xfff)
  249. #define PULSE_END(x) (((x) & 0xfff) << 16)
  250. #define DC_DISP_DISP_CLOCK_CONTROL 0x42e
  251. #define PIXEL_CLK_DIVIDER_PCD1 (0 << 8)
  252. #define PIXEL_CLK_DIVIDER_PCD1H (1 << 8)
  253. #define PIXEL_CLK_DIVIDER_PCD2 (2 << 8)
  254. #define PIXEL_CLK_DIVIDER_PCD3 (3 << 8)
  255. #define PIXEL_CLK_DIVIDER_PCD4 (4 << 8)
  256. #define PIXEL_CLK_DIVIDER_PCD6 (5 << 8)
  257. #define PIXEL_CLK_DIVIDER_PCD8 (6 << 8)
  258. #define PIXEL_CLK_DIVIDER_PCD9 (7 << 8)
  259. #define PIXEL_CLK_DIVIDER_PCD12 (8 << 8)
  260. #define PIXEL_CLK_DIVIDER_PCD16 (9 << 8)
  261. #define PIXEL_CLK_DIVIDER_PCD18 (10 << 8)
  262. #define PIXEL_CLK_DIVIDER_PCD24 (11 << 8)
  263. #define PIXEL_CLK_DIVIDER_PCD13 (12 << 8)
  264. #define SHIFT_CLK_DIVIDER(x) ((x) & 0xff)
  265. #define DC_DISP_DISP_INTERFACE_CONTROL 0x42f
  266. #define DISP_DATA_FORMAT_DF1P1C (0 << 0)
  267. #define DISP_DATA_FORMAT_DF1P2C24B (1 << 0)
  268. #define DISP_DATA_FORMAT_DF1P2C18B (2 << 0)
  269. #define DISP_DATA_FORMAT_DF1P2C16B (3 << 0)
  270. #define DISP_DATA_FORMAT_DF2S (5 << 0)
  271. #define DISP_DATA_FORMAT_DF3S (6 << 0)
  272. #define DISP_DATA_FORMAT_DFSPI (7 << 0)
  273. #define DISP_DATA_FORMAT_DF1P3C24B (8 << 0)
  274. #define DISP_DATA_FORMAT_DF1P3C18B (9 << 0)
  275. #define DISP_DATA_ALIGNMENT_MSB (0 << 8)
  276. #define DISP_DATA_ALIGNMENT_LSB (1 << 8)
  277. #define DISP_DATA_ORDER_RED_BLUE (0 << 9)
  278. #define DISP_DATA_ORDER_BLUE_RED (1 << 9)
  279. #define DC_DISP_DISP_COLOR_CONTROL 0x430
  280. #define BASE_COLOR_SIZE666 (0 << 0)
  281. #define BASE_COLOR_SIZE111 (1 << 0)
  282. #define BASE_COLOR_SIZE222 (2 << 0)
  283. #define BASE_COLOR_SIZE333 (3 << 0)
  284. #define BASE_COLOR_SIZE444 (4 << 0)
  285. #define BASE_COLOR_SIZE555 (5 << 0)
  286. #define BASE_COLOR_SIZE565 (6 << 0)
  287. #define BASE_COLOR_SIZE332 (7 << 0)
  288. #define BASE_COLOR_SIZE888 (8 << 0)
  289. #define DITHER_CONTROL_DISABLE (0 << 8)
  290. #define DITHER_CONTROL_ORDERED (2 << 8)
  291. #define DITHER_CONTROL_ERRDIFF (3 << 8)
  292. #define DC_DISP_SHIFT_CLOCK_OPTIONS 0x431
  293. #define DC_DISP_DATA_ENABLE_OPTIONS 0x432
  294. #define DE_SELECT_ACTIVE_BLANK 0x0
  295. #define DE_SELECT_ACTIVE 0x1
  296. #define DE_SELECT_ACTIVE_IS 0x2
  297. #define DE_CONTROL_ONECLK (0 << 2)
  298. #define DE_CONTROL_NORMAL (1 << 2)
  299. #define DE_CONTROL_EARLY_EXT (2 << 2)
  300. #define DE_CONTROL_EARLY (3 << 2)
  301. #define DE_CONTROL_ACTIVE_BLANK (4 << 2)
  302. #define DC_DISP_SERIAL_INTERFACE_OPTIONS 0x433
  303. #define DC_DISP_LCD_SPI_OPTIONS 0x434
  304. #define DC_DISP_BORDER_COLOR 0x435
  305. #define DC_DISP_COLOR_KEY0_LOWER 0x436
  306. #define DC_DISP_COLOR_KEY0_UPPER 0x437
  307. #define DC_DISP_COLOR_KEY1_LOWER 0x438
  308. #define DC_DISP_COLOR_KEY1_UPPER 0x439
  309. #define DC_DISP_CURSOR_FOREGROUND 0x43c
  310. #define DC_DISP_CURSOR_BACKGROUND 0x43d
  311. #define CURSOR_COLOR(_r, _g, _b) ((_r) | ((_g) << 8) | ((_b) << 16))
  312. #define DC_DISP_CURSOR_START_ADDR 0x43e
  313. #define DC_DISP_CURSOR_START_ADDR_NS 0x43f
  314. #define CURSOR_START_ADDR_MASK (((1 << 22) - 1) << 10)
  315. #define CURSOR_START_ADDR(_addr) ((_addr) >> 10)
  316. #define CURSOR_SIZE_64 (1 << 24)
  317. #define DC_DISP_CURSOR_POSITION 0x440
  318. #define CURSOR_POSITION(_x, _y) \
  319. (((_x) & ((1 << 16) - 1)) | \
  320. (((_y) & ((1 << 16) - 1)) << 16))
  321. #define DC_DISP_CURSOR_POSITION_NS 0x441
  322. #define DC_DISP_INIT_SEQ_CONTROL 0x442
  323. #define DC_DISP_SPI_INIT_SEQ_DATA_A 0x443
  324. #define DC_DISP_SPI_INIT_SEQ_DATA_B 0x444
  325. #define DC_DISP_SPI_INIT_SEQ_DATA_C 0x445
  326. #define DC_DISP_SPI_INIT_SEQ_DATA_D 0x446
  327. #define DC_DISP_DC_MCCIF_FIFOCTRL 0x480
  328. #define DC_DISP_MCCIF_DISPLAY0A_HYST 0x481
  329. #define DC_DISP_MCCIF_DISPLAY0B_HYST 0x482
  330. #define DC_DISP_MCCIF_DISPLAY0C_HYST 0x483
  331. #define DC_DISP_MCCIF_DISPLAY1B_HYST 0x484
  332. #define DC_DISP_DAC_CRT_CTRL 0x4c0
  333. #define DC_DISP_DISP_MISC_CONTROL 0x4c1
  334. #define UF_LINE_FLUSH (1 << 1)
  335. #define DC_WIN_COLOR_PALETTE(x) (0x500 + (x))
  336. #define DC_WIN_PALETTE_COLOR_EXT 0x600
  337. #define DC_WIN_H_FILTER_P(x) (0x601 + (x))
  338. #define DC_WIN_CSC_YOF 0x611
  339. #define DC_WIN_CSC_KYRGB 0x612
  340. #define DC_WIN_CSC_KUR 0x613
  341. #define DC_WIN_CSC_KVR 0x614
  342. #define DC_WIN_CSC_KUG 0x615
  343. #define DC_WIN_CSC_KVG 0x616
  344. #define DC_WIN_CSC_KUB 0x617
  345. #define DC_WIN_CSC_KVB 0x618
  346. #define DC_WIN_V_FILTER_P(x) (0x619 + (x))
  347. #define DC_WIN_WIN_OPTIONS 0x700
  348. #define H_DIRECTION_INCREMENT (0 << 0)
  349. #define H_DIRECTION_DECREMENT (1 << 0)
  350. #define V_DIRECTION_INCREMENT (0 << 2)
  351. #define V_DIRECTION_DECREMENT (1 << 2)
  352. #define COLOR_EXPAND (1 << 6)
  353. #define H_FILTER_ENABLE (1 << 8)
  354. #define V_FILTER_ENABLE (1 << 10)
  355. #define CP_ENABLE (1 << 16)
  356. #define CSC_ENABLE (1 << 18)
  357. #define DV_ENABLE (1 << 20)
  358. #define WIN_ENABLE (1 << 30)
  359. #define DC_WIN_BYTE_SWAP 0x701
  360. #define BYTE_SWAP_NOSWAP 0
  361. #define BYTE_SWAP_SWAP2 1
  362. #define BYTE_SWAP_SWAP4 2
  363. #define BYTE_SWAP_SWAP4HW 3
  364. #define DC_WIN_BUFFER_CONTROL 0x702
  365. #define BUFFER_CONTROL_HOST 0
  366. #define BUFFER_CONTROL_VI 1
  367. #define BUFFER_CONTROL_EPP 2
  368. #define BUFFER_CONTROL_MPEGE 3
  369. #define BUFFER_CONTROL_SB2D 4
  370. #define DC_WIN_COLOR_DEPTH 0x703
  371. #define DC_WIN_POSITION 0x704
  372. #define H_POSITION(x) (((x) & 0xfff) << 0)
  373. #define V_POSITION(x) (((x) & 0xfff) << 16)
  374. #define DC_WIN_SIZE 0x705
  375. #define H_SIZE(x) (((x) & 0xfff) << 0)
  376. #define V_SIZE(x) (((x) & 0xfff) << 16)
  377. #define DC_WIN_PRESCALED_SIZE 0x706
  378. #define H_PRESCALED_SIZE(x) (((x) & 0x3fff) << 0)
  379. #define V_PRESCALED_SIZE(x) (((x) & 0xfff) << 16)
  380. #define DC_WIN_H_INITIAL_DDA 0x707
  381. #define DC_WIN_V_INITIAL_DDA 0x708
  382. #define DC_WIN_DDA_INCREMENT 0x709
  383. #define H_DDA_INC(x) (((x) & 0xffff) << 0)
  384. #define V_DDA_INC(x) (((x) & 0xffff) << 16)
  385. #define DC_WIN_LINE_STRIDE 0x70a
  386. #define LINE_STRIDE(x) (x)
  387. #define UV_LINE_STRIDE(x) (((x) & 0xffff) << 16)
  388. #define GET_LINE_STRIDE(x) ((x) & 0xffff)
  389. #define GET_UV_LINE_STRIDE(x) (((x) >> 16) & 0xffff)
  390. #define DC_WIN_BUF_STRIDE 0x70b
  391. #define DC_WIN_UV_BUF_STRIDE 0x70c
  392. #define DC_WIN_BUFFER_ADDR_MODE 0x70d
  393. #define DC_WIN_BUFFER_ADDR_MODE_LINEAR (0 << 0)
  394. #define DC_WIN_BUFFER_ADDR_MODE_LINEAR_UV (0 << 16)
  395. #define DC_WIN_BUFFER_ADDR_MODE_TILE (1 << 0)
  396. #define DC_WIN_BUFFER_ADDR_MODE_TILE_UV (1 << 16)
  397. #define DC_WIN_DV_CONTROL 0x70e
  398. #define DC_WIN_BLEND_NOKEY 0x70f
  399. #define DC_WIN_BLEND_1WIN 0x710
  400. #define DC_WIN_BLEND_2WIN_X 0x711
  401. #define DC_WIN_BLEND_2WIN_Y 0x712
  402. #define DC_WIN_BLEND_3WIN_XY 0x713
  403. #define CKEY_NOKEY (0 << 0)
  404. #define CKEY_KEY0 (1 << 0)
  405. #define CKEY_KEY1 (2 << 0)
  406. #define CKEY_KEY01 (3 << 0)
  407. #define BLEND_CONTROL_FIX (0 << 2)
  408. #define BLEND_CONTROL_ALPHA (1 << 2)
  409. #define BLEND_CONTROL_DEPENDANT (2 << 2)
  410. #define BLEND_CONTROL_PREMULT (3 << 2)
  411. #define BLEND_WEIGHT0(x) (((x) & 0xff) << 8)
  412. #define BLEND_WEIGHT1(x) (((x) & 0xff) << 16)
  413. #define BLEND(key, control, weight0, weight1) \
  414. (CKEY_ ## key | BLEND_CONTROL_ ## control | \
  415. BLEND_WEIGHT0(weight0) | BLEND_WEIGHT1(weight1))
  416. #define DC_WIN_HP_FETCH_CONTROL 0x714
  417. #ifdef CONFIG_ARCH_TEGRA_3x_SOC
  418. #define DC_WIN_GLOBAL_ALPHA 0x715
  419. #define GLOBAL_ALPHA_ENABLE 0x10000
  420. #endif
  421. #define DC_WINBUF_START_ADDR 0x800
  422. #define DC_WINBUF_START_ADDR_NS 0x801
  423. #define DC_WINBUF_START_ADDR_U 0x802
  424. #define DC_WINBUF_START_ADDR_U_NS 0x803
  425. #define DC_WINBUF_START_ADDR_V 0x804
  426. #define DC_WINBUF_START_ADDR_V_NS 0x805
  427. #define DC_WINBUF_ADDR_H_OFFSET 0x806
  428. #define DC_WINBUF_ADDR_H_OFFSET_NS 0x807
  429. #define DC_WINBUF_ADDR_V_OFFSET 0x808
  430. #define DC_WINBUF_ADDR_V_OFFSET_NS 0x809
  431. #define DC_WINBUF_UFLOW_STATUS 0x80a
  432. /* direct versions of DC_WINBUF_UFLOW_STATUS */
  433. #define DC_WINBUF_AD_UFLOW_STATUS 0xbca
  434. #define DC_WINBUF_BD_UFLOW_STATUS 0xdca
  435. #define DC_WINBUF_CD_UFLOW_STATUS 0xfca
  436. #define DC_DISP_SD_CONTROL 0x4c2
  437. #define SD_ENABLE_NORMAL (1 << 0)
  438. #define SD_ENABLE_ONESHOT (2 << 0)
  439. #define SD_USE_VID_LUMA (1 << 2)
  440. #define SD_BIN_WIDTH_ONE (0 << 3)
  441. #define SD_BIN_WIDTH_TWO (1 << 3)
  442. #define SD_BIN_WIDTH_FOUR (2 << 3)
  443. #define SD_BIN_WIDTH_EIGHT (3 << 3)
  444. #define SD_BIN_WIDTH_MASK (3 << 3)
  445. #define SD_AGGRESSIVENESS(x) (((x) & 0x7) << 5)
  446. #define SD_HW_UPDATE_DLY(x) (((x) & 0x3) << 8)
  447. #define SD_ONESHOT_ENABLE (1 << 10)
  448. #define SD_CORRECTION_MODE_AUTO (0 << 11)
  449. #define SD_CORRECTION_MODE_MAN (1 << 11)
  450. #define NUM_BIN_WIDTHS 4
  451. #define STEPS_PER_AGG_LVL 64
  452. #define STEPS_PER_AGG_CHG_LOG2 5
  453. #define STEPS_PER_AGG_CHG (1<<STEPS_PER_AGG_CHG_LOG2)
  454. #define ADJ_PHASE_STEP 8
  455. #define K_STEP 4
  456. #define DC_DISP_SD_CSC_COEFF 0x4c3
  457. #define SD_CSC_COEFF_R(x) (((x) & 0xf) << 4)
  458. #define SD_CSC_COEFF_G(x) (((x) & 0xf) << 12)
  459. #define SD_CSC_COEFF_B(x) (((x) & 0xf) << 20)
  460. #define DC_DISP_SD_LUT(i) (0x4c4 + i)
  461. #define DC_DISP_SD_LUT_NUM 9
  462. #define SD_LUT_R(x) (((x) & 0xff) << 0)
  463. #define SD_LUT_G(x) (((x) & 0xff) << 8)
  464. #define SD_LUT_B(x) (((x) & 0xff) << 16)
  465. #define DC_DISP_SD_FLICKER_CONTROL 0x4cd
  466. #define SD_FC_TIME_LIMIT(x) (((x) & 0xff) << 0)
  467. #define SD_FC_THRESHOLD(x) (((x) & 0xff) << 8)
  468. #define DC_DISP_SD_PIXEL_COUNT 0x4ce
  469. #define DC_DISP_SD_HISTOGRAM(i) (0x4cf + i)
  470. #define DC_DISP_SD_HISTOGRAM_NUM 8
  471. #define SD_HISTOGRAM_BIN_0(val) (((val) & (0xff << 0)) >> 0)
  472. #define SD_HISTOGRAM_BIN_1(val) (((val) & (0xff << 8)) >> 8)
  473. #define SD_HISTOGRAM_BIN_2(val) (((val) & (0xff << 16)) >> 16)
  474. #define SD_HISTOGRAM_BIN_3(val) (((val) & (0xff << 24)) >> 24)
  475. #define DC_DISP_SD_BL_PARAMETERS 0x4d7
  476. #define SD_BLP_TIME_CONSTANT(x) (((x) & 0x7ff) << 0)
  477. #define SD_BLP_STEP(x) (((x) & 0xff) << 16)
  478. #define DC_DISP_SD_BL_TF(i) (0x4d8 + i)
  479. #define DC_DISP_SD_BL_TF_NUM 4
  480. #define SD_BL_TF_POINT_0(x) (((x) & 0xff) << 0)
  481. #define SD_BL_TF_POINT_1(x) (((x) & 0xff) << 8)
  482. #define SD_BL_TF_POINT_2(x) (((x) & 0xff) << 16)
  483. #define SD_BL_TF_POINT_3(x) (((x) & 0xff) << 24)
  484. #define DC_DISP_SD_BL_CONTROL 0x4dc
  485. #define SD_BLC_MODE_MAN (0 << 0)
  486. #define SD_BLC_MODE_AUTO (1 << 1)
  487. #define SD_BLC_BRIGHTNESS(val) (((val) & (0xff << 8)) >> 8)
  488. #define DC_DISP_SD_HW_K_VALUES 0x4dd
  489. #define SD_HW_K_R(val) (((val) & (0x3ff << 0)) >> 0)
  490. #define SD_HW_K_G(val) (((val) & (0x3ff << 10)) >> 10)
  491. #define SD_HW_K_B(val) (((val) & (0x3ff << 20)) >> 20)
  492. #define DC_DISP_SD_MAN_K_VALUES 0x4de
  493. #define SD_MAN_K_R(x) (((x) & 0x3ff) << 0)
  494. #define SD_MAN_K_G(x) (((x) & 0x3ff) << 10)
  495. #define SD_MAN_K_B(x) (((x) & 0x3ff) << 20)
  496. #define NUM_AGG_PRI_LVLS 4
  497. #define SD_AGG_PRI_LVL(x) ((x) >> 3)
  498. #define SD_GET_AGG(x) ((x) & 0x7)
  499. #endif