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

Commit 7b3d4391 authored by Ajay Agarwal's avatar Ajay Agarwal
Browse files

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: default avatarAjay Agarwal <ajaya@codeaurora.org>
parent f697ab3e
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -49,8 +49,8 @@ static irqreturn_t gpio_usbdetect_vbus_irq(int irq, void *data)
	usb->vbus_state = gpio_get_value(usb->gpio);
	usb->vbus_state = gpio_get_value(usb->gpio);
	if (usb->vbus_state) {
	if (usb->vbus_state) {
		dev_dbg(&usb->pdev->dev, "setting vbus notification\n");
		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_SPEED, 1);
		extcon_set_cable_state_(usb->extcon_dev, EXTCON_USB, 1);
	} else {
	} else {
		dev_dbg(&usb->pdev->dev, "setting vbus removed notification\n");
		dev_dbg(&usb->pdev->dev, "setting vbus removed notification\n");
		extcon_set_cable_state_(usb->extcon_dev, EXTCON_USB, 0);
		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 {
	} else {
		dev_dbg(&usb->pdev->dev, "starting usb HOST\n");
		dev_dbg(&usb->pdev->dev, "starting usb HOST\n");
		disable_irq(usb->vbus_det_irq);
		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_SPEED, 1);
		extcon_set_cable_state_(usb->extcon_dev, EXTCON_USB_HOST, 1);
	}
	}
	return IRQ_HANDLED;
	return IRQ_HANDLED;
}
}