summaryrefslogtreecommitdiff
path: root/drivers/platform/msm
diff options
context:
space:
mode:
authorSriharsha Allenki <sallenki@codeaurora.org>2017-09-26 18:09:32 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2017-09-26 12:09:44 -0700
commit3ef7befadd2ce581a9fc07236c324dcb5110b7d0 (patch)
treeefb5148f91678e15699f4d04c436dce26b7f88bc /drivers/platform/msm
parentb56464c7cb37be7ddd498ccff8cc11124cea39e6 (diff)
platform: msm: Check USB ID state on probe
If the device is booted up with OTG cable connected, the device does not switch to host mode. The trigger is lost because the irqs are enabled at a later time. Fix this by checking the ID state during probe. CRs-Fixed: 2106351 Change-Id: I742d0839832219e757348e102252f97d95a8335b Signed-off-by: Sriharsha Allenki <sallenki@codeaurora.org>
Diffstat (limited to 'drivers/platform/msm')
-rw-r--r--drivers/platform/msm/gpio-usbdetect.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/platform/msm/gpio-usbdetect.c b/drivers/platform/msm/gpio-usbdetect.c
index dc05d7108135..26ebdfd158b5 100644
--- a/drivers/platform/msm/gpio-usbdetect.c
+++ b/drivers/platform/msm/gpio-usbdetect.c
@@ -186,6 +186,14 @@ static int gpio_usbdetect_probe(struct platform_device *pdev)
enable_irq_wake(usb->id_det_irq);
dev_set_drvdata(&pdev->dev, usb);
+ if (usb->id_det_irq) {
+ gpio_usbdetect_id_irq(usb->id_det_irq, usb);
+ if (!usb->id_state) {
+ gpio_usbdetect_id_irq_thread(usb->id_det_irq, usb);
+ return 0;
+ }
+ }
+
/* Read and report initial VBUS state */
gpio_usbdetect_vbus_irq(usb->vbus_det_irq, usb);