Loading drivers/usb/dwc3/core.c +5 −4 Original line number Diff line number Diff line Loading @@ -116,7 +116,6 @@ static void dwc3_core_soft_reset(struct dwc3 *dwc) usb_phy_init(dwc->usb2_phy); usb_phy_init(dwc->usb3_phy); if (dwc->revision >= DWC3_REVISION_230A) dwc3_notify_event(dwc, DWC3_CONTROLLER_RESET_EVENT); /* Assert USB3 PHY reset */ Loading Loading @@ -148,7 +147,6 @@ static void dwc3_core_soft_reset(struct dwc3 *dwc) reg &= ~DWC3_GCTL_CORESOFTRESET; dwc3_writel(dwc->regs, DWC3_GCTL, reg); if (dwc->revision >= DWC3_REVISION_230A) dwc3_notify_event(dwc, DWC3_CONTROLLER_POST_RESET_EVENT); } Loading Loading @@ -455,6 +453,7 @@ void dwc3_post_host_reset_core_init(struct dwc3 *dwc) { dwc3_core_init(dwc); dwc3_gadget_restart(dwc); dwc3_notify_event(dwc, DWC3_CONTROLLER_POST_INITIALIZATION_EVENT); } static void (*notify_event) (struct dwc3 *, unsigned); Loading Loading @@ -709,6 +708,8 @@ static int dwc3_probe(struct platform_device *pdev) goto err3; } dwc3_notify_event(dwc, DWC3_CONTROLLER_POST_INITIALIZATION_EVENT); return 0; err3: Loading drivers/usb/dwc3/core.h +1 −0 Original line number Diff line number Diff line Loading @@ -663,6 +663,7 @@ struct dwc3_scratchpad_array { #define DWC3_CORE_PM_COMPLETE_EVENT 4 #define DWC3_CORE_PM_SUSPEND_EVENT 5 #define DWC3_CORE_PM_RESUME_EVENT 6 #define DWC3_CONTROLLER_POST_INITIALIZATION_EVENT 7 /** * struct dwc3 - representation of our controller * @ctrl_req: usb control request which is used for ep0 Loading drivers/usb/dwc3/dwc3-msm.c +5 −0 Original line number Diff line number Diff line Loading @@ -1185,6 +1185,9 @@ static void dwc3_msm_notify_event(struct dwc3 *dwc, unsigned event) { struct dwc3_msm *mdwc = dev_get_drvdata(dwc->dev->parent); if (dwc->revision < DWC3_REVISION_230A) return; switch (event) { case DWC3_CONTROLLER_ERROR_EVENT: dev_info(mdwc->dev, "DWC3_CONTROLLER_ERROR_EVENT received\n"); Loading @@ -1208,6 +1211,8 @@ static void dwc3_msm_notify_event(struct dwc3 *dwc, unsigned event) dwc3_msm_restore_sec_config(mdwc->scm_dev_id); dwc->tx_fifo_size = mdwc->tx_fifo_size; break; case DWC3_CONTROLLER_POST_INITIALIZATION_EVENT: usb_phy_post_init(mdwc->ss_phy); default: dev_dbg(mdwc->dev, "unknown dwc3 event\n"); break; Loading drivers/usb/phy/phy-msm-ssusb.c +14 −0 Original line number Diff line number Diff line Loading @@ -299,6 +299,19 @@ static int msm_ssphy_set_params(struct usb_phy *uphy) return 0; } static int msm_ssphy_post_init(struct usb_phy *uphy) { struct msm_ssphy *phy = container_of(uphy, struct msm_ssphy, phy); u32 val; /* read initial value */ val = readl_relaxed(phy->base + SS_PHY_CTRL_REG); val &= ~LANE0_PWR_PRESENT; writel_relaxed(val, phy->base + SS_PHY_CTRL_REG); return 0; } static int msm_ssphy_set_suspend(struct usb_phy *uphy, int suspend) { struct msm_ssphy *phy = container_of(uphy, struct msm_ssphy, phy); Loading Loading @@ -458,6 +471,7 @@ static int msm_ssphy_probe(struct platform_device *pdev) phy->phy.init = msm_ssphy_init; phy->phy.set_suspend = msm_ssphy_set_suspend; phy->phy.set_params = msm_ssphy_set_params; phy->phy.post_init = msm_ssphy_post_init; phy->phy.notify_connect = msm_ssphy_notify_connect; phy->phy.notify_disconnect = msm_ssphy_notify_disconnect; phy->phy.type = USB_PHY_TYPE_USB3; Loading include/linux/usb/phy.h +12 −0 Original line number Diff line number Diff line Loading @@ -106,6 +106,9 @@ struct usb_phy { /* set additional settings parameters post-init */ int (*set_params)(struct usb_phy *x); /* do additional settings after complete initialization */ int (*post_init)(struct usb_phy *x); /* effective for B devices, ignored for A-peripheral */ int (*set_power)(struct usb_phy *x, unsigned mA); Loading Loading @@ -202,6 +205,15 @@ usb_phy_set_params(struct usb_phy *x) return 0; } static inline int usb_phy_post_init(struct usb_phy *x) { if (x && x->post_init) return x->post_init(x); return 0; } /* for usb host and peripheral controller drivers */ #if IS_ENABLED(CONFIG_USB_PHY) extern struct usb_phy *usb_get_phy(enum usb_phy_type type); Loading Loading
drivers/usb/dwc3/core.c +5 −4 Original line number Diff line number Diff line Loading @@ -116,7 +116,6 @@ static void dwc3_core_soft_reset(struct dwc3 *dwc) usb_phy_init(dwc->usb2_phy); usb_phy_init(dwc->usb3_phy); if (dwc->revision >= DWC3_REVISION_230A) dwc3_notify_event(dwc, DWC3_CONTROLLER_RESET_EVENT); /* Assert USB3 PHY reset */ Loading Loading @@ -148,7 +147,6 @@ static void dwc3_core_soft_reset(struct dwc3 *dwc) reg &= ~DWC3_GCTL_CORESOFTRESET; dwc3_writel(dwc->regs, DWC3_GCTL, reg); if (dwc->revision >= DWC3_REVISION_230A) dwc3_notify_event(dwc, DWC3_CONTROLLER_POST_RESET_EVENT); } Loading Loading @@ -455,6 +453,7 @@ void dwc3_post_host_reset_core_init(struct dwc3 *dwc) { dwc3_core_init(dwc); dwc3_gadget_restart(dwc); dwc3_notify_event(dwc, DWC3_CONTROLLER_POST_INITIALIZATION_EVENT); } static void (*notify_event) (struct dwc3 *, unsigned); Loading Loading @@ -709,6 +708,8 @@ static int dwc3_probe(struct platform_device *pdev) goto err3; } dwc3_notify_event(dwc, DWC3_CONTROLLER_POST_INITIALIZATION_EVENT); return 0; err3: Loading
drivers/usb/dwc3/core.h +1 −0 Original line number Diff line number Diff line Loading @@ -663,6 +663,7 @@ struct dwc3_scratchpad_array { #define DWC3_CORE_PM_COMPLETE_EVENT 4 #define DWC3_CORE_PM_SUSPEND_EVENT 5 #define DWC3_CORE_PM_RESUME_EVENT 6 #define DWC3_CONTROLLER_POST_INITIALIZATION_EVENT 7 /** * struct dwc3 - representation of our controller * @ctrl_req: usb control request which is used for ep0 Loading
drivers/usb/dwc3/dwc3-msm.c +5 −0 Original line number Diff line number Diff line Loading @@ -1185,6 +1185,9 @@ static void dwc3_msm_notify_event(struct dwc3 *dwc, unsigned event) { struct dwc3_msm *mdwc = dev_get_drvdata(dwc->dev->parent); if (dwc->revision < DWC3_REVISION_230A) return; switch (event) { case DWC3_CONTROLLER_ERROR_EVENT: dev_info(mdwc->dev, "DWC3_CONTROLLER_ERROR_EVENT received\n"); Loading @@ -1208,6 +1211,8 @@ static void dwc3_msm_notify_event(struct dwc3 *dwc, unsigned event) dwc3_msm_restore_sec_config(mdwc->scm_dev_id); dwc->tx_fifo_size = mdwc->tx_fifo_size; break; case DWC3_CONTROLLER_POST_INITIALIZATION_EVENT: usb_phy_post_init(mdwc->ss_phy); default: dev_dbg(mdwc->dev, "unknown dwc3 event\n"); break; Loading
drivers/usb/phy/phy-msm-ssusb.c +14 −0 Original line number Diff line number Diff line Loading @@ -299,6 +299,19 @@ static int msm_ssphy_set_params(struct usb_phy *uphy) return 0; } static int msm_ssphy_post_init(struct usb_phy *uphy) { struct msm_ssphy *phy = container_of(uphy, struct msm_ssphy, phy); u32 val; /* read initial value */ val = readl_relaxed(phy->base + SS_PHY_CTRL_REG); val &= ~LANE0_PWR_PRESENT; writel_relaxed(val, phy->base + SS_PHY_CTRL_REG); return 0; } static int msm_ssphy_set_suspend(struct usb_phy *uphy, int suspend) { struct msm_ssphy *phy = container_of(uphy, struct msm_ssphy, phy); Loading Loading @@ -458,6 +471,7 @@ static int msm_ssphy_probe(struct platform_device *pdev) phy->phy.init = msm_ssphy_init; phy->phy.set_suspend = msm_ssphy_set_suspend; phy->phy.set_params = msm_ssphy_set_params; phy->phy.post_init = msm_ssphy_post_init; phy->phy.notify_connect = msm_ssphy_notify_connect; phy->phy.notify_disconnect = msm_ssphy_notify_disconnect; phy->phy.type = USB_PHY_TYPE_USB3; Loading
include/linux/usb/phy.h +12 −0 Original line number Diff line number Diff line Loading @@ -106,6 +106,9 @@ struct usb_phy { /* set additional settings parameters post-init */ int (*set_params)(struct usb_phy *x); /* do additional settings after complete initialization */ int (*post_init)(struct usb_phy *x); /* effective for B devices, ignored for A-peripheral */ int (*set_power)(struct usb_phy *x, unsigned mA); Loading Loading @@ -202,6 +205,15 @@ usb_phy_set_params(struct usb_phy *x) return 0; } static inline int usb_phy_post_init(struct usb_phy *x) { if (x && x->post_init) return x->post_init(x); return 0; } /* for usb host and peripheral controller drivers */ #if IS_ENABLED(CONFIG_USB_PHY) extern struct usb_phy *usb_get_phy(enum usb_phy_type type); Loading