mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
usb: dwc3: rockchip-inno: rework the disconnect workflow
This patch doesn't fix any issue but make the code more concise. Change-Id: I56d9d0e5f13579d2087edc41ca83bdb00e1ebb3f Signed-off-by: William Wu <william.wu@rock-chips.com>
This commit is contained in:
@@ -258,16 +258,12 @@ static void u3phy_disconnect_det_work(struct work_struct *work)
|
|||||||
struct dwc3_rockchip *rockchip =
|
struct dwc3_rockchip *rockchip =
|
||||||
container_of(work, struct dwc3_rockchip, u3_work);
|
container_of(work, struct dwc3_rockchip, u3_work);
|
||||||
struct usb_hcd *hcd = dev_get_drvdata(&rockchip->dwc->xhci->dev);
|
struct usb_hcd *hcd = dev_get_drvdata(&rockchip->dwc->xhci->dev);
|
||||||
struct usb_hcd *shared_hcd = hcd->shared_hcd;
|
|
||||||
struct xhci_hcd *xhci = hcd_to_xhci(hcd);
|
|
||||||
u32 count = 0;
|
u32 count = 0;
|
||||||
|
|
||||||
mutex_lock(&rockchip->lock);
|
mutex_lock(&rockchip->lock);
|
||||||
|
|
||||||
if (hcd->state != HC_STATE_HALT) {
|
if (hcd->state != HC_STATE_HALT)
|
||||||
usb_remove_hcd(shared_hcd);
|
dwc3_host_exit(rockchip->dwc);
|
||||||
usb_remove_hcd(hcd);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (rockchip->phy)
|
if (rockchip->phy)
|
||||||
usb_phy_shutdown(rockchip->phy);
|
usb_phy_shutdown(rockchip->phy);
|
||||||
@@ -281,11 +277,8 @@ static void u3phy_disconnect_det_work(struct work_struct *work)
|
|||||||
usleep_range(1000, 1100);
|
usleep_range(1000, 1100);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hcd->state == HC_STATE_HALT) {
|
if (hcd->state == HC_STATE_HALT)
|
||||||
xhci->shared_hcd = shared_hcd;
|
dwc3_host_init(rockchip->dwc);
|
||||||
usb_add_hcd(hcd, hcd->irq, IRQF_SHARED);
|
|
||||||
usb_add_hcd(shared_hcd, hcd->irq, IRQF_SHARED);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (rockchip->phy)
|
if (rockchip->phy)
|
||||||
usb_phy_init(rockchip->phy);
|
usb_phy_init(rockchip->phy);
|
||||||
|
|||||||
Reference in New Issue
Block a user