From 7b3d4391194bfbdfd343040c11bad376d84e11f6 Mon Sep 17 00:00:00 2001 From: Ajay Agarwal Date: Thu, 23 Nov 2017 22:00:00 +0530 Subject: platform: msm: Set USB speed to SUPER before calling notifier Currently we set the USB speed to SUPER after calling vbus/id notifier callback. As a part of cable connect, is USB speed is set to SUPER after connect resume_work is called, then we do not initialise the SSPHY. So clocks are OFF. But as part of cable disconnect, if USB speed is set to SUPER before disconnect resume_work is called, then we try to suspend SSPHY resulting in unclocked access. Fix this by mandatorily setting USB speed to SUPER before queuing VBUS/ID notifier. Change-Id: Iac4411ddafd87909b1b26c9b5a8eb354a073d268 Signed-off-by: Ajay Agarwal --- drivers/platform/msm/gpio-usbdetect.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/platform/msm/gpio-usbdetect.c b/drivers/platform/msm/gpio-usbdetect.c index adf47fc32548..1628253fb545 100644 --- a/drivers/platform/msm/gpio-usbdetect.c +++ b/drivers/platform/msm/gpio-usbdetect.c @@ -49,8 +49,8 @@ static irqreturn_t gpio_usbdetect_vbus_irq(int irq, void *data) usb->vbus_state = gpio_get_value(usb->gpio); if (usb->vbus_state) { dev_dbg(&usb->pdev->dev, "setting vbus notification\n"); - extcon_set_cable_state_(usb->extcon_dev, EXTCON_USB, 1); extcon_set_cable_state_(usb->extcon_dev, EXTCON_USB_SPEED, 1); + extcon_set_cable_state_(usb->extcon_dev, EXTCON_USB, 1); } else { dev_dbg(&usb->pdev->dev, "setting vbus removed notification\n"); extcon_set_cable_state_(usb->extcon_dev, EXTCON_USB, 0); @@ -85,8 +85,8 @@ static irqreturn_t gpio_usbdetect_id_irq_thread(int irq, void *data) } else { dev_dbg(&usb->pdev->dev, "starting usb HOST\n"); disable_irq(usb->vbus_det_irq); - extcon_set_cable_state_(usb->extcon_dev, EXTCON_USB_HOST, 1); extcon_set_cable_state_(usb->extcon_dev, EXTCON_USB_SPEED, 1); + extcon_set_cable_state_(usb->extcon_dev, EXTCON_USB_HOST, 1); } return IRQ_HANDLED; } -- cgit v1.2.3