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