diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2021-11-07 00:09:12 +0200 |
---|---|---|
committer | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2021-11-11 13:27:41 +0000 |
commit | 51df45f0f965768b04a21c581e94511b77df3056 (patch) | |
tree | 674fc8a99c205474a138be7da271f311e47128ae /src/mainboard/samsung | |
parent | 8355e6e72300d463cae243e1fa1bc4b665bf9fd8 (diff) |
samsung/lumpy: Add get_lid_switch()
Change-Id: Ib360a6fa00d0ebda4635b96f1b671a66c1ca11c1
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59001
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src/mainboard/samsung')
-rw-r--r-- | src/mainboard/samsung/lumpy/chromeos.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mainboard/samsung/lumpy/chromeos.c b/src/mainboard/samsung/lumpy/chromeos.c index 707e30cc28..c6cdd668b7 100644 --- a/src/mainboard/samsung/lumpy/chromeos.c +++ b/src/mainboard/samsung/lumpy/chromeos.c @@ -21,14 +21,13 @@ 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); - u8 lid = ec_read(0x83); struct lb_gpio chromeos_gpios[] = { /* Recovery: GPIO42 = CHP3_REC_MODE# */ {GPIO_REC_MODE, ACTIVE_LOW, !get_recovery_mode_switch(), "presence"}, - {100, ACTIVE_HIGH, lid & 1, "lid"}, + {100, ACTIVE_HIGH, get_lid_switch(), "lid"}, /* Power Button */ {101, ACTIVE_LOW, (gen_pmcon_1 >> 9) & 1, "power"}, @@ -50,6 +49,11 @@ static bool raw_recovery_mode_switch(void) return !get_gpio(GPIO_REC_MODE); } +int get_lid_switch(void) +{ + return ec_read(0x83) & 1; +} + int get_write_protect_state(void) { const pci_devfn_t dev = PCI_DEV(0, 0x1f, 2); |