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 __I2C_GENERIC_CHIP_H__
4 #define __I2C_GENERIC_CHIP_H__
5 
6 #include <acpi/acpi_device.h>
7 #include <device/i2c_simple.h>
8 
9 #define MAX_GENERIC_PROPERTY_LIST 10
10 
12  const char *hid; /* ACPI _HID (required) */
13  const char *cid; /* ACPI _CID */
14  const char *name; /* ACPI Device Name */
15  const char *desc; /* Device Description */
16  unsigned int uid; /* ACPI _UID */
17  enum i2c_speed speed; /* Bus speed in Hz, default is I2C_SPEED_FAST */
18  const char *compat_string; /* Compatible string for _HID=PRP0001 */
19  unsigned int wake; /* Wake GPE */
20  struct acpi_irq irq; /* Interrupt */
21 
22  /* Use GPIO based interrupt instead of PIRQ */
23  struct acpi_gpio irq_gpio;
24 
25  /*
26  * This flag will add a device property which will indicate
27  * to the OS that it should probe this device before adding it.
28  *
29  * This can be used to declare a device that may not exist on
30  * the board, for example to support multiple trackpad vendors.
31  */
32  int probed;
33 
34  /* GPIO used to indicate if this device is present */
35  unsigned int device_present_gpio;
37 
38  /* Disable reset and enable GPIO export in _CRS */
40 
41  /* Does the device have a power resource? */
43 
44  /* GPIO used to take device out of reset or to put it into reset. */
45  struct acpi_gpio reset_gpio;
46  /* Delay to be inserted after device is taken out of reset. */
47  unsigned int reset_delay_ms;
48  /* Delay to be inserted after device is put into reset. */
49  unsigned int reset_off_delay_ms;
50  /* GPIO used to enable device. */
51  struct acpi_gpio enable_gpio;
52  /* Delay to be inserted after device is enabled. */
53  unsigned int enable_delay_ms;
54  /* Delay to be inserted after device is disabled. */
55  unsigned int enable_off_delay_ms;
56  /* GPIO used to stop operation of device. */
57  struct acpi_gpio stop_gpio;
58  /* Delay to be inserted after disabling stop. */
59  unsigned int stop_delay_ms;
60  /* Delay to be inserted after enabling stop. */
61  unsigned int stop_off_delay_ms;
62 
63  /* Generic properties for exporting device-specific data to the OS */
66 };
67 
68 /*
69  * Fills in generic information about i2c device from device-tree
70  * properties. Callback can be provided to fill in any
71  * device-specific information in SSDT.
72  *
73  * Parameters:
74  * dev: Device requesting i2c generic information to be filled
75  * callback: Callback to fill in device-specific information
76  * config: Pointer to drivers_i2c_generic_config structure
77  */
78 void i2c_generic_fill_ssdt(const struct device *dev,
79  void (*callback)(const struct device *dev),
81 
82 #endif /* __I2C_GENERIC_CHIP_H__ */
#define MAX_GENERIC_PROPERTY_LIST
Definition: chip.h:9
void i2c_generic_fill_ssdt(const struct device *dev, void(*callback)(const struct device *dev), struct drivers_i2c_generic_config *config)
i2c_speed
Definition: i2c.h:43
enum board_config config
Definition: memory.c:448
Definition: device.h:107
struct acpi_gpio irq_gpio
Definition: chip.h:23
unsigned int enable_delay_ms
Definition: chip.h:53
struct acpi_irq irq
Definition: chip.h:20
unsigned int uid
Definition: chip.h:16
struct acpi_gpio stop_gpio
Definition: chip.h:57
unsigned int device_present_gpio_invert
Definition: chip.h:36
const char * cid
Definition: chip.h:13
unsigned int wake
Definition: chip.h:19
const char * name
Definition: chip.h:14
const char * desc
Definition: chip.h:15
const char * hid
Definition: chip.h:12
unsigned int stop_off_delay_ms
Definition: chip.h:61
unsigned int stop_delay_ms
Definition: chip.h:59
unsigned int reset_delay_ms
Definition: chip.h:47
struct acpi_gpio enable_gpio
Definition: chip.h:51
unsigned int enable_off_delay_ms
Definition: chip.h:55
struct acpi_dp property_list[MAX_GENERIC_PROPERTY_LIST]
Definition: chip.h:64
unsigned int reset_off_delay_ms
Definition: chip.h:49
unsigned int device_present_gpio
Definition: chip.h:35
const char * compat_string
Definition: chip.h:18
enum i2c_speed speed
Definition: chip.h:17
bool disable_gpio_export_in_crs
Definition: chip.h:39
struct acpi_gpio reset_gpio
Definition: chip.h:45