Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

usb: cdns3: Add PHY mode switch to usb2 PHY

cdns3 just set PHY mode switch for USB3.0 PHY.
If USB 2.0 PHY contains PHY mode switch setting,
USB 2.0 PHY mode function can't be called.
So add PHY mode switch function for USB 2.0 PHY.

Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>
Link: https://lore.kernel.org/r/20230721095923.20445-1-minda.chen@starfivetech.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Minda Chen and committed by
Greg Kroah-Hartman
26910f97 3bd442e4

+4
+4
drivers/usb/cdns3/drd.c
··· 196 196 if (ret) 197 197 dev_err(cdns->dev, "timeout waiting for xhci_ready\n"); 198 198 199 + phy_set_mode(cdns->usb2_phy, PHY_MODE_USB_HOST); 199 200 phy_set_mode(cdns->usb3_phy, PHY_MODE_USB_HOST); 200 201 return ret; 201 202 } ··· 217 216 readl_poll_timeout_atomic(&cdns->otg_regs->state, val, 218 217 !(val & OTGSTATE_HOST_STATE_MASK), 219 218 1, 2000000); 219 + phy_set_mode(cdns->usb2_phy, PHY_MODE_INVALID); 220 220 phy_set_mode(cdns->usb3_phy, PHY_MODE_INVALID); 221 221 } 222 222 ··· 250 248 return ret; 251 249 } 252 250 251 + phy_set_mode(cdns->usb2_phy, PHY_MODE_USB_DEVICE); 253 252 phy_set_mode(cdns->usb3_phy, PHY_MODE_USB_DEVICE); 254 253 return 0; 255 254 } ··· 276 273 readl_poll_timeout_atomic(&cdns->otg_regs->state, val, 277 274 !(val & OTGSTATE_DEV_STATE_MASK), 278 275 1, 2000000); 276 + phy_set_mode(cdns->usb2_phy, PHY_MODE_INVALID); 279 277 phy_set_mode(cdns->usb3_phy, PHY_MODE_INVALID); 280 278 } 281 279 EXPORT_SYMBOL_GPL(cdns_drd_gadget_off);