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

Commit ad0c542c authored by Chunfeng Yun's avatar Chunfeng Yun Committed by Greg Kroah-Hartman
Browse files

usb: mtu3: re-enable controller to accept LPM request after LPM resume



After the controller receives a LPM request, it will reject the LPM
request, and need software to re-enable it after LPM resume if the
controller doesn't remote wakeup from L1 automatically

Signed-off-by: default avatarChunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 87a03802
Loading
Loading
Loading
Loading
+7 −1
Original line number Original line Diff line number Diff line
@@ -176,7 +176,7 @@ static void mtu3_intr_enable(struct mtu3 *mtu)
	mtu3_writel(mbase, U3D_LV1IESR, value);
	mtu3_writel(mbase, U3D_LV1IESR, value);


	/* Enable U2 common USB interrupts */
	/* Enable U2 common USB interrupts */
	value = SUSPEND_INTR | RESUME_INTR | RESET_INTR;
	value = SUSPEND_INTR | RESUME_INTR | RESET_INTR | LPM_RESUME_INTR;
	mtu3_writel(mbase, U3D_COMMON_USB_INTR_ENABLE, value);
	mtu3_writel(mbase, U3D_COMMON_USB_INTR_ENABLE, value);


	if (mtu->is_u3_ip) {
	if (mtu->is_u3_ip) {
@@ -692,6 +692,12 @@ static irqreturn_t mtu3_u2_common_isr(struct mtu3 *mtu)
	if (u2comm & RESET_INTR)
	if (u2comm & RESET_INTR)
		mtu3_gadget_reset(mtu);
		mtu3_gadget_reset(mtu);


	if (u2comm & LPM_RESUME_INTR) {
		if (!(mtu3_readl(mbase, U3D_POWER_MANAGEMENT) & LPM_HRWE))
			mtu3_setbits(mbase, U3D_USB20_MISC_CONTROL,
				     LPM_U3_ACK_EN);
	}

	return IRQ_HANDLED;
	return IRQ_HANDLED;
}
}