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-04 16:32:20 -0700
commitaf4d0fb2976f5d5e9104366f4c525010cfc7489b (patch)
tree7f4f8a1f4f8d52bb766afd09cf766cc207fecbe5
parent6d49e2660ef679b4811b4b93ef11de9be2c21389 (diff)
downloadchrome-ec-af4d0fb2976f5d5e9104366f4c525010cfc7489b.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. Change still copies keystroke to the keyboard fifo but bypasses sending host interrupt. 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: 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>
-rw-r--r--common/keyboard_mkbp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/common/keyboard_mkbp.c b/common/keyboard_mkbp.c
index 336fd7e0be..3b4a44b76b 100644
--- a/common/keyboard_mkbp.c
+++ b/common/keyboard_mkbp.c
@@ -152,8 +152,9 @@ void keyboard_send_battery_key(void)
memcpy(state, keyboard_scan_get_state(), sizeof(state));
state[BATTERY_KEY_COL] ^= BATTERY_KEY_ROW_MASK;
- /* Add to FIFO */
- keyboard_fifo_add(state);
+ /* Add to FIFO only if AP is on or else it will wake from suspend */
+ if (chipset_in_state(CHIPSET_STATE_ON))
+ keyboard_fifo_add(state);
}
/*****************************************************************************/