From e8dde0bd403f168b2f61f9bb7e5d68511db0d505 Mon Sep 17 00:00:00 2001 From: Duncan Laurie Date: Fri, 17 Oct 2014 14:42:29 -0700 Subject: HACK: samus: workaround for gpiochip label The Samus EVT2 BIOS names the GPIO controller "PCH-LP" which does not match the label in the kernel. As a workaround for the factory use an alias for the PCH-LP that will allow it to find GPIOs properly. BUG=chrome-os-partner:33098 BRANCH=samus TEST='crossystem wpsw_cur' returns 1 on samus with 6300.18 firmware Change-Id: I0b2a109bf79c851d9894e938741622f5c4941da0 Signed-off-by: Duncan Laurie Reviewed-on: https://chromium-review.googlesource.com/224573 Commit-Queue: Ricky Liang Tested-by: Ricky Liang --- host/arch/x86/lib/crossystem_arch.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/host/arch/x86/lib/crossystem_arch.c b/host/arch/x86/lib/crossystem_arch.c index 15a6433e..bf6baa68 100644 --- a/host/arch/x86/lib/crossystem_arch.c +++ b/host/arch/x86/lib/crossystem_arch.c @@ -625,6 +625,7 @@ struct GpioChipset { const char *name; int (*ChipOffsetAndGpioNumber)(unsigned *gpio_num, unsigned *chip_offset, const char *name); + const char *label; }; static const struct GpioChipset chipsets_supported[] = { @@ -632,8 +633,12 @@ static const struct GpioChipset chipsets_supported[] = { { "CougarPoint", FindGpioChipOffset }, { "PantherPoint", FindGpioChipOffset }, { "LynxPoint", FindGpioChipOffset }, - { "PCH-LP", FindGpioChipOffset }, - { "INT3437:00", FindGpioChipOffsetByLabel }, + /* + * FIXME(crosbug.com/p/33098): Remove this label hack once Samus + * firmware can be updated to pass the proper name in ACPI tables. + */ + { "PCH-LP", FindGpioChipOffsetByLabel, "INT3437:00" }, + { "INT3437:00", FindGpioChipOffsetByLabel, "INT3437:00" }, { "BayTrail", BayTrailFindGpioChipOffset }, { NULL }, }; @@ -693,7 +698,7 @@ static int ReadGpio(unsigned signal_type) { /* Modify GPIO number by driver's offset */ if (!chipset->ChipOffsetAndGpioNumber(&controller_num, &controller_offset, - chipset->name)) + chipset->label)) return -1; controller_offset += controller_num; -- cgit v1.2.1