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