diff options
Diffstat (limited to 'drivers/usb/core/hcd.c')
-rw-r--r-- | drivers/usb/core/hcd.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 777036ae6367..0a42c5df3c0f 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c | |||
@@ -2262,7 +2262,8 @@ int hcd_bus_suspend(struct usb_device *rhdev, pm_message_t msg) | |||
2262 | hcd->state = HC_STATE_SUSPENDED; | 2262 | hcd->state = HC_STATE_SUSPENDED; |
2263 | 2263 | ||
2264 | if (!PMSG_IS_AUTO(msg)) | 2264 | if (!PMSG_IS_AUTO(msg)) |
2265 | usb_phy_roothub_power_off(hcd->phy_roothub); | 2265 | usb_phy_roothub_suspend(hcd->self.sysdev, |
2266 | hcd->phy_roothub); | ||
2266 | 2267 | ||
2267 | /* Did we race with a root-hub wakeup event? */ | 2268 | /* Did we race with a root-hub wakeup event? */ |
2268 | if (rhdev->do_remote_wakeup) { | 2269 | if (rhdev->do_remote_wakeup) { |
@@ -2302,7 +2303,8 @@ int hcd_bus_resume(struct usb_device *rhdev, pm_message_t msg) | |||
2302 | } | 2303 | } |
2303 | 2304 | ||
2304 | if (!PMSG_IS_AUTO(msg)) { | 2305 | if (!PMSG_IS_AUTO(msg)) { |
2305 | status = usb_phy_roothub_power_on(hcd->phy_roothub); | 2306 | status = usb_phy_roothub_resume(hcd->self.sysdev, |
2307 | hcd->phy_roothub); | ||
2306 | if (status) | 2308 | if (status) |
2307 | return status; | 2309 | return status; |
2308 | } | 2310 | } |
@@ -2344,7 +2346,7 @@ int hcd_bus_resume(struct usb_device *rhdev, pm_message_t msg) | |||
2344 | } | 2346 | } |
2345 | } else { | 2347 | } else { |
2346 | hcd->state = old_state; | 2348 | hcd->state = old_state; |
2347 | usb_phy_roothub_power_off(hcd->phy_roothub); | 2349 | usb_phy_roothub_suspend(hcd->self.sysdev, hcd->phy_roothub); |
2348 | dev_dbg(&rhdev->dev, "bus %s fail, err %d\n", | 2350 | dev_dbg(&rhdev->dev, "bus %s fail, err %d\n", |
2349 | "resume", status); | 2351 | "resume", status); |
2350 | if (status != -ESHUTDOWN) | 2352 | if (status != -ESHUTDOWN) |
@@ -2377,6 +2379,7 @@ void usb_hcd_resume_root_hub (struct usb_hcd *hcd) | |||
2377 | 2379 | ||
2378 | spin_lock_irqsave (&hcd_root_hub_lock, flags); | 2380 | spin_lock_irqsave (&hcd_root_hub_lock, flags); |
2379 | if (hcd->rh_registered) { | 2381 | if (hcd->rh_registered) { |
2382 | pm_wakeup_event(&hcd->self.root_hub->dev, 0); | ||
2380 | set_bit(HCD_FLAG_WAKEUP_PENDING, &hcd->flags); | 2383 | set_bit(HCD_FLAG_WAKEUP_PENDING, &hcd->flags); |
2381 | queue_work(pm_wq, &hcd->wakeup_work); | 2384 | queue_work(pm_wq, &hcd->wakeup_work); |
2382 | } | 2385 | } |
@@ -2758,12 +2761,16 @@ int usb_add_hcd(struct usb_hcd *hcd, | |||
2758 | } | 2761 | } |
2759 | 2762 | ||
2760 | if (!hcd->skip_phy_initialization && usb_hcd_is_primary_hcd(hcd)) { | 2763 | if (!hcd->skip_phy_initialization && usb_hcd_is_primary_hcd(hcd)) { |
2761 | hcd->phy_roothub = usb_phy_roothub_init(hcd->self.sysdev); | 2764 | hcd->phy_roothub = usb_phy_roothub_alloc(hcd->self.sysdev); |
2762 | if (IS_ERR(hcd->phy_roothub)) { | 2765 | if (IS_ERR(hcd->phy_roothub)) { |
2763 | retval = PTR_ERR(hcd->phy_roothub); | 2766 | retval = PTR_ERR(hcd->phy_roothub); |
2764 | goto err_phy_roothub_init; | 2767 | goto err_phy_roothub_alloc; |
2765 | } | 2768 | } |
2766 | 2769 | ||
2770 | retval = usb_phy_roothub_init(hcd->phy_roothub); | ||
2771 | if (retval) | ||
2772 | goto err_phy_roothub_alloc; | ||
2773 | |||
2767 | retval = usb_phy_roothub_power_on(hcd->phy_roothub); | 2774 | retval = usb_phy_roothub_power_on(hcd->phy_roothub); |
2768 | if (retval) | 2775 | if (retval) |
2769 | goto err_usb_phy_roothub_power_on; | 2776 | goto err_usb_phy_roothub_power_on; |
@@ -2936,7 +2943,7 @@ err_create_buf: | |||
2936 | usb_phy_roothub_power_off(hcd->phy_roothub); | 2943 | usb_phy_roothub_power_off(hcd->phy_roothub); |
2937 | err_usb_phy_roothub_power_on: | 2944 | err_usb_phy_roothub_power_on: |
2938 | usb_phy_roothub_exit(hcd->phy_roothub); | 2945 | usb_phy_roothub_exit(hcd->phy_roothub); |
2939 | err_phy_roothub_init: | 2946 | err_phy_roothub_alloc: |
2940 | if (hcd->remove_phy && hcd->usb_phy) { | 2947 | if (hcd->remove_phy && hcd->usb_phy) { |
2941 | usb_phy_shutdown(hcd->usb_phy); | 2948 | usb_phy_shutdown(hcd->usb_phy); |
2942 | usb_put_phy(hcd->usb_phy); | 2949 | usb_put_phy(hcd->usb_phy); |