From 3c1b2b757546c022d0ae0eb22e3db9feb41055c4 Mon Sep 17 00:00:00 2001 From: Vic Yang Date: Sat, 22 Jun 2013 01:14:43 +0800 Subject: spring: Wait 80ms for CABLE_DET to be asserted From our measurement, it takes ~80ms for CABLE_DET to be asserted. Let's wait for that long before giving up and declare it an USB host. BUG=chrome-os-partner:20405 TEST=Manual BRANCH=Spring Change-Id: I71568ed8011f9b3f2c9c2ee67aea3c771a5dbf37 Signed-off-by: Vic Yang Reviewed-on: https://gerrit.chromium.org/gerrit/59566 --- board/spring/usb_charging.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/board/spring/usb_charging.c b/board/spring/usb_charging.c index 21624a2fcc..8c49064006 100644 --- a/board/spring/usb_charging.c +++ b/board/spring/usb_charging.c @@ -78,6 +78,7 @@ #define DELAY_POWER_MS 20 #define DELAY_USB_DP_DN_MS 20 #define DELAY_ID_MUX_MS 30 +#define DELAY_CABLE_DET_MS 80 static int current_dev_type = TSU6721_TYPE_NONE; static int nominal_pwm_duty; @@ -268,7 +269,7 @@ static int board_probe_video(int device_type) { tsu6721_disable_interrupts(); gpio_set_level(GPIO_ID_MUX, 1); - msleep(DELAY_ID_MUX_MS); + msleep(DELAY_ID_MUX_MS + DELAY_CABLE_DET_MS); if (adc_read_channel(ADC_CH_USB_DP_SNS) < VIDEO_ID_THRESHOLD) { if (device_type & TSU6721_TYPE_VBUS_DEBOUNCED) { -- cgit v1.2.1