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

TEST=crossytem wpsw_cur works on samus (TOT with enabled codec)

Signed-off-by: Duncan Laurie <>
Reviewed-by: Bill Richardson <>

(cherry picked from commit 8bb3689d42089241b209ccea2860f03aeaddd8f8)

Change-Id: I5763abdf1c9479d82826516f1c36d6374a0df288
Commit-Queue: Ricky Liang <>
Tested-by: Ricky Liang <>
Reviewed-by: Duncan Laurie <>
1 file changed