Angel Pons | 8a3453f | 2020-04-02 23:48:19 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Mathew King | c135b82 | 2019-10-14 10:19:15 -0600 | [diff] [blame] | 2 | |
Furquan Shaikh | a0b0d42 | 2020-02-21 09:57:54 -0800 | [diff] [blame] | 3 | #ifndef __DRIVERS_GFX_GENERIC_CHIP_H__ |
| 4 | #define __DRIVERS_GFX_GENERIC_CHIP_H__ |
Mathew King | c135b82 | 2019-10-14 10:19:15 -0600 | [diff] [blame] | 5 | |
Furquan Shaikh | 76cedd2 | 2020-05-02 10:24:23 -0700 | [diff] [blame] | 6 | #include <acpi/acpi_device.h> |
Won Chung | 467c88b | 2023-04-10 20:35:58 +0000 | [diff] [blame] | 7 | #include <acpi/acpi_pld.h> |
Rajat Jain | 7ef06b0 | 2020-02-26 23:28:02 -0800 | [diff] [blame] | 8 | |
Mathew King | c135b82 | 2019-10-14 10:19:15 -0600 | [diff] [blame] | 9 | /* Config for electronic privacy screen */ |
Furquan Shaikh | a0b0d42 | 2020-02-21 09:57:54 -0800 | [diff] [blame] | 10 | struct drivers_gfx_generic_privacy_screen_config { |
Mathew King | c135b82 | 2019-10-14 10:19:15 -0600 | [diff] [blame] | 11 | /* Is privacy screen available on this graphics device */ |
| 12 | int enabled; |
| 13 | /* ACPI namespace path to privacy screen detection function */ |
| 14 | const char *detect_function; |
| 15 | /* ACPI namespace path to privacy screen status function */ |
| 16 | const char *status_function; |
| 17 | /* ACPI namespace path to privacy screen enable function */ |
| 18 | const char *enable_function; |
| 19 | /* ACPI namespace path to privacy screen disable function */ |
| 20 | const char *disable_function; |
Rajat Jain | 7ef06b0 | 2020-02-26 23:28:02 -0800 | [diff] [blame] | 21 | /* |
| 22 | * GPIO used for controlling the privacy screen. If provided, |
| 23 | * the gpio mechanism takes preference over the functions ptrs |
| 24 | * above, if any (GPIO functions override the function ptrs). |
| 25 | */ |
| 26 | struct acpi_gpio gpio; |
Mathew King | c135b82 | 2019-10-14 10:19:15 -0600 | [diff] [blame] | 27 | }; |
| 28 | |
| 29 | /* Config for an output device as defined in section A.5 of the ACPI spec */ |
Furquan Shaikh | a0b0d42 | 2020-02-21 09:57:54 -0800 | [diff] [blame] | 30 | struct drivers_gfx_generic_device_config { |
Mathew King | c135b82 | 2019-10-14 10:19:15 -0600 | [diff] [blame] | 31 | /* ACPI device name of the output device */ |
| 32 | const char *name; |
Tim Wawrzynczak | 67c778d | 2021-11-29 13:17:31 -0700 | [diff] [blame] | 33 | /* Value to use for _HID Name, will take precedence over _ADR */ |
| 34 | const char *hid; |
Mathew King | c135b82 | 2019-10-14 10:19:15 -0600 | [diff] [blame] | 35 | /* The address of the output device. See section A.3.2 */ |
| 36 | unsigned int addr; |
| 37 | /* Electronic privacy screen specific config */ |
Furquan Shaikh | a0b0d42 | 2020-02-21 09:57:54 -0800 | [diff] [blame] | 38 | struct drivers_gfx_generic_privacy_screen_config privacy; |
Won Chung | 467c88b | 2023-04-10 20:35:58 +0000 | [diff] [blame] | 39 | /* Physical location of connection point */ |
| 40 | bool use_pld; |
| 41 | struct acpi_pld pld; |
Mathew King | c135b82 | 2019-10-14 10:19:15 -0600 | [diff] [blame] | 42 | }; |
| 43 | |
| 44 | /* Config for an ACPI video device defined in Appendix A of the ACPI spec */ |
Furquan Shaikh | a0b0d42 | 2020-02-21 09:57:54 -0800 | [diff] [blame] | 45 | struct drivers_gfx_generic_config { |
Mathew King | c135b82 | 2019-10-14 10:19:15 -0600 | [diff] [blame] | 46 | /* |
| 47 | * ACPI device name of the graphics card, "GFX0" will be used if name is |
| 48 | * not set |
| 49 | */ |
| 50 | const char *name; |
| 51 | /* The number of output devices defined */ |
| 52 | int device_count; |
| 53 | /* Config for output devices */ |
Won Chung | 467c88b | 2023-04-10 20:35:58 +0000 | [diff] [blame] | 54 | /* 1 DDIA + 1 DDIB + max 4 TCP = up to 6 GFX devices */ |
| 55 | struct drivers_gfx_generic_device_config device[6]; |
Mathew King | c135b82 | 2019-10-14 10:19:15 -0600 | [diff] [blame] | 56 | }; |
| 57 | |
Furquan Shaikh | a0b0d42 | 2020-02-21 09:57:54 -0800 | [diff] [blame] | 58 | #endif /* __DRIVERS_GFX_GENERIC_CHIP_H__ */ |