diff options
Diffstat (limited to 'src/arch/x86/acpi_device.c')
-rw-r--r-- | src/arch/x86/acpi_device.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/arch/x86/acpi_device.c b/src/arch/x86/acpi_device.c index de2d3375be..31e59eaf66 100644 --- a/src/arch/x86/acpi_device.c +++ b/src/arch/x86/acpi_device.c @@ -471,13 +471,15 @@ void acpi_device_write_spi(const struct acpi_spi *spi) /* PowerResource() with Enable and/or Reset control */ void acpi_device_add_power_res( struct acpi_gpio *reset, unsigned int reset_delay_ms, - struct acpi_gpio *enable, unsigned int enable_delay_ms) + struct acpi_gpio *enable, unsigned int enable_delay_ms, + struct acpi_gpio *stop, unsigned int stop_delay_ms) { static const char *power_res_dev_states[] = { "_PR0", "_PR3" }; unsigned int reset_gpio = reset->pins[0]; unsigned int enable_gpio = enable->pins[0]; + unsigned int stop_gpio = stop->pins[0]; - if (!reset_gpio && !enable_gpio) + if (!reset_gpio && !enable_gpio && !stop_gpio) return; /* PowerResource (PRIC, 0, 0) */ @@ -501,10 +503,17 @@ void acpi_device_add_power_res( if (reset_delay_ms) acpigen_write_sleep(reset_delay_ms); } + if (stop_gpio) { + acpigen_disable_tx_gpio(stop); + if (stop_delay_ms) + acpigen_write_sleep(stop_delay_ms); + } acpigen_pop_len(); /* _ON method */ /* Method (_OFF, 0, Serialized) */ acpigen_write_method_serialized("_OFF", 0); + if (stop_gpio) + acpigen_enable_tx_gpio(stop); if (reset_gpio) acpigen_enable_tx_gpio(reset); if (enable_gpio) |