Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3ef7befa authored by Sriharsha Allenki's avatar Sriharsha Allenki Committed by Gerrit - the friendly Code Review server
Browse files

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: default avatarSriharsha Allenki <sallenki@codeaurora.org>
parent b56464c7
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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);