aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc2/hcd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/dwc2/hcd.c')
-rw-r--r--drivers/usb/dwc2/hcd.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c
index 8667ddf3ca74..978232a9e4a8 100644
--- a/drivers/usb/dwc2/hcd.c
+++ b/drivers/usb/dwc2/hcd.c
@@ -4376,6 +4376,17 @@ static void dwc2_hcd_reset_func(struct work_struct *work)
4376 spin_unlock_irqrestore(&hsotg->lock, flags); 4376 spin_unlock_irqrestore(&hsotg->lock, flags);
4377} 4377}
4378 4378
4379static void dwc2_hcd_phy_reset_func(struct work_struct *work)
4380{
4381 struct dwc2_hsotg *hsotg = container_of(work, struct dwc2_hsotg,
4382 phy_reset_work);
4383 int ret;
4384
4385 ret = phy_reset(hsotg->phy);
4386 if (ret)
4387 dev_warn(hsotg->dev, "PHY reset failed\n");
4388}
4389
4379/* 4390/*
4380 * ========================================================================= 4391 * =========================================================================
4381 * Linux HC Driver Functions 4392 * Linux HC Driver Functions
@@ -5152,6 +5163,8 @@ static void dwc2_hcd_free(struct dwc2_hsotg *hsotg)
5152 destroy_workqueue(hsotg->wq_otg); 5163 destroy_workqueue(hsotg->wq_otg);
5153 } 5164 }
5154 5165
5166 cancel_work_sync(&hsotg->phy_reset_work);
5167
5155 del_timer(&hsotg->wkp_timer); 5168 del_timer(&hsotg->wkp_timer);
5156} 5169}
5157 5170
@@ -5293,11 +5306,10 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg)
5293 hsotg->hc_ptr_array[i] = channel; 5306 hsotg->hc_ptr_array[i] = channel;
5294 } 5307 }
5295 5308
5296 /* Initialize hsotg start work */ 5309 /* Initialize work */
5297 INIT_DELAYED_WORK(&hsotg->start_work, dwc2_hcd_start_func); 5310 INIT_DELAYED_WORK(&hsotg->start_work, dwc2_hcd_start_func);
5298
5299 /* Initialize port reset work */
5300 INIT_DELAYED_WORK(&hsotg->reset_work, dwc2_hcd_reset_func); 5311 INIT_DELAYED_WORK(&hsotg->reset_work, dwc2_hcd_reset_func);
5312 INIT_WORK(&hsotg->phy_reset_work, dwc2_hcd_phy_reset_func);
5301 5313
5302 /* 5314 /*
5303 * Allocate space for storing data on status transactions. Normally no 5315 * Allocate space for storing data on status transactions. Normally no