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>
This commit is contained in:
Todd Broch
2013-04-03 11:14:58 -07:00
committed by ChromeBot
parent 6d49e2660e
commit af4d0fb297

View File

@@ -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);
}
/*****************************************************************************/