blob: 9bee847f2bef8930cecf0d9df3cf57b8be74cef3 [file] [log] [blame]
Angel Pons8a3453f2020-04-02 23:48:19 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Furquan Shaikh20a91c92017-02-11 11:16:18 -08002
3#ifndef __SPI_ACPI_CHIP_H__
4#define __SPI_ACPI_CHIP_H__
5
Furquan Shaikh76cedd22020-05-02 10:24:23 -07006#include <acpi/acpi_device.h>
Furquan Shaikh20a91c92017-02-11 11:16:18 -08007
8struct drivers_spi_acpi_config {
9 const char *hid; /* ACPI _HID (required) */
10 const char *cid; /* ACPI _CID */
11 const char *name; /* ACPI Device Name */
12 const char *desc; /* Device Description */
Martin Roth38ddbfb2019-10-23 21:41:00 -060013 unsigned int uid; /* ACPI _UID */
14 unsigned int speed; /* Bus speed in Hz (default 1MHz) */
Furquan Shaikh20a91c92017-02-11 11:16:18 -080015 const char *compat_string; /* Compatible string for _HID=PRP0001 */
16 struct acpi_irq irq; /* Interrupt */
Martin Roth38ddbfb2019-10-23 21:41:00 -060017 unsigned int wake; /* Wake GPE */
Duncan Lauriec9db3842017-02-17 17:14:35 -080018
19 /* Use GPIO based interrupt instead of PIRQ */
20 struct acpi_gpio irq_gpio;
21
Duncan Lauriec9db3842017-02-17 17:14:35 -080022 /* Does the device have a power resource? */
23 bool has_power_resource;
24
25 /* GPIO used to take device out of reset or to put it into reset. */
26 struct acpi_gpio reset_gpio;
27 /* Delay to be inserted after device is taken out of reset. */
Shelley Chena0603392018-04-26 13:52:30 -070028 unsigned int reset_delay_ms;
29 /* Delay to be inserted after device is put into reset. */
30 unsigned int reset_off_delay_ms;
Duncan Lauriec9db3842017-02-17 17:14:35 -080031
32 /* GPIO used to enable device. */
33 struct acpi_gpio enable_gpio;
34 /* Delay to be inserted after device is enabled. */
Shelley Chena0603392018-04-26 13:52:30 -070035 unsigned int enable_delay_ms;
36 /* Delay to be inserted after device is disabled. */
37 unsigned int enable_off_delay_ms;
Furquan Shaikhedf459f2017-08-28 17:20:49 -070038
39 /* GPIO used to stop operation of device. */
40 struct acpi_gpio stop_gpio;
41 /* Delay to be inserted after disabling stop. */
Shelley Chena0603392018-04-26 13:52:30 -070042 unsigned int stop_delay_ms;
43 /* Delay to be inserted after enabling stop. */
44 unsigned int stop_off_delay_ms;
Furquan Shaikh20a91c92017-02-11 11:16:18 -080045};
46
47#endif /* __SPI_ACPI_CHIP_H__ */