Loading drivers/usb/dwc3/dwc3-msm.c +17 −5 Original line number Diff line number Diff line Loading @@ -337,7 +337,7 @@ static inline void dwc3_msm_write_readback(void *base, u32 offset, __func__, val, offset); } static inline bool dwc3_msm_is_superspeed(struct dwc3_msm *mdwc) static inline bool dwc3_msm_is_dev_superspeed(struct dwc3_msm *mdwc) { u8 speed; Loading @@ -345,6 +345,18 @@ static inline bool dwc3_msm_is_superspeed(struct dwc3_msm *mdwc) return !!(speed & DSTS_CONNECTSPD_SS); } static inline bool dwc3_msm_is_superspeed(struct dwc3_msm *mdwc) { u8 speed; if (mdwc->scope == POWER_SUPPLY_SCOPE_SYSTEM) { speed = dwc3_msm_read_reg(mdwc->base, USB3_PORTSC) & PORT_PE; return speed; } return dwc3_msm_is_dev_superspeed(mdwc); } /** * Dump all QSCRATCH registers. * Loading Loading @@ -737,7 +749,7 @@ static int dwc3_msm_ep_queue(struct usb_ep *ep, return ret; } superspeed = dwc3_msm_is_superspeed(mdwc); superspeed = dwc3_msm_is_dev_superspeed(mdwc); dbm_set_speed(mdwc->dbm, (u8)superspeed); return 0; Loading Loading @@ -1484,7 +1496,7 @@ static int dwc3_msm_prepare_suspend(struct dwc3_msm *mdwc) if (!atomic_read(&mdwc->in_p3)) { dev_err(mdwc->dev, "Not in P3, stoping LPM sequence\n"); return -EPERM; return -EBUSY; } } else { /* Clear previous L2 events */ Loading @@ -1511,7 +1523,7 @@ static int dwc3_msm_prepare_suspend(struct dwc3_msm *mdwc) if (!(reg & PWR_EVNT_LPM_IN_L2_MASK)) { dev_err(mdwc->dev, "could not transition HS PHY to L2\n"); return -EPERM; return -EBUSY; } } Loading Loading @@ -1647,7 +1659,7 @@ static int dwc3_msm_suspend(struct dwc3_msm *mdwc) dwc3_msm_write_reg(mdwc->base, QSCRATCH_CTRL_REG, mdwc->qscratch_ctl_val); if (dwc->softconnect && cable_connected) { if (host_bus_suspend || (dwc->softconnect && cable_connected)) { ret = dwc3_msm_prepare_suspend(mdwc); if (ret) return ret; Loading Loading
drivers/usb/dwc3/dwc3-msm.c +17 −5 Original line number Diff line number Diff line Loading @@ -337,7 +337,7 @@ static inline void dwc3_msm_write_readback(void *base, u32 offset, __func__, val, offset); } static inline bool dwc3_msm_is_superspeed(struct dwc3_msm *mdwc) static inline bool dwc3_msm_is_dev_superspeed(struct dwc3_msm *mdwc) { u8 speed; Loading @@ -345,6 +345,18 @@ static inline bool dwc3_msm_is_superspeed(struct dwc3_msm *mdwc) return !!(speed & DSTS_CONNECTSPD_SS); } static inline bool dwc3_msm_is_superspeed(struct dwc3_msm *mdwc) { u8 speed; if (mdwc->scope == POWER_SUPPLY_SCOPE_SYSTEM) { speed = dwc3_msm_read_reg(mdwc->base, USB3_PORTSC) & PORT_PE; return speed; } return dwc3_msm_is_dev_superspeed(mdwc); } /** * Dump all QSCRATCH registers. * Loading Loading @@ -737,7 +749,7 @@ static int dwc3_msm_ep_queue(struct usb_ep *ep, return ret; } superspeed = dwc3_msm_is_superspeed(mdwc); superspeed = dwc3_msm_is_dev_superspeed(mdwc); dbm_set_speed(mdwc->dbm, (u8)superspeed); return 0; Loading Loading @@ -1484,7 +1496,7 @@ static int dwc3_msm_prepare_suspend(struct dwc3_msm *mdwc) if (!atomic_read(&mdwc->in_p3)) { dev_err(mdwc->dev, "Not in P3, stoping LPM sequence\n"); return -EPERM; return -EBUSY; } } else { /* Clear previous L2 events */ Loading @@ -1511,7 +1523,7 @@ static int dwc3_msm_prepare_suspend(struct dwc3_msm *mdwc) if (!(reg & PWR_EVNT_LPM_IN_L2_MASK)) { dev_err(mdwc->dev, "could not transition HS PHY to L2\n"); return -EPERM; return -EBUSY; } } Loading Loading @@ -1647,7 +1659,7 @@ static int dwc3_msm_suspend(struct dwc3_msm *mdwc) dwc3_msm_write_reg(mdwc->base, QSCRATCH_CTRL_REG, mdwc->qscratch_ctl_val); if (dwc->softconnect && cable_connected) { if (host_bus_suspend || (dwc->softconnect && cable_connected)) { ret = dwc3_msm_prepare_suspend(mdwc); if (ret) return ret; Loading