From: Benoit Goby Date: Wed, 1 Sep 2010 00:40:25 +0000 (-0700) Subject: mfd: cpcap-whisper: Workaround for the enumeration issue X-Git-Tag: firefly_0821_release~9834^2~588 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=79c16b80a20ab70b16c542d51dfe4b1ef3db65b4;p=firefly-linux-kernel-4.4.55.git 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 --- 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);