blob: 1a666a27eb275de59b3aecf99aea6f353a721b37 [file] [log] [blame]
Angel Pons8a3453f2020-04-02 23:48:19 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Mathew Kingc135b822019-10-14 10:19:15 -06002
Furquan Shaikha0b0d422020-02-21 09:57:54 -08003#ifndef __DRIVERS_GFX_GENERIC_CHIP_H__
4#define __DRIVERS_GFX_GENERIC_CHIP_H__
Mathew Kingc135b822019-10-14 10:19:15 -06005
Furquan Shaikh76cedd22020-05-02 10:24:23 -07006#include <acpi/acpi_device.h>
Won Chung467c88b2023-04-10 20:35:58 +00007#include <acpi/acpi_pld.h>
Rajat Jain7ef06b02020-02-26 23:28:02 -08008
Mathew Kingc135b822019-10-14 10:19:15 -06009/* Config for electronic privacy screen */
Furquan Shaikha0b0d422020-02-21 09:57:54 -080010struct drivers_gfx_generic_privacy_screen_config {
Mathew Kingc135b822019-10-14 10:19:15 -060011 /* 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 Jain7ef06b02020-02-26 23:28:02 -080021 /*
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 Kingc135b822019-10-14 10:19:15 -060027};
28
29/* Config for an output device as defined in section A.5 of the ACPI spec */
Furquan Shaikha0b0d422020-02-21 09:57:54 -080030struct drivers_gfx_generic_device_config {
Mathew Kingc135b822019-10-14 10:19:15 -060031 /* ACPI device name of the output device */
32 const char *name;
Tim Wawrzynczak67c778d2021-11-29 13:17:31 -070033 /* Value to use for _HID Name, will take precedence over _ADR */
34 const char *hid;
Mathew Kingc135b822019-10-14 10:19:15 -060035 /* The address of the output device. See section A.3.2 */
36 unsigned int addr;
37 /* Electronic privacy screen specific config */
Furquan Shaikha0b0d422020-02-21 09:57:54 -080038 struct drivers_gfx_generic_privacy_screen_config privacy;
Won Chung467c88b2023-04-10 20:35:58 +000039 /* Physical location of connection point */
40 bool use_pld;
41 struct acpi_pld pld;
Mathew Kingc135b822019-10-14 10:19:15 -060042};
43
44/* Config for an ACPI video device defined in Appendix A of the ACPI spec */
Furquan Shaikha0b0d422020-02-21 09:57:54 -080045struct drivers_gfx_generic_config {
Mathew Kingc135b822019-10-14 10:19:15 -060046 /*
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 Chung467c88b2023-04-10 20:35:58 +000054 /* 1 DDIA + 1 DDIB + max 4 TCP = up to 6 GFX devices */
55 struct drivers_gfx_generic_device_config device[6];
Mathew Kingc135b822019-10-14 10:19:15 -060056};
57
Furquan Shaikha0b0d422020-02-21 09:57:54 -080058#endif /* __DRIVERS_GFX_GENERIC_CHIP_H__ */