diff mbox series

[1/6] usb: mtu3: restore HS function when set SS/SSP

Message ID 1628739182-30089-1-git-send-email-chunfeng.yun@mediatek.com
State Superseded
Headers show
Series [1/6] usb: mtu3: restore HS function when set SS/SSP | expand

Commit Message

Chunfeng Yun Aug. 12, 2021, 3:32 a.m. UTC
Due to HS function is disabled when set as FS, need restore
it when set as SS/SSP.

Fixes: dc4c1aa7eae9 ("usb: mtu3: add ->udc_set_speed()")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
 drivers/usb/mtu3/mtu3_core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Felipe Balbi Aug. 12, 2021, 6:49 a.m. UTC | #1
Chunfeng Yun <chunfeng.yun@mediatek.com> writes:

> Use usb_endpoint_maxp() and usb_endpoint_maxp_mult() seperately
> to get maxpacket and mult.
> Meanwhile fix the bug that should use @mult but not @burst
> to save mult value.

I really think you should split this into two patches. One which *only*
fixes the bug and another (patch 2) which *only* corrects the use
usb_endpoint_maxp()
Chunfeng Yun Aug. 12, 2021, 11:51 a.m. UTC | #2
On Thu, 2021-08-12 at 09:49 +0300, Felipe Balbi wrote:
> Chunfeng Yun <chunfeng.yun@mediatek.com> writes:

> 

> > Use usb_endpoint_maxp() and usb_endpoint_maxp_mult() seperately

> > to get maxpacket and mult.

> > Meanwhile fix the bug that should use @mult but not @burst

> > to save mult value.

> 

> I really think you should split this into two patches. One which

> *only*

> fixes the bug and another (patch 2) which *only* corrects the use

> usb_endpoint_maxp()

Ok, thanks
>
diff mbox series

Patch

diff --git a/drivers/usb/mtu3/mtu3_core.c b/drivers/usb/mtu3/mtu3_core.c
index 562f4357831e..6403f01947b2 100644
--- a/drivers/usb/mtu3/mtu3_core.c
+++ b/drivers/usb/mtu3/mtu3_core.c
@@ -227,11 +227,13 @@  static void mtu3_set_speed(struct mtu3 *mtu, enum usb_device_speed speed)
 		mtu3_setbits(mbase, U3D_POWER_MANAGEMENT, HS_ENABLE);
 		break;
 	case USB_SPEED_SUPER:
+		mtu3_setbits(mbase, U3D_POWER_MANAGEMENT, HS_ENABLE);
 		mtu3_clrbits(mtu->ippc_base, SSUSB_U3_CTRL(0),
 			     SSUSB_U3_PORT_SSP_SPEED);
 		break;
 	case USB_SPEED_SUPER_PLUS:
-			mtu3_setbits(mtu->ippc_base, SSUSB_U3_CTRL(0),
+		mtu3_setbits(mbase, U3D_POWER_MANAGEMENT, HS_ENABLE);
+		mtu3_setbits(mtu->ippc_base, SSUSB_U3_CTRL(0),
 			     SSUSB_U3_PORT_SSP_SPEED);
 		break;
 	default: