Furquan Shaikh | 20a91c9 | 2017-02-11 11:16:18 -0800 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
Furquan Shaikh | 20a91c9 | 2017-02-11 11:16:18 -0800 | [diff] [blame] | 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License as published by |
| 6 | * the Free Software Foundation; version 2 of the License. |
| 7 | * |
| 8 | * This program is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. |
| 12 | */ |
| 13 | |
| 14 | #ifndef __SPI_ACPI_CHIP_H__ |
| 15 | #define __SPI_ACPI_CHIP_H__ |
| 16 | |
| 17 | #include <arch/acpi_device.h> |
| 18 | |
| 19 | struct drivers_spi_acpi_config { |
| 20 | const char *hid; /* ACPI _HID (required) */ |
| 21 | const char *cid; /* ACPI _CID */ |
| 22 | const char *name; /* ACPI Device Name */ |
| 23 | const char *desc; /* Device Description */ |
Martin Roth | 38ddbfb | 2019-10-23 21:41:00 -0600 | [diff] [blame^] | 24 | unsigned int uid; /* ACPI _UID */ |
| 25 | unsigned int speed; /* Bus speed in Hz (default 1MHz) */ |
Furquan Shaikh | 20a91c9 | 2017-02-11 11:16:18 -0800 | [diff] [blame] | 26 | const char *compat_string; /* Compatible string for _HID=PRP0001 */ |
| 27 | struct acpi_irq irq; /* Interrupt */ |
Martin Roth | 38ddbfb | 2019-10-23 21:41:00 -0600 | [diff] [blame^] | 28 | unsigned int wake; /* Wake GPE */ |
Duncan Laurie | c9db384 | 2017-02-17 17:14:35 -0800 | [diff] [blame] | 29 | |
| 30 | /* Use GPIO based interrupt instead of PIRQ */ |
| 31 | struct acpi_gpio irq_gpio; |
| 32 | |
| 33 | /* Disable reset and enable GPIO export in _CRS */ |
| 34 | bool disable_gpio_export_in_crs; |
| 35 | |
| 36 | /* Does the device have a power resource? */ |
| 37 | bool has_power_resource; |
| 38 | |
| 39 | /* GPIO used to take device out of reset or to put it into reset. */ |
| 40 | struct acpi_gpio reset_gpio; |
| 41 | /* Delay to be inserted after device is taken out of reset. */ |
Shelley Chen | a060339 | 2018-04-26 13:52:30 -0700 | [diff] [blame] | 42 | unsigned int reset_delay_ms; |
| 43 | /* Delay to be inserted after device is put into reset. */ |
| 44 | unsigned int reset_off_delay_ms; |
Duncan Laurie | c9db384 | 2017-02-17 17:14:35 -0800 | [diff] [blame] | 45 | |
| 46 | /* GPIO used to enable device. */ |
| 47 | struct acpi_gpio enable_gpio; |
| 48 | /* Delay to be inserted after device is enabled. */ |
Shelley Chen | a060339 | 2018-04-26 13:52:30 -0700 | [diff] [blame] | 49 | unsigned int enable_delay_ms; |
| 50 | /* Delay to be inserted after device is disabled. */ |
| 51 | unsigned int enable_off_delay_ms; |
Furquan Shaikh | edf459f | 2017-08-28 17:20:49 -0700 | [diff] [blame] | 52 | |
| 53 | /* GPIO used to stop operation of device. */ |
| 54 | struct acpi_gpio stop_gpio; |
| 55 | /* Delay to be inserted after disabling stop. */ |
Shelley Chen | a060339 | 2018-04-26 13:52:30 -0700 | [diff] [blame] | 56 | unsigned int stop_delay_ms; |
| 57 | /* Delay to be inserted after enabling stop. */ |
| 58 | unsigned int stop_off_delay_ms; |
Furquan Shaikh | 20a91c9 | 2017-02-11 11:16:18 -0800 | [diff] [blame] | 59 | }; |
| 60 | |
| 61 | #endif /* __SPI_ACPI_CHIP_H__ */ |