summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAjay Agarwal <ajaya@codeaurora.org>2017-11-23 22:00:00 +0530
committerAjay Agarwal <ajaya@codeaurora.org>2017-11-24 11:28:52 +0530
commit7b3d4391194bfbdfd343040c11bad376d84e11f6 (patch)
tree932d2583a48d28ebef405b38805f907e4dc7b6ed
parentf697ab3e511d5aa651e0ce53410117e3f13d6213 (diff)
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 <ajaya@codeaurora.org>
-rw-r--r--drivers/platform/msm/gpio-usbdetect.c4
1 files 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;
}