From 08b8785aebdc81f89e335e46d1913f119a490f9c Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Thu, 28 May 2015 11:59:33 +0200 Subject: Expose get_lid_switch() in romstage The function was used locally and in ramstage to set some coreboot tables. It's also needed in romstage to deal with "lid closed" behaviour. BRANCH=none BUG=chromium:446945 TEST=none Change-Id: I8ad7061328c45803699321aa9f5edb0ed2288a8d Signed-off-by: Patrick Georgi Original-Commit-Id: 78281a104fb9d79696a6ceb2a9a89a391146a424 Original-Change-Id: I56314b9dc9062dd61671982e7ec0ff15d7eb1bae Original-Signed-off-by: Patrick Georgi Original-Reviewed-on: https://chromium-review.googlesource.com/273609 Original-Reviewed-by: Stefan Reinauer Original-Tested-by: Patrick Georgi Original-Commit-Queue: Patrick Georgi Reviewed-on: http://review.coreboot.org/10691 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- src/mainboard/google/peppy/chromeos.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/mainboard/google/peppy/chromeos.c') diff --git a/src/mainboard/google/peppy/chromeos.c b/src/mainboard/google/peppy/chromeos.c index ef10c48997..cd2728ed92 100644 --- a/src/mainboard/google/peppy/chromeos.c +++ b/src/mainboard/google/peppy/chromeos.c @@ -34,17 +34,6 @@ #define GPIO_COUNT 6 -static int get_lid_switch(void) -{ -#if CONFIG_EC_GOOGLE_CHROMEEC - u8 ec_switches = inb(EC_LPC_ADDR_MEMMAP + EC_MEMMAP_SWITCHES); - - return !!(ec_switches & EC_SWITCH_LID_OPEN); -#else - return 0; -#endif -} - void fill_lb_gpios(struct lb_gpios *gpios) { struct lb_gpio *gpio; @@ -65,6 +54,17 @@ void fill_lb_gpios(struct lb_gpios *gpios) } #endif +int get_lid_switch(void) +{ +#if CONFIG_EC_GOOGLE_CHROMEEC + u8 ec_switches = inb(EC_LPC_ADDR_MEMMAP + EC_MEMMAP_SWITCHES); + + return !!(ec_switches & EC_SWITCH_LID_OPEN); +#else + return 0; +#endif +} + /* The dev-switch is virtual */ int get_developer_mode_switch(void) { -- cgit v1.2.3