From 79c16b80a20ab70b16c542d51dfe4b1ef3db65b4 Mon Sep 17 00:00:00 2001 From: Benoit Goby Date: Tue, 31 Aug 2010 17:40:25 -0700 Subject: [PATCH] mfd: cpcap-whisper: Workaround for the enumeration issue The Tegra root hub sometines does not enumarate the device when the OTG cable is first inserted. Delaying the activation of vbus, to leave time for the controller to initialize seems to fix the problem. Change-Id: I2c374a98b2931bc724efb1678fad4fbb873b2a3b Signed-off-by: Benoit Goby --- drivers/mfd/cpcap-whisper.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/mfd/cpcap-whisper.c b/drivers/mfd/cpcap-whisper.c index 8fea1fa75252..64c0bec0a730 100644 --- a/drivers/mfd/cpcap-whisper.c +++ b/drivers/mfd/cpcap-whisper.c @@ -76,6 +76,7 @@ enum cpcap_det_state { IDENTIFY, IDENTIFY_WHISPER, USB, + USB_POWER, WHISPER, WHISPER_SMART, }; @@ -241,7 +242,6 @@ static int configure_hardware(struct cpcap_whisper_data *data, case CPCAP_ACCY_USB_HOST: retval |= cpcap_regacc_write(data->cpcap, CPCAP_REG_USBC1, 0, CPCAP_BIT_VBUSPD); - gpio_set_value(data->pdata->pwr_gpio, 1); gpio_set_value(data->pdata->data_gpio, 1); if (data->otg) blocking_notifier_call_chain(&data->otg->notifier, @@ -419,6 +419,9 @@ static void whisper_det_work(struct work_struct *work) whisper_notify(data, CPCAP_ACCY_USB_HOST); cpcap_irq_unmask(data->cpcap, CPCAP_IRQ_IDFLOAT); + data->state = USB_POWER; + schedule_delayed_work(&data->work, + msecs_to_jiffies(200)); } else if ((data->sense == SENSE_WHISPER_SPD) || (data->sense == SENSE_WHISPER_PPD)) { gpio_set_value(data->pdata->pwr_gpio, 1); @@ -490,6 +493,11 @@ static void whisper_det_work(struct work_struct *work) break; + case USB_POWER: + gpio_set_value(data->pdata->pwr_gpio, 1); + data->state = CONFIG; + break; + case WHISPER: get_sense(data); -- 2.34.1