amd_acpi.h 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509
  1. /*
  2. * Copyright 2012 Advanced Micro Devices, Inc.
  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 shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  17. * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
  18. * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  19. * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  20. * OTHER DEALINGS IN THE SOFTWARE.
  21. *
  22. */
  23. #ifndef AMD_ACPI_H
  24. #define AMD_ACPI_H
  25. #define ACPI_AC_CLASS "ac_adapter"
  26. struct atif_verify_interface {
  27. u16 size; /* structure size in bytes (includes size field) */
  28. u16 version; /* version */
  29. u32 notification_mask; /* supported notifications mask */
  30. u32 function_bits; /* supported functions bit vector */
  31. } __packed;
  32. struct atif_system_params {
  33. u16 size; /* structure size in bytes (includes size field) */
  34. u32 valid_mask; /* valid flags mask */
  35. u32 flags; /* flags */
  36. u8 command_code; /* notify command code */
  37. } __packed;
  38. struct atif_sbios_requests {
  39. u16 size; /* structure size in bytes (includes size field) */
  40. u32 pending; /* pending sbios requests */
  41. u8 panel_exp_mode; /* panel expansion mode */
  42. u8 thermal_gfx; /* thermal state: target gfx controller */
  43. u8 thermal_state; /* thermal state: state id (0: exit state, non-0: state) */
  44. u8 forced_power_gfx; /* forced power state: target gfx controller */
  45. u8 forced_power_state; /* forced power state: state id */
  46. u8 system_power_src; /* system power source */
  47. u8 backlight_level; /* panel backlight level (0-255) */
  48. } __packed;
  49. #define ATIF_NOTIFY_MASK 0x3
  50. #define ATIF_NOTIFY_NONE 0
  51. #define ATIF_NOTIFY_81 1
  52. #define ATIF_NOTIFY_N 2
  53. struct atcs_verify_interface {
  54. u16 size; /* structure size in bytes (includes size field) */
  55. u16 version; /* version */
  56. u32 function_bits; /* supported functions bit vector */
  57. } __packed;
  58. #define ATCS_VALID_FLAGS_MASK 0x3
  59. struct atcs_pref_req_input {
  60. u16 size; /* structure size in bytes (includes size field) */
  61. u16 client_id; /* client id (bit 2-0: func num, 7-3: dev num, 15-8: bus num) */
  62. u16 valid_flags_mask; /* valid flags mask */
  63. u16 flags; /* flags */
  64. u8 req_type; /* request type */
  65. u8 perf_req; /* performance request */
  66. } __packed;
  67. struct atcs_pref_req_output {
  68. u16 size; /* structure size in bytes (includes size field) */
  69. u8 ret_val; /* return value */
  70. } __packed;
  71. /* AMD hw uses four ACPI control methods:
  72. * 1. ATIF
  73. * ARG0: (ACPI_INTEGER) function code
  74. * ARG1: (ACPI_BUFFER) parameter buffer, 256 bytes
  75. * OUTPUT: (ACPI_BUFFER) output buffer, 256 bytes
  76. * ATIF provides an entry point for the gfx driver to interact with the sbios.
  77. * The AMD ACPI notification mechanism uses Notify (VGA, 0x81) or a custom
  78. * notification. Which notification is used as indicated by the ATIF Control
  79. * Method GET_SYSTEM_PARAMETERS. When the driver receives Notify (VGA, 0x81) or
  80. * a custom notification it invokes ATIF Control Method GET_SYSTEM_BIOS_REQUESTS
  81. * to identify pending System BIOS requests and associated parameters. For
  82. * example, if one of the pending requests is DISPLAY_SWITCH_REQUEST, the driver
  83. * will perform display device detection and invoke ATIF Control Method
  84. * SELECT_ACTIVE_DISPLAYS.
  85. *
  86. * 2. ATPX
  87. * ARG0: (ACPI_INTEGER) function code
  88. * ARG1: (ACPI_BUFFER) parameter buffer, 256 bytes
  89. * OUTPUT: (ACPI_BUFFER) output buffer, 256 bytes
  90. * ATPX methods are used on PowerXpress systems to handle mux switching and
  91. * discrete GPU power control.
  92. *
  93. * 3. ATRM
  94. * ARG0: (ACPI_INTEGER) offset of vbios rom data
  95. * ARG1: (ACPI_BUFFER) size of the buffer to fill (up to 4K).
  96. * OUTPUT: (ACPI_BUFFER) output buffer
  97. * ATRM provides an interfacess to access the discrete GPU vbios image on
  98. * PowerXpress systems with multiple GPUs.
  99. *
  100. * 4. ATCS
  101. * ARG0: (ACPI_INTEGER) function code
  102. * ARG1: (ACPI_BUFFER) parameter buffer, 256 bytes
  103. * OUTPUT: (ACPI_BUFFER) output buffer, 256 bytes
  104. * ATCS provides an interface to AMD chipset specific functionality.
  105. *
  106. */
  107. /* ATIF */
  108. #define ATIF_FUNCTION_VERIFY_INTERFACE 0x0
  109. /* ARG0: ATIF_FUNCTION_VERIFY_INTERFACE
  110. * ARG1: none
  111. * OUTPUT:
  112. * WORD - structure size in bytes (includes size field)
  113. * WORD - version
  114. * DWORD - supported notifications mask
  115. * DWORD - supported functions bit vector
  116. */
  117. /* Notifications mask */
  118. # define ATIF_DISPLAY_SWITCH_REQUEST_SUPPORTED (1 << 0)
  119. # define ATIF_EXPANSION_MODE_CHANGE_REQUEST_SUPPORTED (1 << 1)
  120. # define ATIF_THERMAL_STATE_CHANGE_REQUEST_SUPPORTED (1 << 2)
  121. # define ATIF_FORCED_POWER_STATE_CHANGE_REQUEST_SUPPORTED (1 << 3)
  122. # define ATIF_SYSTEM_POWER_SOURCE_CHANGE_REQUEST_SUPPORTED (1 << 4)
  123. # define ATIF_DISPLAY_CONF_CHANGE_REQUEST_SUPPORTED (1 << 5)
  124. # define ATIF_PX_GFX_SWITCH_REQUEST_SUPPORTED (1 << 6)
  125. # define ATIF_PANEL_BRIGHTNESS_CHANGE_REQUEST_SUPPORTED (1 << 7)
  126. # define ATIF_DGPU_DISPLAY_EVENT_SUPPORTED (1 << 8)
  127. /* supported functions vector */
  128. # define ATIF_GET_SYSTEM_PARAMETERS_SUPPORTED (1 << 0)
  129. # define ATIF_GET_SYSTEM_BIOS_REQUESTS_SUPPORTED (1 << 1)
  130. # define ATIF_SELECT_ACTIVE_DISPLAYS_SUPPORTED (1 << 2)
  131. # define ATIF_GET_LID_STATE_SUPPORTED (1 << 3)
  132. # define ATIF_GET_TV_STANDARD_FROM_CMOS_SUPPORTED (1 << 4)
  133. # define ATIF_SET_TV_STANDARD_IN_CMOS_SUPPORTED (1 << 5)
  134. # define ATIF_GET_PANEL_EXPANSION_MODE_FROM_CMOS_SUPPORTED (1 << 6)
  135. # define ATIF_SET_PANEL_EXPANSION_MODE_IN_CMOS_SUPPORTED (1 << 7)
  136. # define ATIF_TEMPERATURE_CHANGE_NOTIFICATION_SUPPORTED (1 << 12)
  137. # define ATIF_GET_GRAPHICS_DEVICE_TYPES_SUPPORTED (1 << 14)
  138. # define ATIF_GET_EXTERNAL_GPU_INFORMATION_SUPPORTED (1 << 20)
  139. #define ATIF_FUNCTION_GET_SYSTEM_PARAMETERS 0x1
  140. /* ARG0: ATIF_FUNCTION_GET_SYSTEM_PARAMETERS
  141. * ARG1: none
  142. * OUTPUT:
  143. * WORD - structure size in bytes (includes size field)
  144. * DWORD - valid flags mask
  145. * DWORD - flags
  146. *
  147. * OR
  148. *
  149. * WORD - structure size in bytes (includes size field)
  150. * DWORD - valid flags mask
  151. * DWORD - flags
  152. * BYTE - notify command code
  153. *
  154. * flags
  155. * bits 1:0:
  156. * 0 - Notify(VGA, 0x81) is not used for notification
  157. * 1 - Notify(VGA, 0x81) is used for notification
  158. * 2 - Notify(VGA, n) is used for notification where
  159. * n (0xd0-0xd9) is specified in notify command code.
  160. * bit 2:
  161. * 1 - lid changes not reported though int10
  162. */
  163. #define ATIF_FUNCTION_GET_SYSTEM_BIOS_REQUESTS 0x2
  164. /* ARG0: ATIF_FUNCTION_GET_SYSTEM_BIOS_REQUESTS
  165. * ARG1: none
  166. * OUTPUT:
  167. * WORD - structure size in bytes (includes size field)
  168. * DWORD - pending sbios requests
  169. * BYTE - panel expansion mode
  170. * BYTE - thermal state: target gfx controller
  171. * BYTE - thermal state: state id (0: exit state, non-0: state)
  172. * BYTE - forced power state: target gfx controller
  173. * BYTE - forced power state: state id
  174. * BYTE - system power source
  175. * BYTE - panel backlight level (0-255)
  176. */
  177. /* pending sbios requests */
  178. # define ATIF_DISPLAY_SWITCH_REQUEST (1 << 0)
  179. # define ATIF_EXPANSION_MODE_CHANGE_REQUEST (1 << 1)
  180. # define ATIF_THERMAL_STATE_CHANGE_REQUEST (1 << 2)
  181. # define ATIF_FORCED_POWER_STATE_CHANGE_REQUEST (1 << 3)
  182. # define ATIF_SYSTEM_POWER_SOURCE_CHANGE_REQUEST (1 << 4)
  183. # define ATIF_DISPLAY_CONF_CHANGE_REQUEST (1 << 5)
  184. # define ATIF_PX_GFX_SWITCH_REQUEST (1 << 6)
  185. # define ATIF_PANEL_BRIGHTNESS_CHANGE_REQUEST (1 << 7)
  186. # define ATIF_DGPU_DISPLAY_EVENT (1 << 8)
  187. /* panel expansion mode */
  188. # define ATIF_PANEL_EXPANSION_DISABLE 0
  189. # define ATIF_PANEL_EXPANSION_FULL 1
  190. # define ATIF_PANEL_EXPANSION_ASPECT 2
  191. /* target gfx controller */
  192. # define ATIF_TARGET_GFX_SINGLE 0
  193. # define ATIF_TARGET_GFX_PX_IGPU 1
  194. # define ATIF_TARGET_GFX_PX_DGPU 2
  195. /* system power source */
  196. # define ATIF_POWER_SOURCE_AC 1
  197. # define ATIF_POWER_SOURCE_DC 2
  198. # define ATIF_POWER_SOURCE_RESTRICTED_AC_1 3
  199. # define ATIF_POWER_SOURCE_RESTRICTED_AC_2 4
  200. #define ATIF_FUNCTION_SELECT_ACTIVE_DISPLAYS 0x3
  201. /* ARG0: ATIF_FUNCTION_SELECT_ACTIVE_DISPLAYS
  202. * ARG1:
  203. * WORD - structure size in bytes (includes size field)
  204. * WORD - selected displays
  205. * WORD - connected displays
  206. * OUTPUT:
  207. * WORD - structure size in bytes (includes size field)
  208. * WORD - selected displays
  209. */
  210. # define ATIF_LCD1 (1 << 0)
  211. # define ATIF_CRT1 (1 << 1)
  212. # define ATIF_TV (1 << 2)
  213. # define ATIF_DFP1 (1 << 3)
  214. # define ATIF_CRT2 (1 << 4)
  215. # define ATIF_LCD2 (1 << 5)
  216. # define ATIF_DFP2 (1 << 7)
  217. # define ATIF_CV (1 << 8)
  218. # define ATIF_DFP3 (1 << 9)
  219. # define ATIF_DFP4 (1 << 10)
  220. # define ATIF_DFP5 (1 << 11)
  221. # define ATIF_DFP6 (1 << 12)
  222. #define ATIF_FUNCTION_GET_LID_STATE 0x4
  223. /* ARG0: ATIF_FUNCTION_GET_LID_STATE
  224. * ARG1: none
  225. * OUTPUT:
  226. * WORD - structure size in bytes (includes size field)
  227. * BYTE - lid state (0: open, 1: closed)
  228. *
  229. * GET_LID_STATE only works at boot and resume, for general lid
  230. * status, use the kernel provided status
  231. */
  232. #define ATIF_FUNCTION_GET_TV_STANDARD_FROM_CMOS 0x5
  233. /* ARG0: ATIF_FUNCTION_GET_TV_STANDARD_FROM_CMOS
  234. * ARG1: none
  235. * OUTPUT:
  236. * WORD - structure size in bytes (includes size field)
  237. * BYTE - 0
  238. * BYTE - TV standard
  239. */
  240. # define ATIF_TV_STD_NTSC 0
  241. # define ATIF_TV_STD_PAL 1
  242. # define ATIF_TV_STD_PALM 2
  243. # define ATIF_TV_STD_PAL60 3
  244. # define ATIF_TV_STD_NTSCJ 4
  245. # define ATIF_TV_STD_PALCN 5
  246. # define ATIF_TV_STD_PALN 6
  247. # define ATIF_TV_STD_SCART_RGB 9
  248. #define ATIF_FUNCTION_SET_TV_STANDARD_IN_CMOS 0x6
  249. /* ARG0: ATIF_FUNCTION_SET_TV_STANDARD_IN_CMOS
  250. * ARG1:
  251. * WORD - structure size in bytes (includes size field)
  252. * BYTE - 0
  253. * BYTE - TV standard
  254. * OUTPUT: none
  255. */
  256. #define ATIF_FUNCTION_GET_PANEL_EXPANSION_MODE_FROM_CMOS 0x7
  257. /* ARG0: ATIF_FUNCTION_GET_PANEL_EXPANSION_MODE_FROM_CMOS
  258. * ARG1: none
  259. * OUTPUT:
  260. * WORD - structure size in bytes (includes size field)
  261. * BYTE - panel expansion mode
  262. */
  263. #define ATIF_FUNCTION_SET_PANEL_EXPANSION_MODE_IN_CMOS 0x8
  264. /* ARG0: ATIF_FUNCTION_SET_PANEL_EXPANSION_MODE_IN_CMOS
  265. * ARG1:
  266. * WORD - structure size in bytes (includes size field)
  267. * BYTE - panel expansion mode
  268. * OUTPUT: none
  269. */
  270. #define ATIF_FUNCTION_TEMPERATURE_CHANGE_NOTIFICATION 0xD
  271. /* ARG0: ATIF_FUNCTION_TEMPERATURE_CHANGE_NOTIFICATION
  272. * ARG1:
  273. * WORD - structure size in bytes (includes size field)
  274. * WORD - gfx controller id
  275. * BYTE - current temperature (degress Celsius)
  276. * OUTPUT: none
  277. */
  278. #define ATIF_FUNCTION_GET_GRAPHICS_DEVICE_TYPES 0xF
  279. /* ARG0: ATIF_FUNCTION_GET_GRAPHICS_DEVICE_TYPES
  280. * ARG1: none
  281. * OUTPUT:
  282. * WORD - number of gfx devices
  283. * WORD - device structure size in bytes (excludes device size field)
  284. * DWORD - flags \
  285. * WORD - bus number } repeated structure
  286. * WORD - device number /
  287. */
  288. /* flags */
  289. # define ATIF_PX_REMOVABLE_GRAPHICS_DEVICE (1 << 0)
  290. # define ATIF_XGP_PORT (1 << 1)
  291. # define ATIF_VGA_ENABLED_GRAPHICS_DEVICE (1 << 2)
  292. # define ATIF_XGP_PORT_IN_DOCK (1 << 3)
  293. #define ATIF_FUNCTION_GET_EXTERNAL_GPU_INFORMATION 0x15
  294. /* ARG0: ATIF_FUNCTION_GET_EXTERNAL_GPU_INFORMATION
  295. * ARG1: none
  296. * OUTPUT:
  297. * WORD - number of reported external gfx devices
  298. * WORD - device structure size in bytes (excludes device size field)
  299. * WORD - flags \
  300. * WORD - bus number / repeated structure
  301. */
  302. /* flags */
  303. # define ATIF_EXTERNAL_GRAPHICS_PORT (1 << 0)
  304. /* ATPX */
  305. #define ATPX_FUNCTION_VERIFY_INTERFACE 0x0
  306. /* ARG0: ATPX_FUNCTION_VERIFY_INTERFACE
  307. * ARG1: none
  308. * OUTPUT:
  309. * WORD - structure size in bytes (includes size field)
  310. * WORD - version
  311. * DWORD - supported functions bit vector
  312. */
  313. /* supported functions vector */
  314. # define ATPX_GET_PX_PARAMETERS_SUPPORTED (1 << 0)
  315. # define ATPX_POWER_CONTROL_SUPPORTED (1 << 1)
  316. # define ATPX_DISPLAY_MUX_CONTROL_SUPPORTED (1 << 2)
  317. # define ATPX_I2C_MUX_CONTROL_SUPPORTED (1 << 3)
  318. # define ATPX_GRAPHICS_DEVICE_SWITCH_START_NOTIFICATION_SUPPORTED (1 << 4)
  319. # define ATPX_GRAPHICS_DEVICE_SWITCH_END_NOTIFICATION_SUPPORTED (1 << 5)
  320. # define ATPX_GET_DISPLAY_CONNECTORS_MAPPING_SUPPORTED (1 << 7)
  321. # define ATPX_GET_DISPLAY_DETECTION_PORTS_SUPPORTED (1 << 8)
  322. #define ATPX_FUNCTION_GET_PX_PARAMETERS 0x1
  323. /* ARG0: ATPX_FUNCTION_GET_PX_PARAMETERS
  324. * ARG1: none
  325. * OUTPUT:
  326. * WORD - structure size in bytes (includes size field)
  327. * DWORD - valid flags mask
  328. * DWORD - flags
  329. */
  330. /* flags */
  331. # define ATPX_LVDS_I2C_AVAILABLE_TO_BOTH_GPUS (1 << 0)
  332. # define ATPX_CRT1_I2C_AVAILABLE_TO_BOTH_GPUS (1 << 1)
  333. # define ATPX_DVI1_I2C_AVAILABLE_TO_BOTH_GPUS (1 << 2)
  334. # define ATPX_CRT1_RGB_SIGNAL_MUXED (1 << 3)
  335. # define ATPX_TV_SIGNAL_MUXED (1 << 4)
  336. # define ATPX_DFP_SIGNAL_MUXED (1 << 5)
  337. # define ATPX_SEPARATE_MUX_FOR_I2C (1 << 6)
  338. # define ATPX_DYNAMIC_PX_SUPPORTED (1 << 7)
  339. # define ATPX_ACF_NOT_SUPPORTED (1 << 8)
  340. # define ATPX_FIXED_NOT_SUPPORTED (1 << 9)
  341. # define ATPX_DYNAMIC_DGPU_POWER_OFF_SUPPORTED (1 << 10)
  342. # define ATPX_DGPU_REQ_POWER_FOR_DISPLAYS (1 << 11)
  343. # define ATPX_DGPU_CAN_DRIVE_DISPLAYS (1 << 12)
  344. # define ATPX_MS_HYBRID_GFX_SUPPORTED (1 << 14)
  345. #define ATPX_FUNCTION_POWER_CONTROL 0x2
  346. /* ARG0: ATPX_FUNCTION_POWER_CONTROL
  347. * ARG1:
  348. * WORD - structure size in bytes (includes size field)
  349. * BYTE - dGPU power state (0: power off, 1: power on)
  350. * OUTPUT: none
  351. */
  352. #define ATPX_FUNCTION_DISPLAY_MUX_CONTROL 0x3
  353. /* ARG0: ATPX_FUNCTION_DISPLAY_MUX_CONTROL
  354. * ARG1:
  355. * WORD - structure size in bytes (includes size field)
  356. * WORD - display mux control (0: iGPU, 1: dGPU)
  357. * OUTPUT: none
  358. */
  359. # define ATPX_INTEGRATED_GPU 0
  360. # define ATPX_DISCRETE_GPU 1
  361. #define ATPX_FUNCTION_I2C_MUX_CONTROL 0x4
  362. /* ARG0: ATPX_FUNCTION_I2C_MUX_CONTROL
  363. * ARG1:
  364. * WORD - structure size in bytes (includes size field)
  365. * WORD - i2c/aux/hpd mux control (0: iGPU, 1: dGPU)
  366. * OUTPUT: none
  367. */
  368. #define ATPX_FUNCTION_GRAPHICS_DEVICE_SWITCH_START_NOTIFICATION 0x5
  369. /* ARG0: ATPX_FUNCTION_GRAPHICS_DEVICE_SWITCH_START_NOTIFICATION
  370. * ARG1:
  371. * WORD - structure size in bytes (includes size field)
  372. * WORD - target gpu (0: iGPU, 1: dGPU)
  373. * OUTPUT: none
  374. */
  375. #define ATPX_FUNCTION_GRAPHICS_DEVICE_SWITCH_END_NOTIFICATION 0x6
  376. /* ARG0: ATPX_FUNCTION_GRAPHICS_DEVICE_SWITCH_END_NOTIFICATION
  377. * ARG1:
  378. * WORD - structure size in bytes (includes size field)
  379. * WORD - target gpu (0: iGPU, 1: dGPU)
  380. * OUTPUT: none
  381. */
  382. #define ATPX_FUNCTION_GET_DISPLAY_CONNECTORS_MAPPING 0x8
  383. /* ARG0: ATPX_FUNCTION_GET_DISPLAY_CONNECTORS_MAPPING
  384. * ARG1: none
  385. * OUTPUT:
  386. * WORD - number of display connectors
  387. * WORD - connector structure size in bytes (excludes connector size field)
  388. * BYTE - flags \
  389. * BYTE - ATIF display vector bit position } repeated
  390. * BYTE - adapter id (0: iGPU, 1-n: dGPU ordered by pcie bus number) } structure
  391. * WORD - connector ACPI id /
  392. */
  393. /* flags */
  394. # define ATPX_DISPLAY_OUTPUT_SUPPORTED_BY_ADAPTER_ID_DEVICE (1 << 0)
  395. # define ATPX_DISPLAY_HPD_SUPPORTED_BY_ADAPTER_ID_DEVICE (1 << 1)
  396. # define ATPX_DISPLAY_I2C_SUPPORTED_BY_ADAPTER_ID_DEVICE (1 << 2)
  397. #define ATPX_FUNCTION_GET_DISPLAY_DETECTION_PORTS 0x9
  398. /* ARG0: ATPX_FUNCTION_GET_DISPLAY_DETECTION_PORTS
  399. * ARG1: none
  400. * OUTPUT:
  401. * WORD - number of HPD/DDC ports
  402. * WORD - port structure size in bytes (excludes port size field)
  403. * BYTE - ATIF display vector bit position \
  404. * BYTE - hpd id } reapeated structure
  405. * BYTE - ddc id /
  406. *
  407. * available on A+A systems only
  408. */
  409. /* hpd id */
  410. # define ATPX_HPD_NONE 0
  411. # define ATPX_HPD1 1
  412. # define ATPX_HPD2 2
  413. # define ATPX_HPD3 3
  414. # define ATPX_HPD4 4
  415. # define ATPX_HPD5 5
  416. # define ATPX_HPD6 6
  417. /* ddc id */
  418. # define ATPX_DDC_NONE 0
  419. # define ATPX_DDC1 1
  420. # define ATPX_DDC2 2
  421. # define ATPX_DDC3 3
  422. # define ATPX_DDC4 4
  423. # define ATPX_DDC5 5
  424. # define ATPX_DDC6 6
  425. # define ATPX_DDC7 7
  426. # define ATPX_DDC8 8
  427. /* ATCS */
  428. #define ATCS_FUNCTION_VERIFY_INTERFACE 0x0
  429. /* ARG0: ATCS_FUNCTION_VERIFY_INTERFACE
  430. * ARG1: none
  431. * OUTPUT:
  432. * WORD - structure size in bytes (includes size field)
  433. * WORD - version
  434. * DWORD - supported functions bit vector
  435. */
  436. /* supported functions vector */
  437. # define ATCS_GET_EXTERNAL_STATE_SUPPORTED (1 << 0)
  438. # define ATCS_PCIE_PERFORMANCE_REQUEST_SUPPORTED (1 << 1)
  439. # define ATCS_PCIE_DEVICE_READY_NOTIFICATION_SUPPORTED (1 << 2)
  440. # define ATCS_SET_PCIE_BUS_WIDTH_SUPPORTED (1 << 3)
  441. #define ATCS_FUNCTION_GET_EXTERNAL_STATE 0x1
  442. /* ARG0: ATCS_FUNCTION_GET_EXTERNAL_STATE
  443. * ARG1: none
  444. * OUTPUT:
  445. * WORD - structure size in bytes (includes size field)
  446. * DWORD - valid flags mask
  447. * DWORD - flags (0: undocked, 1: docked)
  448. */
  449. /* flags */
  450. # define ATCS_DOCKED (1 << 0)
  451. #define ATCS_FUNCTION_PCIE_PERFORMANCE_REQUEST 0x2
  452. /* ARG0: ATCS_FUNCTION_PCIE_PERFORMANCE_REQUEST
  453. * ARG1:
  454. * WORD - structure size in bytes (includes size field)
  455. * WORD - client id (bit 2-0: func num, 7-3: dev num, 15-8: bus num)
  456. * WORD - valid flags mask
  457. * WORD - flags
  458. * BYTE - request type
  459. * BYTE - performance request
  460. * OUTPUT:
  461. * WORD - structure size in bytes (includes size field)
  462. * BYTE - return value
  463. */
  464. /* flags */
  465. # define ATCS_ADVERTISE_CAPS (1 << 0)
  466. # define ATCS_WAIT_FOR_COMPLETION (1 << 1)
  467. /* request type */
  468. # define ATCS_PCIE_LINK_SPEED 1
  469. /* performance request */
  470. # define ATCS_REMOVE 0
  471. # define ATCS_FORCE_LOW_POWER 1
  472. # define ATCS_PERF_LEVEL_1 2 /* PCIE Gen 1 */
  473. # define ATCS_PERF_LEVEL_2 3 /* PCIE Gen 2 */
  474. # define ATCS_PERF_LEVEL_3 4 /* PCIE Gen 3 */
  475. /* return value */
  476. # define ATCS_REQUEST_REFUSED 1
  477. # define ATCS_REQUEST_COMPLETE 2
  478. # define ATCS_REQUEST_IN_PROGRESS 3
  479. #define ATCS_FUNCTION_PCIE_DEVICE_READY_NOTIFICATION 0x3
  480. /* ARG0: ATCS_FUNCTION_PCIE_DEVICE_READY_NOTIFICATION
  481. * ARG1: none
  482. * OUTPUT: none
  483. */
  484. #define ATCS_FUNCTION_SET_PCIE_BUS_WIDTH 0x4
  485. /* ARG0: ATCS_FUNCTION_SET_PCIE_BUS_WIDTH
  486. * ARG1:
  487. * WORD - structure size in bytes (includes size field)
  488. * WORD - client id (bit 2-0: func num, 7-3: dev num, 15-8: bus num)
  489. * BYTE - number of active lanes
  490. * OUTPUT:
  491. * WORD - structure size in bytes (includes size field)
  492. * BYTE - number of active lanes
  493. */
  494. #endif