blob: 57c1a5cad11e8fdc1f287dea3d9561fce74fb940 [file] [log] [blame]
Furquan Shaikh20a91c92017-02-11 11:16:18 -08001/*
2 * This file is part of the coreboot project.
3 *
Furquan Shaikh20a91c92017-02-11 11:16:18 -08004 * 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
19struct 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 Roth38ddbfb2019-10-23 21:41:00 -060024 unsigned int uid; /* ACPI _UID */
25 unsigned int speed; /* Bus speed in Hz (default 1MHz) */
Furquan Shaikh20a91c92017-02-11 11:16:18 -080026 const char *compat_string; /* Compatible string for _HID=PRP0001 */
27 struct acpi_irq irq; /* Interrupt */
Martin Roth38ddbfb2019-10-23 21:41:00 -060028 unsigned int wake; /* Wake GPE */
Duncan Lauriec9db3842017-02-17 17:14:35 -080029
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 Chena0603392018-04-26 13:52:30 -070042 unsigned int reset_delay_ms;
43 /* Delay to be inserted after device is put into reset. */
44 unsigned int reset_off_delay_ms;
Duncan Lauriec9db3842017-02-17 17:14:35 -080045
46 /* GPIO used to enable device. */
47 struct acpi_gpio enable_gpio;
48 /* Delay to be inserted after device is enabled. */
Shelley Chena0603392018-04-26 13:52:30 -070049 unsigned int enable_delay_ms;
50 /* Delay to be inserted after device is disabled. */
51 unsigned int enable_off_delay_ms;
Furquan Shaikhedf459f2017-08-28 17:20:49 -070052
53 /* GPIO used to stop operation of device. */
54 struct acpi_gpio stop_gpio;
55 /* Delay to be inserted after disabling stop. */
Shelley Chena0603392018-04-26 13:52:30 -070056 unsigned int stop_delay_ms;
57 /* Delay to be inserted after enabling stop. */
58 unsigned int stop_off_delay_ms;
Furquan Shaikh20a91c92017-02-11 11:16:18 -080059};
60
61#endif /* __SPI_ACPI_CHIP_H__ */