Angel Pons | 8a3453f | 2020-04-02 23:48:19 +0200 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | /* This file is part of the coreboot project. */ |
Furquan Shaikh | 20a91c9 | 2017-02-11 11:16:18 -0800 | [diff] [blame] | 3 | |
| 4 | #ifndef __SPI_ACPI_CHIP_H__ |
| 5 | #define __SPI_ACPI_CHIP_H__ |
| 6 | |
| 7 | #include <arch/acpi_device.h> |
| 8 | |
| 9 | struct drivers_spi_acpi_config { |
| 10 | const char *hid; /* ACPI _HID (required) */ |
| 11 | const char *cid; /* ACPI _CID */ |
| 12 | const char *name; /* ACPI Device Name */ |
| 13 | const char *desc; /* Device Description */ |
Martin Roth | 38ddbfb | 2019-10-23 21:41:00 -0600 | [diff] [blame] | 14 | unsigned int uid; /* ACPI _UID */ |
| 15 | unsigned int speed; /* Bus speed in Hz (default 1MHz) */ |
Furquan Shaikh | 20a91c9 | 2017-02-11 11:16:18 -0800 | [diff] [blame] | 16 | const char *compat_string; /* Compatible string for _HID=PRP0001 */ |
| 17 | struct acpi_irq irq; /* Interrupt */ |
Martin Roth | 38ddbfb | 2019-10-23 21:41:00 -0600 | [diff] [blame] | 18 | unsigned int wake; /* Wake GPE */ |
Duncan Laurie | c9db384 | 2017-02-17 17:14:35 -0800 | [diff] [blame] | 19 | |
| 20 | /* Use GPIO based interrupt instead of PIRQ */ |
| 21 | struct acpi_gpio irq_gpio; |
| 22 | |
| 23 | /* Disable reset and enable GPIO export in _CRS */ |
| 24 | bool disable_gpio_export_in_crs; |
| 25 | |
| 26 | /* Does the device have a power resource? */ |
| 27 | bool has_power_resource; |
| 28 | |
| 29 | /* GPIO used to take device out of reset or to put it into reset. */ |
| 30 | struct acpi_gpio reset_gpio; |
| 31 | /* Delay to be inserted after device is taken out of reset. */ |
Shelley Chen | a060339 | 2018-04-26 13:52:30 -0700 | [diff] [blame] | 32 | unsigned int reset_delay_ms; |
| 33 | /* Delay to be inserted after device is put into reset. */ |
| 34 | unsigned int reset_off_delay_ms; |
Duncan Laurie | c9db384 | 2017-02-17 17:14:35 -0800 | [diff] [blame] | 35 | |
| 36 | /* GPIO used to enable device. */ |
| 37 | struct acpi_gpio enable_gpio; |
| 38 | /* Delay to be inserted after device is enabled. */ |
Shelley Chen | a060339 | 2018-04-26 13:52:30 -0700 | [diff] [blame] | 39 | unsigned int enable_delay_ms; |
| 40 | /* Delay to be inserted after device is disabled. */ |
| 41 | unsigned int enable_off_delay_ms; |
Furquan Shaikh | edf459f | 2017-08-28 17:20:49 -0700 | [diff] [blame] | 42 | |
| 43 | /* GPIO used to stop operation of device. */ |
| 44 | struct acpi_gpio stop_gpio; |
| 45 | /* Delay to be inserted after disabling stop. */ |
Shelley Chen | a060339 | 2018-04-26 13:52:30 -0700 | [diff] [blame] | 46 | unsigned int stop_delay_ms; |
| 47 | /* Delay to be inserted after enabling stop. */ |
| 48 | unsigned int stop_off_delay_ms; |
Furquan Shaikh | 20a91c9 | 2017-02-11 11:16:18 -0800 | [diff] [blame] | 49 | }; |
| 50 | |
| 51 | #endif /* __SPI_ACPI_CHIP_H__ */ |