summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVic Yang <victoryang@chromium.org>2013-06-20 18:20:42 +0800
committerChromeBot <chrome-bot@google.com>2013-06-21 11:50:47 -0700
commitf73c6d8ec7ec38957ec03a74a6d99161799138a4 (patch)
treea9da63e56303b3837b21e46d95da1c15426adce8
parent9a24fd348edf872f42d458bd60e4832532e48ef9 (diff)
downloadchrome-ec-f73c6d8ec7ec38957ec03a74a6d99161799138a4.tar.gz
spring: Avoid I2C transaction in interrupt context
When the device suspends with video dongle plugged in, the EC tries to turn off VFET output. However, the I2C command issued in interrupt context causes an assertion error. BUG=chrome-os-partner:20351 TEST=Plug in video dongle, and suspend. Wake the device up successfully. BRANCH=spring Change-Id: I135075e83ad0c40ecfdc9a1d8d7c2585a583a916 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/59406 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--common/extpower_usb.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/common/extpower_usb.c b/common/extpower_usb.c
index 5be7d2efc9..f14a1f86a6 100644
--- a/common/extpower_usb.c
+++ b/common/extpower_usb.c
@@ -99,6 +99,7 @@ static int pwm_fast_mode;
static int pending_tsu6721_reset;
static int pending_adc_watchdog_disable;
static int pending_dev_type_update;
+static int pending_video_power_off;
static int restore_id_mux;
static enum {
@@ -656,6 +657,11 @@ void extpower_charge_update(int force_update)
pending_adc_watchdog_disable = 0;
}
+ if (pending_video_power_off) {
+ set_video_power(0);
+ pending_video_power_off = 0;
+ }
+
if (pending_tsu6721_reset) {
tsu6721_reset();
force_update = 1;
@@ -784,7 +790,7 @@ static void usb_detach_video(void)
{
if (!(current_dev_type & TSU6721_TYPE_JIG_UART_ON))
return;
- set_video_power(0);
+ pending_video_power_off = 1;
restore_id_mux = 1;
pending_tsu6721_reset = 1;
task_wake(TASK_ID_CHARGER);