intel_sdvo_regs.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719
  1. /*
  2. * Copyright © 2006-2007 Intel Corporation
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice (including the next
  12. * paragraph) shall be included in all copies or substantial portions of the
  13. * Software.
  14. *
  15. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  18. * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  20. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  21. * DEALINGS IN THE SOFTWARE.
  22. *
  23. * Authors:
  24. * Eric Anholt <eric@anholt.net>
  25. */
  26. /**
  27. * @file SDVO command definitions and structures.
  28. */
  29. #define SDVO_OUTPUT_FIRST (0)
  30. #define SDVO_OUTPUT_TMDS0 (1 << 0)
  31. #define SDVO_OUTPUT_RGB0 (1 << 1)
  32. #define SDVO_OUTPUT_CVBS0 (1 << 2)
  33. #define SDVO_OUTPUT_SVID0 (1 << 3)
  34. #define SDVO_OUTPUT_YPRPB0 (1 << 4)
  35. #define SDVO_OUTPUT_SCART0 (1 << 5)
  36. #define SDVO_OUTPUT_LVDS0 (1 << 6)
  37. #define SDVO_OUTPUT_TMDS1 (1 << 8)
  38. #define SDVO_OUTPUT_RGB1 (1 << 9)
  39. #define SDVO_OUTPUT_CVBS1 (1 << 10)
  40. #define SDVO_OUTPUT_SVID1 (1 << 11)
  41. #define SDVO_OUTPUT_YPRPB1 (1 << 12)
  42. #define SDVO_OUTPUT_SCART1 (1 << 13)
  43. #define SDVO_OUTPUT_LVDS1 (1 << 14)
  44. #define SDVO_OUTPUT_LAST (14)
  45. struct intel_sdvo_caps {
  46. u8 vendor_id;
  47. u8 device_id;
  48. u8 device_rev_id;
  49. u8 sdvo_version_major;
  50. u8 sdvo_version_minor;
  51. unsigned int sdvo_inputs_mask:2;
  52. unsigned int smooth_scaling:1;
  53. unsigned int sharp_scaling:1;
  54. unsigned int up_scaling:1;
  55. unsigned int down_scaling:1;
  56. unsigned int stall_support:1;
  57. unsigned int pad:1;
  58. u16 output_flags;
  59. } __attribute__((packed));
  60. /** This matches the EDID DTD structure, more or less */
  61. struct intel_sdvo_dtd {
  62. struct {
  63. u16 clock; /**< pixel clock, in 10kHz units */
  64. u8 h_active; /**< lower 8 bits (pixels) */
  65. u8 h_blank; /**< lower 8 bits (pixels) */
  66. u8 h_high; /**< upper 4 bits each h_active, h_blank */
  67. u8 v_active; /**< lower 8 bits (lines) */
  68. u8 v_blank; /**< lower 8 bits (lines) */
  69. u8 v_high; /**< upper 4 bits each v_active, v_blank */
  70. } part1;
  71. struct {
  72. u8 h_sync_off; /**< lower 8 bits, from hblank start */
  73. u8 h_sync_width; /**< lower 8 bits (pixels) */
  74. /** lower 4 bits each vsync offset, vsync width */
  75. u8 v_sync_off_width;
  76. /**
  77. * 2 high bits of hsync offset, 2 high bits of hsync width,
  78. * bits 4-5 of vsync offset, and 2 high bits of vsync width.
  79. */
  80. u8 sync_off_width_high;
  81. u8 dtd_flags;
  82. u8 sdvo_flags;
  83. /** bits 6-7 of vsync offset at bits 6-7 */
  84. u8 v_sync_off_high;
  85. u8 reserved;
  86. } part2;
  87. } __attribute__((packed));
  88. struct intel_sdvo_pixel_clock_range {
  89. u16 min; /**< pixel clock, in 10kHz units */
  90. u16 max; /**< pixel clock, in 10kHz units */
  91. } __attribute__((packed));
  92. struct intel_sdvo_preferred_input_timing_args {
  93. u16 clock;
  94. u16 width;
  95. u16 height;
  96. } __attribute__((packed));
  97. /* I2C registers for SDVO */
  98. #define SDVO_I2C_ARG_0 0x07
  99. #define SDVO_I2C_ARG_1 0x06
  100. #define SDVO_I2C_ARG_2 0x05
  101. #define SDVO_I2C_ARG_3 0x04
  102. #define SDVO_I2C_ARG_4 0x03
  103. #define SDVO_I2C_ARG_5 0x02
  104. #define SDVO_I2C_ARG_6 0x01
  105. #define SDVO_I2C_ARG_7 0x00
  106. #define SDVO_I2C_OPCODE 0x08
  107. #define SDVO_I2C_CMD_STATUS 0x09
  108. #define SDVO_I2C_RETURN_0 0x0a
  109. #define SDVO_I2C_RETURN_1 0x0b
  110. #define SDVO_I2C_RETURN_2 0x0c
  111. #define SDVO_I2C_RETURN_3 0x0d
  112. #define SDVO_I2C_RETURN_4 0x0e
  113. #define SDVO_I2C_RETURN_5 0x0f
  114. #define SDVO_I2C_RETURN_6 0x10
  115. #define SDVO_I2C_RETURN_7 0x11
  116. #define SDVO_I2C_VENDOR_BEGIN 0x20
  117. /* Status results */
  118. #define SDVO_CMD_STATUS_POWER_ON 0x0
  119. #define SDVO_CMD_STATUS_SUCCESS 0x1
  120. #define SDVO_CMD_STATUS_NOTSUPP 0x2
  121. #define SDVO_CMD_STATUS_INVALID_ARG 0x3
  122. #define SDVO_CMD_STATUS_PENDING 0x4
  123. #define SDVO_CMD_STATUS_TARGET_NOT_SPECIFIED 0x5
  124. #define SDVO_CMD_STATUS_SCALING_NOT_SUPP 0x6
  125. /* SDVO commands, argument/result registers */
  126. #define SDVO_CMD_RESET 0x01
  127. /** Returns a struct intel_sdvo_caps */
  128. #define SDVO_CMD_GET_DEVICE_CAPS 0x02
  129. #define SDVO_CMD_GET_FIRMWARE_REV 0x86
  130. # define SDVO_DEVICE_FIRMWARE_MINOR SDVO_I2C_RETURN_0
  131. # define SDVO_DEVICE_FIRMWARE_MAJOR SDVO_I2C_RETURN_1
  132. # define SDVO_DEVICE_FIRMWARE_PATCH SDVO_I2C_RETURN_2
  133. /**
  134. * Reports which inputs are trained (managed to sync).
  135. *
  136. * Devices must have trained within 2 vsyncs of a mode change.
  137. */
  138. #define SDVO_CMD_GET_TRAINED_INPUTS 0x03
  139. struct intel_sdvo_get_trained_inputs_response {
  140. unsigned int input0_trained:1;
  141. unsigned int input1_trained:1;
  142. unsigned int pad:6;
  143. } __attribute__((packed));
  144. /** Returns a struct intel_sdvo_output_flags of active outputs. */
  145. #define SDVO_CMD_GET_ACTIVE_OUTPUTS 0x04
  146. /**
  147. * Sets the current set of active outputs.
  148. *
  149. * Takes a struct intel_sdvo_output_flags. Must be preceded by a SET_IN_OUT_MAP
  150. * on multi-output devices.
  151. */
  152. #define SDVO_CMD_SET_ACTIVE_OUTPUTS 0x05
  153. /**
  154. * Returns the current mapping of SDVO inputs to outputs on the device.
  155. *
  156. * Returns two struct intel_sdvo_output_flags structures.
  157. */
  158. #define SDVO_CMD_GET_IN_OUT_MAP 0x06
  159. struct intel_sdvo_in_out_map {
  160. u16 in0, in1;
  161. };
  162. /**
  163. * Sets the current mapping of SDVO inputs to outputs on the device.
  164. *
  165. * Takes two struct i380_sdvo_output_flags structures.
  166. */
  167. #define SDVO_CMD_SET_IN_OUT_MAP 0x07
  168. /**
  169. * Returns a struct intel_sdvo_output_flags of attached displays.
  170. */
  171. #define SDVO_CMD_GET_ATTACHED_DISPLAYS 0x0b
  172. /**
  173. * Returns a struct intel_sdvo_ouptut_flags of displays supporting hot plugging.
  174. */
  175. #define SDVO_CMD_GET_HOT_PLUG_SUPPORT 0x0c
  176. /**
  177. * Takes a struct intel_sdvo_output_flags.
  178. */
  179. #define SDVO_CMD_SET_ACTIVE_HOT_PLUG 0x0d
  180. /**
  181. * Returns a struct intel_sdvo_output_flags of displays with hot plug
  182. * interrupts enabled.
  183. */
  184. #define SDVO_CMD_GET_ACTIVE_HOT_PLUG 0x0e
  185. #define SDVO_CMD_GET_INTERRUPT_EVENT_SOURCE 0x0f
  186. struct intel_sdvo_get_interrupt_event_source_response {
  187. u16 interrupt_status;
  188. unsigned int ambient_light_interrupt:1;
  189. unsigned int hdmi_audio_encrypt_change:1;
  190. unsigned int pad:6;
  191. } __attribute__((packed));
  192. /**
  193. * Selects which input is affected by future input commands.
  194. *
  195. * Commands affected include SET_INPUT_TIMINGS_PART[12],
  196. * GET_INPUT_TIMINGS_PART[12], GET_PREFERRED_INPUT_TIMINGS_PART[12],
  197. * GET_INPUT_PIXEL_CLOCK_RANGE, and CREATE_PREFERRED_INPUT_TIMINGS.
  198. */
  199. #define SDVO_CMD_SET_TARGET_INPUT 0x10
  200. struct intel_sdvo_set_target_input_args {
  201. unsigned int target_1:1;
  202. unsigned int pad:7;
  203. } __attribute__((packed));
  204. /**
  205. * Takes a struct intel_sdvo_output_flags of which outputs are targetted by
  206. * future output commands.
  207. *
  208. * Affected commands inclue SET_OUTPUT_TIMINGS_PART[12],
  209. * GET_OUTPUT_TIMINGS_PART[12], and GET_OUTPUT_PIXEL_CLOCK_RANGE.
  210. */
  211. #define SDVO_CMD_SET_TARGET_OUTPUT 0x11
  212. #define SDVO_CMD_GET_INPUT_TIMINGS_PART1 0x12
  213. #define SDVO_CMD_GET_INPUT_TIMINGS_PART2 0x13
  214. #define SDVO_CMD_SET_INPUT_TIMINGS_PART1 0x14
  215. #define SDVO_CMD_SET_INPUT_TIMINGS_PART2 0x15
  216. #define SDVO_CMD_SET_OUTPUT_TIMINGS_PART1 0x16
  217. #define SDVO_CMD_SET_OUTPUT_TIMINGS_PART2 0x17
  218. #define SDVO_CMD_GET_OUTPUT_TIMINGS_PART1 0x18
  219. #define SDVO_CMD_GET_OUTPUT_TIMINGS_PART2 0x19
  220. /* Part 1 */
  221. # define SDVO_DTD_CLOCK_LOW SDVO_I2C_ARG_0
  222. # define SDVO_DTD_CLOCK_HIGH SDVO_I2C_ARG_1
  223. # define SDVO_DTD_H_ACTIVE SDVO_I2C_ARG_2
  224. # define SDVO_DTD_H_BLANK SDVO_I2C_ARG_3
  225. # define SDVO_DTD_H_HIGH SDVO_I2C_ARG_4
  226. # define SDVO_DTD_V_ACTIVE SDVO_I2C_ARG_5
  227. # define SDVO_DTD_V_BLANK SDVO_I2C_ARG_6
  228. # define SDVO_DTD_V_HIGH SDVO_I2C_ARG_7
  229. /* Part 2 */
  230. # define SDVO_DTD_HSYNC_OFF SDVO_I2C_ARG_0
  231. # define SDVO_DTD_HSYNC_WIDTH SDVO_I2C_ARG_1
  232. # define SDVO_DTD_VSYNC_OFF_WIDTH SDVO_I2C_ARG_2
  233. # define SDVO_DTD_SYNC_OFF_WIDTH_HIGH SDVO_I2C_ARG_3
  234. # define SDVO_DTD_DTD_FLAGS SDVO_I2C_ARG_4
  235. # define SDVO_DTD_DTD_FLAG_INTERLACED (1 << 7)
  236. # define SDVO_DTD_DTD_FLAG_STEREO_MASK (3 << 5)
  237. # define SDVO_DTD_DTD_FLAG_INPUT_MASK (3 << 3)
  238. # define SDVO_DTD_DTD_FLAG_SYNC_MASK (3 << 1)
  239. # define SDVO_DTD_SDVO_FLAS SDVO_I2C_ARG_5
  240. # define SDVO_DTD_SDVO_FLAG_STALL (1 << 7)
  241. # define SDVO_DTD_SDVO_FLAG_CENTERED (0 << 6)
  242. # define SDVO_DTD_SDVO_FLAG_UPPER_LEFT (1 << 6)
  243. # define SDVO_DTD_SDVO_FLAG_SCALING_MASK (3 << 4)
  244. # define SDVO_DTD_SDVO_FLAG_SCALING_NONE (0 << 4)
  245. # define SDVO_DTD_SDVO_FLAG_SCALING_SHARP (1 << 4)
  246. # define SDVO_DTD_SDVO_FLAG_SCALING_SMOOTH (2 << 4)
  247. # define SDVO_DTD_VSYNC_OFF_HIGH SDVO_I2C_ARG_6
  248. /**
  249. * Generates a DTD based on the given width, height, and flags.
  250. *
  251. * This will be supported by any device supporting scaling or interlaced
  252. * modes.
  253. */
  254. #define SDVO_CMD_CREATE_PREFERRED_INPUT_TIMING 0x1a
  255. # define SDVO_PREFERRED_INPUT_TIMING_CLOCK_LOW SDVO_I2C_ARG_0
  256. # define SDVO_PREFERRED_INPUT_TIMING_CLOCK_HIGH SDVO_I2C_ARG_1
  257. # define SDVO_PREFERRED_INPUT_TIMING_WIDTH_LOW SDVO_I2C_ARG_2
  258. # define SDVO_PREFERRED_INPUT_TIMING_WIDTH_HIGH SDVO_I2C_ARG_3
  259. # define SDVO_PREFERRED_INPUT_TIMING_HEIGHT_LOW SDVO_I2C_ARG_4
  260. # define SDVO_PREFERRED_INPUT_TIMING_HEIGHT_HIGH SDVO_I2C_ARG_5
  261. # define SDVO_PREFERRED_INPUT_TIMING_FLAGS SDVO_I2C_ARG_6
  262. # define SDVO_PREFERRED_INPUT_TIMING_FLAGS_INTERLACED (1 << 0)
  263. # define SDVO_PREFERRED_INPUT_TIMING_FLAGS_SCALED (1 << 1)
  264. #define SDVO_CMD_GET_PREFERRED_INPUT_TIMING_PART1 0x1b
  265. #define SDVO_CMD_GET_PREFERRED_INPUT_TIMING_PART2 0x1c
  266. /** Returns a struct intel_sdvo_pixel_clock_range */
  267. #define SDVO_CMD_GET_INPUT_PIXEL_CLOCK_RANGE 0x1d
  268. /** Returns a struct intel_sdvo_pixel_clock_range */
  269. #define SDVO_CMD_GET_OUTPUT_PIXEL_CLOCK_RANGE 0x1e
  270. /** Returns a byte bitfield containing SDVO_CLOCK_RATE_MULT_* flags */
  271. #define SDVO_CMD_GET_SUPPORTED_CLOCK_RATE_MULTS 0x1f
  272. /** Returns a byte containing a SDVO_CLOCK_RATE_MULT_* flag */
  273. #define SDVO_CMD_GET_CLOCK_RATE_MULT 0x20
  274. /** Takes a byte containing a SDVO_CLOCK_RATE_MULT_* flag */
  275. #define SDVO_CMD_SET_CLOCK_RATE_MULT 0x21
  276. # define SDVO_CLOCK_RATE_MULT_1X (1 << 0)
  277. # define SDVO_CLOCK_RATE_MULT_2X (1 << 1)
  278. # define SDVO_CLOCK_RATE_MULT_4X (1 << 3)
  279. #define SDVO_CMD_GET_SUPPORTED_TV_FORMATS 0x27
  280. /** 5 bytes of bit flags for TV formats shared by all TV format functions */
  281. struct intel_sdvo_tv_format {
  282. unsigned int ntsc_m:1;
  283. unsigned int ntsc_j:1;
  284. unsigned int ntsc_443:1;
  285. unsigned int pal_b:1;
  286. unsigned int pal_d:1;
  287. unsigned int pal_g:1;
  288. unsigned int pal_h:1;
  289. unsigned int pal_i:1;
  290. unsigned int pal_m:1;
  291. unsigned int pal_n:1;
  292. unsigned int pal_nc:1;
  293. unsigned int pal_60:1;
  294. unsigned int secam_b:1;
  295. unsigned int secam_d:1;
  296. unsigned int secam_g:1;
  297. unsigned int secam_k:1;
  298. unsigned int secam_k1:1;
  299. unsigned int secam_l:1;
  300. unsigned int secam_60:1;
  301. unsigned int hdtv_std_smpte_240m_1080i_59:1;
  302. unsigned int hdtv_std_smpte_240m_1080i_60:1;
  303. unsigned int hdtv_std_smpte_260m_1080i_59:1;
  304. unsigned int hdtv_std_smpte_260m_1080i_60:1;
  305. unsigned int hdtv_std_smpte_274m_1080i_50:1;
  306. unsigned int hdtv_std_smpte_274m_1080i_59:1;
  307. unsigned int hdtv_std_smpte_274m_1080i_60:1;
  308. unsigned int hdtv_std_smpte_274m_1080p_23:1;
  309. unsigned int hdtv_std_smpte_274m_1080p_24:1;
  310. unsigned int hdtv_std_smpte_274m_1080p_25:1;
  311. unsigned int hdtv_std_smpte_274m_1080p_29:1;
  312. unsigned int hdtv_std_smpte_274m_1080p_30:1;
  313. unsigned int hdtv_std_smpte_274m_1080p_50:1;
  314. unsigned int hdtv_std_smpte_274m_1080p_59:1;
  315. unsigned int hdtv_std_smpte_274m_1080p_60:1;
  316. unsigned int hdtv_std_smpte_295m_1080i_50:1;
  317. unsigned int hdtv_std_smpte_295m_1080p_50:1;
  318. unsigned int hdtv_std_smpte_296m_720p_59:1;
  319. unsigned int hdtv_std_smpte_296m_720p_60:1;
  320. unsigned int hdtv_std_smpte_296m_720p_50:1;
  321. unsigned int hdtv_std_smpte_293m_480p_59:1;
  322. unsigned int hdtv_std_smpte_170m_480i_59:1;
  323. unsigned int hdtv_std_iturbt601_576i_50:1;
  324. unsigned int hdtv_std_iturbt601_576p_50:1;
  325. unsigned int hdtv_std_eia_7702a_480i_60:1;
  326. unsigned int hdtv_std_eia_7702a_480p_60:1;
  327. unsigned int pad:3;
  328. } __attribute__((packed));
  329. #define SDVO_CMD_GET_TV_FORMAT 0x28
  330. #define SDVO_CMD_SET_TV_FORMAT 0x29
  331. /** Returns the resolutiosn that can be used with the given TV format */
  332. #define SDVO_CMD_GET_SDTV_RESOLUTION_SUPPORT 0x83
  333. struct intel_sdvo_sdtv_resolution_request {
  334. unsigned int ntsc_m:1;
  335. unsigned int ntsc_j:1;
  336. unsigned int ntsc_443:1;
  337. unsigned int pal_b:1;
  338. unsigned int pal_d:1;
  339. unsigned int pal_g:1;
  340. unsigned int pal_h:1;
  341. unsigned int pal_i:1;
  342. unsigned int pal_m:1;
  343. unsigned int pal_n:1;
  344. unsigned int pal_nc:1;
  345. unsigned int pal_60:1;
  346. unsigned int secam_b:1;
  347. unsigned int secam_d:1;
  348. unsigned int secam_g:1;
  349. unsigned int secam_k:1;
  350. unsigned int secam_k1:1;
  351. unsigned int secam_l:1;
  352. unsigned int secam_60:1;
  353. unsigned int pad:5;
  354. } __attribute__((packed));
  355. struct intel_sdvo_sdtv_resolution_reply {
  356. unsigned int res_320x200:1;
  357. unsigned int res_320x240:1;
  358. unsigned int res_400x300:1;
  359. unsigned int res_640x350:1;
  360. unsigned int res_640x400:1;
  361. unsigned int res_640x480:1;
  362. unsigned int res_704x480:1;
  363. unsigned int res_704x576:1;
  364. unsigned int res_720x350:1;
  365. unsigned int res_720x400:1;
  366. unsigned int res_720x480:1;
  367. unsigned int res_720x540:1;
  368. unsigned int res_720x576:1;
  369. unsigned int res_768x576:1;
  370. unsigned int res_800x600:1;
  371. unsigned int res_832x624:1;
  372. unsigned int res_920x766:1;
  373. unsigned int res_1024x768:1;
  374. unsigned int res_1280x1024:1;
  375. unsigned int pad:5;
  376. } __attribute__((packed));
  377. /* Get supported resolution with squire pixel aspect ratio that can be
  378. scaled for the requested HDTV format */
  379. #define SDVO_CMD_GET_SCALED_HDTV_RESOLUTION_SUPPORT 0x85
  380. struct intel_sdvo_hdtv_resolution_request {
  381. unsigned int hdtv_std_smpte_240m_1080i_59:1;
  382. unsigned int hdtv_std_smpte_240m_1080i_60:1;
  383. unsigned int hdtv_std_smpte_260m_1080i_59:1;
  384. unsigned int hdtv_std_smpte_260m_1080i_60:1;
  385. unsigned int hdtv_std_smpte_274m_1080i_50:1;
  386. unsigned int hdtv_std_smpte_274m_1080i_59:1;
  387. unsigned int hdtv_std_smpte_274m_1080i_60:1;
  388. unsigned int hdtv_std_smpte_274m_1080p_23:1;
  389. unsigned int hdtv_std_smpte_274m_1080p_24:1;
  390. unsigned int hdtv_std_smpte_274m_1080p_25:1;
  391. unsigned int hdtv_std_smpte_274m_1080p_29:1;
  392. unsigned int hdtv_std_smpte_274m_1080p_30:1;
  393. unsigned int hdtv_std_smpte_274m_1080p_50:1;
  394. unsigned int hdtv_std_smpte_274m_1080p_59:1;
  395. unsigned int hdtv_std_smpte_274m_1080p_60:1;
  396. unsigned int hdtv_std_smpte_295m_1080i_50:1;
  397. unsigned int hdtv_std_smpte_295m_1080p_50:1;
  398. unsigned int hdtv_std_smpte_296m_720p_59:1;
  399. unsigned int hdtv_std_smpte_296m_720p_60:1;
  400. unsigned int hdtv_std_smpte_296m_720p_50:1;
  401. unsigned int hdtv_std_smpte_293m_480p_59:1;
  402. unsigned int hdtv_std_smpte_170m_480i_59:1;
  403. unsigned int hdtv_std_iturbt601_576i_50:1;
  404. unsigned int hdtv_std_iturbt601_576p_50:1;
  405. unsigned int hdtv_std_eia_7702a_480i_60:1;
  406. unsigned int hdtv_std_eia_7702a_480p_60:1;
  407. unsigned int pad:6;
  408. } __attribute__((packed));
  409. struct intel_sdvo_hdtv_resolution_reply {
  410. unsigned int res_640x480:1;
  411. unsigned int res_800x600:1;
  412. unsigned int res_1024x768:1;
  413. unsigned int res_1280x960:1;
  414. unsigned int res_1400x1050:1;
  415. unsigned int res_1600x1200:1;
  416. unsigned int res_1920x1440:1;
  417. unsigned int res_2048x1536:1;
  418. unsigned int res_2560x1920:1;
  419. unsigned int res_3200x2400:1;
  420. unsigned int res_3840x2880:1;
  421. unsigned int pad1:5;
  422. unsigned int res_848x480:1;
  423. unsigned int res_1064x600:1;
  424. unsigned int res_1280x720:1;
  425. unsigned int res_1360x768:1;
  426. unsigned int res_1704x960:1;
  427. unsigned int res_1864x1050:1;
  428. unsigned int res_1920x1080:1;
  429. unsigned int res_2128x1200:1;
  430. unsigned int res_2560x1400:1;
  431. unsigned int res_2728x1536:1;
  432. unsigned int res_3408x1920:1;
  433. unsigned int res_4264x2400:1;
  434. unsigned int res_5120x2880:1;
  435. unsigned int pad2:3;
  436. unsigned int res_768x480:1;
  437. unsigned int res_960x600:1;
  438. unsigned int res_1152x720:1;
  439. unsigned int res_1124x768:1;
  440. unsigned int res_1536x960:1;
  441. unsigned int res_1680x1050:1;
  442. unsigned int res_1728x1080:1;
  443. unsigned int res_1920x1200:1;
  444. unsigned int res_2304x1440:1;
  445. unsigned int res_2456x1536:1;
  446. unsigned int res_3072x1920:1;
  447. unsigned int res_3840x2400:1;
  448. unsigned int res_4608x2880:1;
  449. unsigned int pad3:3;
  450. unsigned int res_1280x1024:1;
  451. unsigned int pad4:7;
  452. unsigned int res_1280x768:1;
  453. unsigned int pad5:7;
  454. } __attribute__((packed));
  455. /* Get supported power state returns info for encoder and monitor, rely on
  456. last SetTargetInput and SetTargetOutput calls */
  457. #define SDVO_CMD_GET_SUPPORTED_POWER_STATES 0x2a
  458. /* Get power state returns info for encoder and monitor, rely on last
  459. SetTargetInput and SetTargetOutput calls */
  460. #define SDVO_CMD_GET_POWER_STATE 0x2b
  461. #define SDVO_CMD_GET_ENCODER_POWER_STATE 0x2b
  462. #define SDVO_CMD_SET_ENCODER_POWER_STATE 0x2c
  463. # define SDVO_ENCODER_STATE_ON (1 << 0)
  464. # define SDVO_ENCODER_STATE_STANDBY (1 << 1)
  465. # define SDVO_ENCODER_STATE_SUSPEND (1 << 2)
  466. # define SDVO_ENCODER_STATE_OFF (1 << 3)
  467. # define SDVO_MONITOR_STATE_ON (1 << 4)
  468. # define SDVO_MONITOR_STATE_STANDBY (1 << 5)
  469. # define SDVO_MONITOR_STATE_SUSPEND (1 << 6)
  470. # define SDVO_MONITOR_STATE_OFF (1 << 7)
  471. #define SDVO_CMD_GET_MAX_PANEL_POWER_SEQUENCING 0x2d
  472. #define SDVO_CMD_GET_PANEL_POWER_SEQUENCING 0x2e
  473. #define SDVO_CMD_SET_PANEL_POWER_SEQUENCING 0x2f
  474. /**
  475. * The panel power sequencing parameters are in units of milliseconds.
  476. * The high fields are bits 8:9 of the 10-bit values.
  477. */
  478. struct sdvo_panel_power_sequencing {
  479. u8 t0;
  480. u8 t1;
  481. u8 t2;
  482. u8 t3;
  483. u8 t4;
  484. unsigned int t0_high:2;
  485. unsigned int t1_high:2;
  486. unsigned int t2_high:2;
  487. unsigned int t3_high:2;
  488. unsigned int t4_high:2;
  489. unsigned int pad:6;
  490. } __attribute__((packed));
  491. #define SDVO_CMD_GET_MAX_BACKLIGHT_LEVEL 0x30
  492. struct sdvo_max_backlight_reply {
  493. u8 max_value;
  494. u8 default_value;
  495. } __attribute__((packed));
  496. #define SDVO_CMD_GET_BACKLIGHT_LEVEL 0x31
  497. #define SDVO_CMD_SET_BACKLIGHT_LEVEL 0x32
  498. #define SDVO_CMD_GET_AMBIENT_LIGHT 0x33
  499. struct sdvo_get_ambient_light_reply {
  500. u16 trip_low;
  501. u16 trip_high;
  502. u16 value;
  503. } __attribute__((packed));
  504. #define SDVO_CMD_SET_AMBIENT_LIGHT 0x34
  505. struct sdvo_set_ambient_light_reply {
  506. u16 trip_low;
  507. u16 trip_high;
  508. unsigned int enable:1;
  509. unsigned int pad:7;
  510. } __attribute__((packed));
  511. /* Set display power state */
  512. #define SDVO_CMD_SET_DISPLAY_POWER_STATE 0x7d
  513. # define SDVO_DISPLAY_STATE_ON (1 << 0)
  514. # define SDVO_DISPLAY_STATE_STANDBY (1 << 1)
  515. # define SDVO_DISPLAY_STATE_SUSPEND (1 << 2)
  516. # define SDVO_DISPLAY_STATE_OFF (1 << 3)
  517. #define SDVO_CMD_GET_SUPPORTED_ENHANCEMENTS 0x84
  518. struct intel_sdvo_enhancements_reply {
  519. unsigned int flicker_filter:1;
  520. unsigned int flicker_filter_adaptive:1;
  521. unsigned int flicker_filter_2d:1;
  522. unsigned int saturation:1;
  523. unsigned int hue:1;
  524. unsigned int brightness:1;
  525. unsigned int contrast:1;
  526. unsigned int overscan_h:1;
  527. unsigned int overscan_v:1;
  528. unsigned int position_h:1;
  529. unsigned int position_v:1;
  530. unsigned int sharpness:1;
  531. unsigned int dot_crawl:1;
  532. unsigned int dither:1;
  533. unsigned int max_tv_chroma_filter:1;
  534. unsigned int max_tv_luma_filter:1;
  535. } __attribute__((packed));
  536. /* Picture enhancement limits below are dependent on the current TV format,
  537. * and thus need to be queried and set after it.
  538. */
  539. #define SDVO_CMD_GET_MAX_FLICKER_FITER 0x4d
  540. #define SDVO_CMD_GET_MAX_ADAPTIVE_FLICKER_FITER 0x7b
  541. #define SDVO_CMD_GET_MAX_2D_FLICKER_FITER 0x52
  542. #define SDVO_CMD_GET_MAX_SATURATION 0x55
  543. #define SDVO_CMD_GET_MAX_HUE 0x58
  544. #define SDVO_CMD_GET_MAX_BRIGHTNESS 0x5b
  545. #define SDVO_CMD_GET_MAX_CONTRAST 0x5e
  546. #define SDVO_CMD_GET_MAX_OVERSCAN_H 0x61
  547. #define SDVO_CMD_GET_MAX_OVERSCAN_V 0x64
  548. #define SDVO_CMD_GET_MAX_POSITION_H 0x67
  549. #define SDVO_CMD_GET_MAX_POSITION_V 0x6a
  550. #define SDVO_CMD_GET_MAX_SHARPNESS_V 0x6d
  551. #define SDVO_CMD_GET_MAX_TV_CHROMA 0x74
  552. #define SDVO_CMD_GET_MAX_TV_LUMA 0x77
  553. struct intel_sdvo_enhancement_limits_reply {
  554. u16 max_value;
  555. u16 default_value;
  556. } __attribute__((packed));
  557. #define SDVO_CMD_GET_LVDS_PANEL_INFORMATION 0x7f
  558. #define SDVO_CMD_SET_LVDS_PANEL_INFORMATION 0x80
  559. # define SDVO_LVDS_COLOR_DEPTH_18 (0 << 0)
  560. # define SDVO_LVDS_COLOR_DEPTH_24 (1 << 0)
  561. # define SDVO_LVDS_CONNECTOR_SPWG (0 << 2)
  562. # define SDVO_LVDS_CONNECTOR_OPENLDI (1 << 2)
  563. # define SDVO_LVDS_SINGLE_CHANNEL (0 << 4)
  564. # define SDVO_LVDS_DUAL_CHANNEL (1 << 4)
  565. #define SDVO_CMD_GET_FLICKER_FILTER 0x4e
  566. #define SDVO_CMD_SET_FLICKER_FILTER 0x4f
  567. #define SDVO_CMD_GET_ADAPTIVE_FLICKER_FITER 0x50
  568. #define SDVO_CMD_SET_ADAPTIVE_FLICKER_FITER 0x51
  569. #define SDVO_CMD_GET_2D_FLICKER_FITER 0x53
  570. #define SDVO_CMD_SET_2D_FLICKER_FITER 0x54
  571. #define SDVO_CMD_GET_SATURATION 0x56
  572. #define SDVO_CMD_SET_SATURATION 0x57
  573. #define SDVO_CMD_GET_HUE 0x59
  574. #define SDVO_CMD_SET_HUE 0x5a
  575. #define SDVO_CMD_GET_BRIGHTNESS 0x5c
  576. #define SDVO_CMD_SET_BRIGHTNESS 0x5d
  577. #define SDVO_CMD_GET_CONTRAST 0x5f
  578. #define SDVO_CMD_SET_CONTRAST 0x60
  579. #define SDVO_CMD_GET_OVERSCAN_H 0x62
  580. #define SDVO_CMD_SET_OVERSCAN_H 0x63
  581. #define SDVO_CMD_GET_OVERSCAN_V 0x65
  582. #define SDVO_CMD_SET_OVERSCAN_V 0x66
  583. #define SDVO_CMD_GET_POSITION_H 0x68
  584. #define SDVO_CMD_SET_POSITION_H 0x69
  585. #define SDVO_CMD_GET_POSITION_V 0x6b
  586. #define SDVO_CMD_SET_POSITION_V 0x6c
  587. #define SDVO_CMD_GET_SHARPNESS 0x6e
  588. #define SDVO_CMD_SET_SHARPNESS 0x6f
  589. #define SDVO_CMD_GET_TV_CHROMA 0x75
  590. #define SDVO_CMD_SET_TV_CHROMA 0x76
  591. #define SDVO_CMD_GET_TV_LUMA 0x78
  592. #define SDVO_CMD_SET_TV_LUMA 0x79
  593. struct intel_sdvo_enhancements_arg {
  594. u16 value;
  595. }__attribute__((packed));
  596. #define SDVO_CMD_GET_DOT_CRAWL 0x70
  597. #define SDVO_CMD_SET_DOT_CRAWL 0x71
  598. # define SDVO_DOT_CRAWL_ON (1 << 0)
  599. # define SDVO_DOT_CRAWL_DEFAULT_ON (1 << 1)
  600. #define SDVO_CMD_GET_DITHER 0x72
  601. #define SDVO_CMD_SET_DITHER 0x73
  602. # define SDVO_DITHER_ON (1 << 0)
  603. # define SDVO_DITHER_DEFAULT_ON (1 << 1)
  604. #define SDVO_CMD_SET_CONTROL_BUS_SWITCH 0x7a
  605. # define SDVO_CONTROL_BUS_PROM (1 << 0)
  606. # define SDVO_CONTROL_BUS_DDC1 (1 << 1)
  607. # define SDVO_CONTROL_BUS_DDC2 (1 << 2)
  608. # define SDVO_CONTROL_BUS_DDC3 (1 << 3)
  609. /* HDMI op codes */
  610. #define SDVO_CMD_GET_SUPP_ENCODE 0x9d
  611. #define SDVO_CMD_GET_ENCODE 0x9e
  612. #define SDVO_CMD_SET_ENCODE 0x9f
  613. #define SDVO_ENCODE_DVI 0x0
  614. #define SDVO_ENCODE_HDMI 0x1
  615. #define SDVO_CMD_SET_PIXEL_REPLI 0x8b
  616. #define SDVO_CMD_GET_PIXEL_REPLI 0x8c
  617. #define SDVO_CMD_GET_COLORIMETRY_CAP 0x8d
  618. #define SDVO_CMD_SET_COLORIMETRY 0x8e
  619. #define SDVO_COLORIMETRY_RGB256 0x0
  620. #define SDVO_COLORIMETRY_RGB220 0x1
  621. #define SDVO_COLORIMETRY_YCrCb422 0x3
  622. #define SDVO_COLORIMETRY_YCrCb444 0x4
  623. #define SDVO_CMD_GET_COLORIMETRY 0x8f
  624. #define SDVO_CMD_GET_AUDIO_ENCRYPT_PREFER 0x90
  625. #define SDVO_CMD_SET_AUDIO_STAT 0x91
  626. #define SDVO_CMD_GET_AUDIO_STAT 0x92
  627. #define SDVO_CMD_SET_HBUF_INDEX 0x93
  628. #define SDVO_CMD_GET_HBUF_INDEX 0x94
  629. #define SDVO_CMD_GET_HBUF_INFO 0x95
  630. #define SDVO_CMD_SET_HBUF_AV_SPLIT 0x96
  631. #define SDVO_CMD_GET_HBUF_AV_SPLIT 0x97
  632. #define SDVO_CMD_SET_HBUF_DATA 0x98
  633. #define SDVO_CMD_GET_HBUF_DATA 0x99
  634. #define SDVO_CMD_SET_HBUF_TXRATE 0x9a
  635. #define SDVO_CMD_GET_HBUF_TXRATE 0x9b
  636. #define SDVO_HBUF_TX_DISABLED (0 << 6)
  637. #define SDVO_HBUF_TX_ONCE (2 << 6)
  638. #define SDVO_HBUF_TX_VSYNC (3 << 6)
  639. #define SDVO_CMD_GET_AUDIO_TX_INFO 0x9c
  640. struct intel_sdvo_encode{
  641. u8 dvi_rev;
  642. u8 hdmi_rev;
  643. } __attribute__ ((packed));