From e8e66f47631c505ab153d8a348058350b9acfe88 Mon Sep 17 00:00:00 2001 From: Patrick Rudolph Date: Sat, 6 Feb 2016 17:42:42 +0100 Subject: southbridge/intel/bd82x6x: Use common gpio.c Use shared gpio code from common folder. Bd82x6x's gpio.c and gpio.h is used by other southbridges as well and will be removed once it is unused. Change-Id: I8bd981c4696c174152cf41caefa6c083650d283a Signed-off-by: Patrick Rudolph Reviewed-on: https://review.coreboot.org/13614 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth --- src/mainboard/google/stout/chromeos.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'src/mainboard/google/stout/chromeos.c') diff --git a/src/mainboard/google/stout/chromeos.c b/src/mainboard/google/stout/chromeos.c index a2abaed24a..4c7a9f5037 100644 --- a/src/mainboard/google/stout/chromeos.c +++ b/src/mainboard/google/stout/chromeos.c @@ -21,6 +21,7 @@ #include #include +#include #include "ec.h" #include @@ -81,20 +82,7 @@ void fill_lb_gpios(struct lb_gpios *gpios) int get_write_protect_state(void) { - device_t dev; -#ifdef __PRE_RAM__ - dev = PCI_DEV(0, 0x1f, 0); -#else - dev = dev_find_slot(0, PCI_DEVFN(0x1f, 0)); -#endif - u16 gpio_base = pci_read_config32(dev, GPIOBASE) & 0xfffe; - - if (!gpio_base) - return 0; - - u32 gp_lvl = inl(gpio_base + GP_LVL); - - return !((gp_lvl >> 7) & 1); + return !get_gpio(7); } int get_lid_switch(void) -- cgit v1.2.3