From 98915bb7a9ab696b3facf9a2fff3525ebb87531f Mon Sep 17 00:00:00 2001 From: Furquan Shaikh Date: Mon, 12 Dec 2016 09:23:01 -0800 Subject: drivers/i2c/generic: Allow mainboards to export reset and enable GPIOs Add power management type config option that allows mainboards to either: 1. Define a power resource that uses the reset and enable gpios to power on and off the device using _ON and _OFF methods, or 2. Export reset and enable GPIOs in _CRS and _DSD so that the OS can directly toggle the GPIOs as required. GPIO type needs to be updated in drivers_i2c_generic_config to use acpi_gpio type so that it can be used for both the above cases. BUG=chrome-os-partner:60194 BRANCH=None TEST=Verified that elan touchscreen works fine on reef using exported GPIOs. Change-Id: I4d76f193f615cfc4520869dedc55505c109042f6 Signed-off-by: Furquan Shaikh Reviewed-on: https://review.coreboot.org/17797 Tested-by: build bot (Jenkins) Reviewed-by: Duncan Laurie --- src/drivers/i2c/generic/chip.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/drivers/i2c/generic/chip.h') diff --git a/src/drivers/i2c/generic/chip.h b/src/drivers/i2c/generic/chip.h index b1fc8e5946..19c6596db4 100644 --- a/src/drivers/i2c/generic/chip.h +++ b/src/drivers/i2c/generic/chip.h @@ -19,6 +19,11 @@ #include #include +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 */ @@ -42,12 +47,15 @@ struct drivers_i2c_generic_config { unsigned device_present_gpio; unsigned device_present_gpio_invert; + /* Power management type. */ + enum power_mgmt_type pwr_mgmt_type; + /* GPIO used to take device out of reset or to put it into reset. */ - unsigned reset_gpio; + struct acpi_gpio reset_gpio; /* Delay to be inserted after device is taken out of reset. */ unsigned reset_delay_ms; /* GPIO used to enable device. */ - unsigned enable_gpio; + struct acpi_gpio enable_gpio; /* Delay to be inserted after device is enabled. */ unsigned enable_delay_ms; }; -- cgit v1.2.3