mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
usb: dwc2: keep phy power on if current mode is host during probe
The commite6f2f6d63e("usb: dwc2: power on/off phy for otg mode") aimed to control phy power for otg mode, but it also introduced a new problem, so we fix it. This patch keep phy power on for otg if current mode is host during dwc2 probe, otherwise the enumeration will fail with the following error log: Cannot enable. Maybe the USB cable is bad? Cannot enable. Maybe the USB cable is bad? attempt power cycle Cannot enable. Maybe the USB cable is bad? Cannot enable. Maybe the USB cable is bad? unable to enumerate USB device Fixes:e6f2f6d63e("usb: dwc2: power on/off phy for otg mode") Change-Id: I17a4cab6f0337fdc0923989aea8613bfbe1a9e9b Signed-off-by: Feng Mingli <fml@rock-chips.com>
This commit is contained in:
@@ -3469,7 +3469,7 @@ static int dwc2_hsotg_udc_start(struct usb_gadget *gadget,
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (hsotg->dr_mode == USB_DR_MODE_OTG) {
|
||||
if (hsotg->dr_mode == USB_DR_MODE_OTG && dwc2_is_device_mode(hsotg)) {
|
||||
struct platform_device *pdev = to_platform_device(hsotg->dev);
|
||||
|
||||
if (hsotg->uphy) {
|
||||
@@ -3546,7 +3546,7 @@ static int dwc2_hsotg_udc_stop(struct usb_gadget *gadget)
|
||||
if (hsotg->dr_mode == USB_DR_MODE_PERIPHERAL)
|
||||
dwc2_lowlevel_hw_disable(hsotg);
|
||||
|
||||
if (hsotg->dr_mode == USB_DR_MODE_OTG) {
|
||||
if (hsotg->dr_mode == USB_DR_MODE_OTG && dwc2_is_device_mode(hsotg)) {
|
||||
struct platform_device *pdev = to_platform_device(hsotg->dev);
|
||||
|
||||
if (hsotg->uphy) {
|
||||
|
||||
@@ -662,7 +662,7 @@ static int dwc2_driver_probe(struct platform_device *dev)
|
||||
if (hsotg->dr_mode == USB_DR_MODE_PERIPHERAL)
|
||||
dwc2_lowlevel_hw_disable(hsotg);
|
||||
|
||||
if (hsotg->dr_mode == USB_DR_MODE_OTG) {
|
||||
if (hsotg->dr_mode == USB_DR_MODE_OTG && dwc2_is_device_mode(hsotg)) {
|
||||
struct platform_device *pdev = to_platform_device(hsotg->dev);
|
||||
|
||||
if (hsotg->uphy) {
|
||||
|
||||
Reference in New Issue
Block a user