crossystem: Add support for multiple gpiochip entries

The current logic for finding a GPIO expects only one gpiochip
entry to exist in /sys/class/gpio.  With Samus there is a second
entry because the codec also exports a set of GPIOs.

To solve this we can use the gpiochip#/label file and compare
against the GPIO controller name described in ACPI.

This adds support for that detection method, as well as a new
GPIO controller entry for INT3437:00 which is used in Broadwell
systems.

BUG=chrome-os-partner:33098
BRANCH=samus
TEST=crossytem wpsw_cur works on samus (TOT with enabled codec)

Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/224156
Reviewed-by: Bill Richardson <wfrichar@chromium.org>

(cherry picked from commit 8bb3689d42089241b209ccea2860f03aeaddd8f8)

Change-Id: I5763abdf1c9479d82826516f1c36d6374a0df288
Reviewed-on: https://chromium-review.googlesource.com/224572
Commit-Queue: Ricky Liang <jcliang@chromium.org>
Tested-by: Ricky Liang <jcliang@chromium.org>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
1 file changed