summaryrefslogtreecommitdiff
path: root/src/drivers/i2c/generic/chip.h
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@chromium.org>2017-01-25 17:53:01 -0800
committerAaron Durbin <adurbin@chromium.org>2017-01-29 21:07:22 +0100
commit71d830fddc46fd22f90976f94eaaae2c390e5927 (patch)
tree53a83242f84a3e69c0a4cc6bc287f4451818ccb4 /src/drivers/i2c/generic/chip.h
parent8bf53a9f4e70760622c0a2e94185bc881bca14d9 (diff)
i2c/generic: Allow GPIOs to be put in _CRS and PowerResource in ACPI
Linux kernel expects that power management with ACPI should always be handled using PowerResource. However, some kernel drivers (e.g. ELAN touchscreen) check to see if reset gpio is passed in by the BIOS to decide whether the device loses power in suspend. Thus, until the kernel has a better way for drivers to query if device lost power in suspend, we need to allow passing in of GPIOs via _CRS as well as exporting PowerResource to control power to the device. Update mainboards to export reset GPIO as well as PowerResource for ELAN touchscreen device. BUG=chrome-os-partner:62311,chrome-os-partner:60194 BRANCH=reef TEST=Verified that touchscreen works on power-on as well as after suspend-resume. Change-Id: I3409689cf56bfddd321402ad5dda3fc8762e6bc6 Signed-off-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://review.coreboot.org/18238 Tested-by: build bot (Jenkins) Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Diffstat (limited to 'src/drivers/i2c/generic/chip.h')
-rw-r--r--src/drivers/i2c/generic/chip.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/drivers/i2c/generic/chip.h b/src/drivers/i2c/generic/chip.h
index 19c6596db4..a4f85df2ee 100644
--- a/src/drivers/i2c/generic/chip.h
+++ b/src/drivers/i2c/generic/chip.h
@@ -19,11 +19,6 @@
#include <arch/acpi_device.h>
#include <device/i2c.h>
-enum power_mgmt_type {
- POWER_RESOURCE = 1,
- GPIO_EXPORT = 2,
-};
-
struct drivers_i2c_generic_config {
const char *hid; /* ACPI _HID (required) */
const char *cid; /* ACPI _CID */
@@ -47,8 +42,11 @@ struct drivers_i2c_generic_config {
unsigned device_present_gpio;
unsigned device_present_gpio_invert;
- /* Power management type. */
- enum power_mgmt_type pwr_mgmt_type;
+ /* Disable reset and enable GPIO export in _CRS */
+ bool disable_gpio_export_in_crs;
+
+ /* Does the device have a power resource? */
+ bool has_power_resource;
/* GPIO used to take device out of reset or to put it into reset. */
struct acpi_gpio reset_gpio;