diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2021-11-07 00:12:25 +0200 |
---|---|---|
committer | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2021-11-11 13:28:41 +0000 |
commit | 4b6ad4efe3d64c7e14136f1f62a3c71dac80c4fd (patch) | |
tree | c793de5a05b9ec3101be6bdfa4c2ddf10054c697 /src/mainboard/samsung/stumpy/chromeos.c | |
parent | 51df45f0f965768b04a21c581e94511b77df3056 (diff) |
samsung/lumpy,stumpy: Add get_power_switch()
Change-Id: I75c2e86e64943eb241db48482746317ed9ba47af
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59002
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src/mainboard/samsung/stumpy/chromeos.c')
-rw-r--r-- | src/mainboard/samsung/stumpy/chromeos.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/mainboard/samsung/stumpy/chromeos.c b/src/mainboard/samsung/stumpy/chromeos.c index 1ed5d28cad..b845a9172c 100644 --- a/src/mainboard/samsung/stumpy/chromeos.c +++ b/src/mainboard/samsung/stumpy/chromeos.c @@ -15,9 +15,6 @@ void fill_lb_gpios(struct lb_gpios *gpios) { - const pci_devfn_t dev = PCI_DEV(0, 0x1f, 0); - u16 gen_pmcon_1 = pci_s_read_config32(dev, GEN_PMCON_1); - struct lb_gpio chromeos_gpios[] = { /* Recovery: GPIO42 = CHP3_REC_MODE# */ {GPIO_REC_MODE, ACTIVE_LOW, !get_recovery_mode_switch(), @@ -27,7 +24,7 @@ void fill_lb_gpios(struct lb_gpios *gpios) {100, ACTIVE_HIGH, 1, "lid"}, /* Power Button */ - {101, ACTIVE_LOW, (gen_pmcon_1 >> 9) & 1, "power"}, + {101, ACTIVE_LOW, get_power_switch(), "power"}, /* Did we load the VGA Option ROM? */ /* -1 indicates that this is a pseudo GPIO */ @@ -46,6 +43,13 @@ static bool raw_recovery_mode_switch(void) return !get_gpio(GPIO_REC_MODE); } +int get_power_switch(void) +{ + const pci_devfn_t dev = PCI_DEV(0, 0x1f, 0); + u16 gen_pmcon_1 = pci_s_read_config32(dev, GEN_PMCON_1); + return (gen_pmcon_1 >> 9) & 1; +} + int get_write_protect_state(void) { const pci_devfn_t dev = PCI_DEV(0, 0x1f, 2); |