Skip to content

Commit 78af87b

Browse files
Chunfeng Yungregkh
authored andcommitted
usb: mtu3: fix error of xhci port id when enable U3 dual role
If dual role mode is enabled, when switch u3port0 to device mode, it will affect port id calculation of host(xHCI), specially when host supports multi U2 ports or U3 ports, so need enable its dual role mode, and fix it here. Signed-off-by: Chunfeng Yun <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 42d1c6d commit 78af87b

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

drivers/usb/mtu3/mtu3_core.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,12 @@ static int mtu3_device_enable(struct mtu3 *mtu)
107107
(SSUSB_U2_PORT_DIS | SSUSB_U2_PORT_PDN |
108108
SSUSB_U2_PORT_HOST_SEL));
109109

110-
if (mtu->ssusb->dr_mode == USB_DR_MODE_OTG)
110+
if (mtu->ssusb->dr_mode == USB_DR_MODE_OTG) {
111111
mtu3_setbits(ibase, SSUSB_U2_CTRL(0), SSUSB_U2_PORT_OTG_SEL);
112+
if (mtu->is_u3_ip)
113+
mtu3_setbits(ibase, SSUSB_U3_CTRL(0),
114+
SSUSB_U3_PORT_DUAL_MODE);
115+
}
112116

113117
return ssusb_check_clocks(mtu->ssusb, check_clk);
114118
}

drivers/usb/mtu3/mtu3_hw_regs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,7 @@
459459

460460
/* U3D_SSUSB_U3_CTRL_0P */
461461
#define SSUSB_U3_PORT_SSP_SPEED BIT(9)
462+
#define SSUSB_U3_PORT_DUAL_MODE BIT(7)
462463
#define SSUSB_U3_PORT_HOST_SEL BIT(2)
463464
#define SSUSB_U3_PORT_PDN BIT(1)
464465
#define SSUSB_U3_PORT_DIS BIT(0)

0 commit comments

Comments
 (0)