summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Broch <tbroch@chromium.org>2013-04-03 11:14:58 -0700
committerChromeBot <chrome-bot@google.com>2013-04-05 13:10:01 -0700
commit04dda51290ed5f2a2a1ea8a00c315221936eb252 (patch)
tree0f5703ad635fa6e9a84fd0a0d038e204ed435be2
parent1b68fd9680816e42b52c525a5fa3ee1ca8a10228 (diff)
downloadchrome-ec-04dda51290ed5f2a2a1ea8a00c315221936eb252.tar.gz
Inhibit host interrupt for battery_key.
Battery key is used to signal to the host that USB charging status has changed. This virtual keystroke should not wake the device like physical keystroke does. Signed-off-by: Todd Broch <tbroch@chromium.org> BRANCH=spring BUG=chrome-os-partner:18333 TEST=manual, Scenario1: suspend device then plug/unplug USB charging. Device doesn't wake. When resume 'cat /sys/class/power_supply/cros_ec-charger/online' is correct. Scenario2: while true ; do cat /sys/class/power_supply/cros_ec-charger/online done plug/unplug USB charging and device online status changes in a timely manner Change-Id: If37c1d3195ab6eb1e3f13daaaf7b9a3ef452d893 Original-Change-Id: I8938798b30e70c0c5021405d4fc5da9ce398c311 Reviewed-on: https://gerrit.chromium.org/gerrit/47251 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Tested-by: Todd Broch <tbroch@chromium.org> Commit-Queue: Todd Broch <tbroch@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/47425 Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Todd Broch <tbroch@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--chip/stm32/keyboard_scan.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/chip/stm32/keyboard_scan.c b/chip/stm32/keyboard_scan.c
index 1e7298e3e7..03ae1e790c 100644
--- a/chip/stm32/keyboard_scan.c
+++ b/chip/stm32/keyboard_scan.c
@@ -11,6 +11,7 @@
#include "atomic.h"
#include "board.h"
+#include "chipset.h"
#include "console.h"
#include "gpio.h"
#include "host_command.h"
@@ -689,7 +690,9 @@ void keyboard_send_battery_key()
{
mutex_lock(&scanning_enabled);
debounced_state[BATTERY_KEY_COL] ^= BATTERY_KEY_ROW_MASK;
- if (kb_fifo_add(debounced_state) == EC_SUCCESS)
+ /* Add to FIFO only if AP is on or else it will wake from suspend */
+ if ((chipset_in_state(CHIPSET_STATE_ON)) &&
+ kb_fifo_add(debounced_state) == EC_SUCCESS)
board_interrupt_host(1);
else
CPRINTF("dropped battery keystroke\n");