Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b7556827 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: dwc3: Enable l1_suspend_n signal for host mode"

parents 92be9c55 590aaf42
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -132,6 +132,27 @@ void dwc3_set_prtcap(struct dwc3 *dwc, u32 mode)
	dwc3_writel(dwc->regs, DWC3_GCTL, reg);
}

void dwc3_en_sleep_mode(struct dwc3 *dwc)
{
	u32 reg;

	if (dwc->dis_enblslpm_quirk)
		return;

	reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0));
	reg |= DWC3_GUSB2PHYCFG_ENBLSLPM;
	dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg);
}

void dwc3_dis_sleep_mode(struct dwc3 *dwc)
{
	u32 reg;

	reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0));
	reg &= ~DWC3_GUSB2PHYCFG_ENBLSLPM;
	dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg);
}

void dwc3_set_mode(struct dwc3 *dwc, u32 mode)
{
	unsigned long flags;
+2 −0
Original line number Diff line number Diff line
@@ -1337,6 +1337,8 @@ struct dwc3_gadget_ep_cmd_params {

/* prototypes */
void dwc3_set_prtcap(struct dwc3 *dwc, u32 mode);
void dwc3_en_sleep_mode(struct dwc3 *dwc);
void dwc3_dis_sleep_mode(struct dwc3 *dwc);
void dwc3_set_mode(struct dwc3 *dwc, u32 mode);
u32 dwc3_core_fifo_space(struct dwc3_ep *dep, u8 type);

+3 −2
Original line number Diff line number Diff line
@@ -2456,8 +2456,7 @@ static int dwc3_msm_resume(struct dwc3_msm *mdwc)
	/* Disable HSPHY auto suspend */
	dwc3_msm_write_reg(mdwc->base, DWC3_GUSB2PHYCFG(0),
		dwc3_msm_read_reg(mdwc->base, DWC3_GUSB2PHYCFG(0)) &
				~(DWC3_GUSB2PHYCFG_ENBLSLPM |
					DWC3_GUSB2PHYCFG_SUSPHY));
				~DWC3_GUSB2PHYCFG_SUSPHY);

	/* Disable wakeup capable for HS_PHY IRQ & SS_PHY_IRQ if enabled */
	if (mdwc->lpm_flags & MDWC3_ASYNC_IRQ_WAKE_CAPABILITY) {
@@ -3712,6 +3711,7 @@ static int dwc3_otg_start_host(struct dwc3_msm *mdwc, int on)
		usb_register_notify(&mdwc->host_nb);

		dwc3_set_prtcap(dwc, DWC3_GCTL_PRTCAP_HOST);
		dwc3_en_sleep_mode(dwc);
		mdwc->usbdev_nb.notifier_call = msm_dwc3_usbdev_notify;
		usb_register_atomic_notify(&mdwc->usbdev_nb);
		ret = dwc3_host_init(dwc);
@@ -3854,6 +3854,7 @@ static int dwc3_otg_start_peripheral(struct dwc3_msm *mdwc, int on)
		 */
		dwc3_msm_block_reset(mdwc, false);
		dwc3_set_prtcap(dwc, DWC3_GCTL_PRTCAP_DEVICE);
		dwc3_dis_sleep_mode(dwc);
		mdwc->in_device_mode = true;

		/* Reduce the U3 exit handshake timer from 8us to approximately