coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
chip.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #ifndef __USB_ACPI_CHIP_H__
4 #define __USB_ACPI_CHIP_H__
5 
6 #include <acpi/acpi_device.h>
7 #include <acpi/acpi.h>
8 #include <acpi/acpi_pld.h>
9 
11  const char *desc;
12 
13  /*
14  * Physical ports that are user visible
15  *
16  * UPC_TYPE_A
17  * UPC_TYPE_MINI_AB
18  * UPC_TYPE_EXPRESSCARD
19  * UPC_TYPE_USB3_A
20  * UPC_TYPE_USB3_B
21  * UPC_TYPE_USB3_MICRO_B
22  * UPC_TYPE_USB3_MICRO_AB
23  * UPC_TYPE_USB3_POWER_B
24  * UPC_TYPE_C_USB2_ONLY
25  * UPC_TYPE_C_USB2_SS_SWITCH
26  * UPC_TYPE_C_USB2_SS
27  *
28  * Non-visible ports or special devices
29  *
30  * UPC_TYPE_PROPRIETARY
31  * UPC_TYPE_INTERNAL
32  * UPC_TYPE_UNUSED
33  * UPC_TYPE_HUB
34  */
35  enum acpi_upc_type type;
36 
37  /* Group peer ports */
38  struct acpi_pld_group group;
39 
40  /*
41  * Define a custom physical location for the port.
42  * If enabled, this takes precedence over the 'group' field.
43  */
45  struct acpi_pld custom_pld;
46 
47  /* Does the device have a power resource? */
49 
50  /* GPIO used to take device out of reset or to put it into reset. */
51  struct acpi_gpio reset_gpio;
52  /* Delay to be inserted after device is taken out of reset. */
53  unsigned int reset_delay_ms;
54  /* Delay to be inserted after device is put into reset. */
55  unsigned int reset_off_delay_ms;
56  /* GPIO used to enable device. */
57  struct acpi_gpio enable_gpio;
58  /* Delay to be inserted after device is enabled. */
59  unsigned int enable_delay_ms;
60  /* Delay to be inserted after device is disabled. */
61  unsigned int enable_off_delay_ms;
62 
63  /*
64  * Define a GPIO that shows the privacy status of the USB device.
65  * E.g. On a camera: if it is one, it is recording black frames.
66  * E.g. On a mic: if it is one, it is recording white-noise.
67  */
68  struct acpi_gpio privacy_gpio;
69 
70  /* Write a _STA method that uses the state of the GPIOs to determine if
71  * the PowerResource is ON or OFF. If this is false, the _STA method
72  * will always return ON.
73  */
75 };
76 
77 /* Method to get PLD structure from USB device */
78 bool usb_acpi_get_pld(const struct device *usb_device, struct acpi_pld *pld);
79 
80 #endif /* __USB_ACPI_CHIP_H__ */
bool usb_acpi_get_pld(const struct device *usb_device, struct acpi_pld *pld)
Definition: usb_acpi.c:127
acpi_upc_type
Definition: acpi.h:1038
Definition: device.h:107
struct acpi_gpio reset_gpio
Definition: chip.h:51
struct acpi_pld_group group
Definition: chip.h:38
const char * desc
Definition: chip.h:11
unsigned int enable_off_delay_ms
Definition: chip.h:61
enum acpi_upc_type type
Definition: chip.h:35
bool has_power_resource
Definition: chip.h:48
struct acpi_gpio privacy_gpio
Definition: chip.h:68
struct acpi_pld custom_pld
Definition: chip.h:45
bool use_gpio_for_status
Definition: chip.h:74
unsigned int reset_delay_ms
Definition: chip.h:53
unsigned int enable_delay_ms
Definition: chip.h:59
unsigned int reset_off_delay_ms
Definition: chip.h:55
struct acpi_gpio enable_gpio
Definition: chip.h:57