UPSTREAM: apollolake: Add handler for finding ACPI path for GPIO
Add a handler for soc/intel/apollolake to return the ACPI path for GPIOs. There are 4 GPIO "communities" on apollolake that each have a different ACPI device so return the appropriate name for the different communities. BUG=None BRANCH=None TEST=None Change-Id: I596c178b7813ac6aaeb4f2685bb916f5b78e049b Original-Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Original-Reviewed-on: https://review.coreboot.org/14859 Original-Tested-by: build bot (Jenkins) Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/346993 Commit-Ready: Martin Roth <martinroth@chromium.org> Tested-by: Martin Roth <martinroth@chromium.org> Reviewed-by: Martin Roth <martinroth@chromium.org>
This commit is contained in:
parent
aeb50ed7d2
commit
11a0f18dd6
1 changed files with 18 additions and 0 deletions
|
|
@ -114,3 +114,21 @@ void gpio_set(gpio_t gpio_num, int value)
|
|||
reg |= !!value & PAD_CFG0_TX_STATE;
|
||||
iosf_write(comm->port, config_offset, reg);
|
||||
}
|
||||
|
||||
const char *gpio_acpi_path(gpio_t gpio_num)
|
||||
{
|
||||
const struct pad_community *comm = gpio_get_community(gpio_num);
|
||||
|
||||
switch (comm->port) {
|
||||
case GPIO_NORTH:
|
||||
return "\\_SB.GPO0";
|
||||
case GPIO_NORTHWEST:
|
||||
return "\\_SB.GPO1";
|
||||
case GPIO_WEST:
|
||||
return "\\_SB.GPO2";
|
||||
case GPIO_SOUTHWEST:
|
||||
return "\\_SB.GPO3";
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue