diff options
author | Randall Spangler <rspangler@chromium.org> | 2013-10-01 10:34:59 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2013-10-02 01:24:40 +0000 |
commit | 0f1f1229b9062376e706509d5a04d237253fbb47 (patch) | |
tree | 34e4a8f9f61d81fec7edfe21f7c92ddf5c5875c2 /board | |
parent | 159867844af5c1860c5b6f49f61f8b9893f57c64 (diff) | |
download | chrome-ec-0f1f1229b9062376e706509d5a04d237253fbb47.tar.gz |
lpc: Clean up processing wake events
Every board other than link does the same thing - filter out the power
button event, then set the WAKE_L gpio level based on the remaining
events. This code doesn't need to be duplicated 7 times, so make it common.
Link didn't filter out the power button wake signal, but works fine
with the common implementation. Like the other boards it gets a power
button wake event via the dedicated PCH PWRBTN# signal.
BUG=chrome-os-partner:18343
BRANCH=none
TEST=suspend link, then wake using power button press
compile all platforms; pass unit tests
Change-Id: Ib3a6d310d0f5e337374b3c331ab2872fe377bdf6
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/171405
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Diffstat (limited to 'board')
-rw-r--r-- | board/bolt/board.c | 17 | ||||
-rw-r--r-- | board/falco/board.c | 17 | ||||
-rw-r--r-- | board/link/board.c | 12 | ||||
-rw-r--r-- | board/peppy/board.c | 17 | ||||
-rw-r--r-- | board/rambi/board.c | 17 | ||||
-rw-r--r-- | board/samus/board.c | 17 | ||||
-rw-r--r-- | board/slippy/board.c | 17 |
7 files changed, 0 insertions, 114 deletions
diff --git a/board/bolt/board.c b/board/bolt/board.c index bf59da6254..1de956c096 100644 --- a/board/bolt/board.c +++ b/board/bolt/board.c @@ -228,20 +228,3 @@ struct keyboard_scan_config keyscan_config = { 0xa4, 0xff, 0xf6, 0x55, 0xfa, 0xc8 /* full set */ }, }; - -/** - * Perform necessary actions on host wake events. - */ -void board_process_wake_events(uint32_t active_wake_events) -{ - uint32_t power_button_mask; - - power_button_mask = EC_HOST_EVENT_MASK(EC_HOST_EVENT_POWER_BUTTON); - - /* If there are other events aside from the power button press drive - * the wake pin. Otherwise ensure it is high. */ - if (active_wake_events & ~power_button_mask) - gpio_set_level(GPIO_PCH_WAKE_L, 0); - else - gpio_set_level(GPIO_PCH_WAKE_L, 1); -} diff --git a/board/falco/board.c b/board/falco/board.c index f682a8c11c..e60acb71d2 100644 --- a/board/falco/board.c +++ b/board/falco/board.c @@ -237,23 +237,6 @@ struct keyboard_scan_config keyscan_config = { }; /** - * Perform necessary actions on host wake events. - */ -void board_process_wake_events(uint32_t active_wake_events) -{ - uint32_t power_button_mask; - - power_button_mask = EC_HOST_EVENT_MASK(EC_HOST_EVENT_POWER_BUTTON); - - /* If there are other events aside from the power button press drive - * the wake pin. Otherwise ensure it is high. */ - if (active_wake_events & ~power_button_mask) - gpio_set_level(GPIO_PCH_WAKE_L, 0); - else - gpio_set_level(GPIO_PCH_WAKE_L, 1); -} - -/** * Discharge battery when on AC power for factory test. */ int board_discharge_on_ac(int enable) diff --git a/board/link/board.c b/board/link/board.c index 1207e63e0a..67284f2471 100644 --- a/board/link/board.c +++ b/board/link/board.c @@ -261,15 +261,3 @@ struct keyboard_scan_config keyscan_config = { 0xa4, 0xff, 0xf6, 0x55, 0xfa, 0xc8 /* full set */ }, }; - -/** - * Perform necessary actions on host events. - */ -void board_process_wake_events(uint32_t active_wake_events) -{ - /* Update level-sensitive wake signal */ - if (active_wake_events) - gpio_set_level(GPIO_PCH_WAKE_L, 0); - else - gpio_set_level(GPIO_PCH_WAKE_L, 1); -} diff --git a/board/peppy/board.c b/board/peppy/board.c index 8018b158e5..5092357f01 100644 --- a/board/peppy/board.c +++ b/board/peppy/board.c @@ -228,23 +228,6 @@ struct keyboard_scan_config keyscan_config = { }; /** - * Perform necessary actions on host wake events. - */ -void board_process_wake_events(uint32_t active_wake_events) -{ - uint32_t power_button_mask; - - power_button_mask = EC_HOST_EVENT_MASK(EC_HOST_EVENT_POWER_BUTTON); - - /* If there are other events aside from the power button press drive - * the wake pin. Otherwise ensure it is high. */ - if (active_wake_events & ~power_button_mask) - gpio_set_level(GPIO_PCH_WAKE_L, 0); - else - gpio_set_level(GPIO_PCH_WAKE_L, 1); -} - -/** * Discharge battery when on AC power for factory test. */ int board_discharge_on_ac(int enable) diff --git a/board/rambi/board.c b/board/rambi/board.c index 93d04940a7..6c451ebaea 100644 --- a/board/rambi/board.c +++ b/board/rambi/board.c @@ -186,20 +186,3 @@ struct ec_thermal_config thermal_params[] = { {{0, 0, 0}, 0, 0}, }; BUILD_ASSERT(ARRAY_SIZE(thermal_params) == TEMP_SENSOR_COUNT); - -/** - * Perform necessary actions on host wake events. - */ -void board_process_wake_events(uint32_t active_wake_events) -{ - uint32_t power_button_mask; - - power_button_mask = EC_HOST_EVENT_MASK(EC_HOST_EVENT_POWER_BUTTON); - - /* If there are other events aside from the power button press drive - * the wake pin. Otherwise ensure it is high. */ - if (active_wake_events & ~power_button_mask) - gpio_set_level(GPIO_PCH_WAKE_L, 0); - else - gpio_set_level(GPIO_PCH_WAKE_L, 1); -} diff --git a/board/samus/board.c b/board/samus/board.c index 6e1eeee9a3..219cd6abf7 100644 --- a/board/samus/board.c +++ b/board/samus/board.c @@ -228,20 +228,3 @@ struct keyboard_scan_config keyscan_config = { 0xa4, 0xff, 0xf6, 0x55, 0xfa, 0xc8 /* full set */ }, }; - -/** - * Perform necessary actions on host wake events. - */ -void board_process_wake_events(uint32_t active_wake_events) -{ - uint32_t power_button_mask; - - power_button_mask = EC_HOST_EVENT_MASK(EC_HOST_EVENT_POWER_BUTTON); - - /* If there are other events aside from the power button press drive - * the wake pin. Otherwise ensure it is high. */ - if (active_wake_events & ~power_button_mask) - gpio_set_level(GPIO_PCH_WAKE_L, 0); - else - gpio_set_level(GPIO_PCH_WAKE_L, 1); -} diff --git a/board/slippy/board.c b/board/slippy/board.c index 60851ceca9..bf8ec43dda 100644 --- a/board/slippy/board.c +++ b/board/slippy/board.c @@ -226,23 +226,6 @@ struct keyboard_scan_config keyscan_config = { }; /** - * Perform necessary actions on host wake events. - */ -void board_process_wake_events(uint32_t active_wake_events) -{ - uint32_t power_button_mask; - - power_button_mask = EC_HOST_EVENT_MASK(EC_HOST_EVENT_POWER_BUTTON); - - /* If there are other events aside from the power button press drive - * the wake pin. Otherwise ensure it is high. */ - if (active_wake_events & ~power_button_mask) - gpio_set_level(GPIO_PCH_WAKE_L, 0); - else - gpio_set_level(GPIO_PCH_WAKE_L, 1); -} - -/** * Discharge battery when on AC power for factory test. */ int board_discharge_on_ac(int enable) |