summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/i2c/generic/chip.h12
-rw-r--r--src/drivers/i2c/generic/generic.c19
-rw-r--r--src/drivers/spi/acpi/acpi.c19
-rw-r--r--src/drivers/spi/acpi/chip.h12
4 files changed, 46 insertions, 16 deletions
diff --git a/src/drivers/i2c/generic/chip.h b/src/drivers/i2c/generic/chip.h
index 037a8004bc..2495e7c8c6 100644
--- a/src/drivers/i2c/generic/chip.h
+++ b/src/drivers/i2c/generic/chip.h
@@ -56,15 +56,21 @@ struct drivers_i2c_generic_config {
/* GPIO used to take device out of reset or to put it into reset. */
struct acpi_gpio reset_gpio;
/* Delay to be inserted after device is taken out of reset. */
- unsigned reset_delay_ms;
+ unsigned int reset_delay_ms;
+ /* Delay to be inserted after device is put into reset. */
+ unsigned int reset_off_delay_ms;
/* GPIO used to enable device. */
struct acpi_gpio enable_gpio;
/* Delay to be inserted after device is enabled. */
- unsigned enable_delay_ms;
+ unsigned int enable_delay_ms;
+ /* Delay to be inserted after device is disabled. */
+ unsigned int enable_off_delay_ms;
/* GPIO used to stop operation of device. */
struct acpi_gpio stop_gpio;
/* Delay to be inserted after disabling stop. */
- unsigned stop_delay_ms;
+ unsigned int stop_delay_ms;
+ /* Delay to be inserted after enabling stop. */
+ unsigned int stop_off_delay_ms;
/* Generic properties for exporting device-specific data to the OS */
struct acpi_dp property_list[MAX_GENERIC_PROPERTY_LIST];
diff --git a/src/drivers/i2c/generic/generic.c b/src/drivers/i2c/generic/generic.c
index 13f83935f9..46fff4ac6d 100644
--- a/src/drivers/i2c/generic/generic.c
+++ b/src/drivers/i2c/generic/generic.c
@@ -142,11 +142,20 @@ void i2c_generic_fill_ssdt(struct device *dev,
}
/* Power Resource */
- if (config->has_power_resource)
- acpi_device_add_power_res(
- &config->reset_gpio, config->reset_delay_ms,
- &config->enable_gpio, config->enable_delay_ms,
- &config->stop_gpio, config->stop_delay_ms);
+ if (config->has_power_resource) {
+ const struct acpi_power_res_params power_res_params = {
+ &config->reset_gpio,
+ config->reset_delay_ms,
+ config->reset_off_delay_ms,
+ &config->enable_gpio,
+ config->enable_delay_ms,
+ config->enable_off_delay_ms,
+ &config->stop_gpio,
+ config->stop_delay_ms,
+ config->stop_off_delay_ms
+ };
+ acpi_device_add_power_res(&power_res_params);
+ }
/* Callback if any. */
if (callback)
diff --git a/src/drivers/spi/acpi/acpi.c b/src/drivers/spi/acpi/acpi.c
index d36a03ac20..7af046046a 100644
--- a/src/drivers/spi/acpi/acpi.c
+++ b/src/drivers/spi/acpi/acpi.c
@@ -165,11 +165,20 @@ static void spi_acpi_fill_ssdt_generator(struct device *dev)
}
/* Power Resource */
- if (config->has_power_resource)
- acpi_device_add_power_res(
- &config->reset_gpio, config->reset_delay_ms,
- &config->enable_gpio, config->enable_delay_ms,
- &config->stop_gpio, config->stop_delay_ms);
+ if (config->has_power_resource) {
+ const struct acpi_power_res_params power_res_params = {
+ &config->reset_gpio,
+ config->reset_delay_ms,
+ config->reset_off_delay_ms,
+ &config->enable_gpio,
+ config->enable_delay_ms,
+ config->enable_off_delay_ms,
+ &config->stop_gpio,
+ config->stop_delay_ms,
+ config->stop_off_delay_ms
+ };
+ acpi_device_add_power_res(&power_res_params);
+ }
acpigen_pop_len(); /* Device */
acpigen_pop_len(); /* Scope */
diff --git a/src/drivers/spi/acpi/chip.h b/src/drivers/spi/acpi/chip.h
index 35341d33be..fa7d8a15d2 100644
--- a/src/drivers/spi/acpi/chip.h
+++ b/src/drivers/spi/acpi/chip.h
@@ -41,17 +41,23 @@ struct drivers_spi_acpi_config {
/* GPIO used to take device out of reset or to put it into reset. */
struct acpi_gpio reset_gpio;
/* Delay to be inserted after device is taken out of reset. */
- unsigned reset_delay_ms;
+ unsigned int reset_delay_ms;
+ /* Delay to be inserted after device is put into reset. */
+ unsigned int reset_off_delay_ms;
/* GPIO used to enable device. */
struct acpi_gpio enable_gpio;
/* Delay to be inserted after device is enabled. */
- unsigned enable_delay_ms;
+ unsigned int enable_delay_ms;
+ /* Delay to be inserted after device is disabled. */
+ unsigned int enable_off_delay_ms;
/* GPIO used to stop operation of device. */
struct acpi_gpio stop_gpio;
/* Delay to be inserted after disabling stop. */
- unsigned stop_delay_ms;
+ unsigned int stop_delay_ms;
+ /* Delay to be inserted after enabling stop. */
+ unsigned int stop_off_delay_ms;
};
#endif /* __SPI_ACPI_CHIP_H__ */