Skip to content

Commit 11254eb

Browse files
Chunfeng YunFelipe Balbi
authored andcommitted
usb: mtu3: fix an unrecognized issue when connected with PC
When boot on the platform with the USB cable connected to Win7, the Win7 will pop up an error dialog: "USB Device not recognized", but finally the Win7 can enumerate it successfully. The root cause is as the following: When the xHCI driver set PORT_POWER of the OTG port, and if both IDPIN and VBUS_VALID are high at the same time, the MTU3 controller will set SESSION and pull up DP, so the Win7 can detect existence of USB device, but if the mtu3 driver can't switch to device mode during the debounce time, the Win7 can not enumerate it. Here to fix it by removing the 1s delayed EXTCON register to speed up mode switch. Signed-off-by: Chunfeng Yun <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
1 parent 00505ad commit 11254eb

File tree

2 files changed

+3
-26
lines changed

2 files changed

+3
-26
lines changed

drivers/usb/mtu3/mtu3.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,6 @@ struct mtu3_gpd_ring {
197197
* @edev: external connector used to detect vbus and iddig changes
198198
* @vbus_nb: notifier for vbus detection
199199
* @vbus_nb: notifier for iddig(idpin) detection
200-
* @extcon_reg_dwork: delay work for extcon notifier register, waiting for
201-
* xHCI driver initialization, it's necessary for system bootup
202-
* as device.
203200
* @is_u3_drd: whether port0 supports usb3.0 dual-role device or not
204201
* @manual_drd_enabled: it's true when supports dual-role device by debugfs
205202
* to switch host/device modes depending on user input.
@@ -209,7 +206,6 @@ struct otg_switch_mtk {
209206
struct extcon_dev *edev;
210207
struct notifier_block vbus_nb;
211208
struct notifier_block id_nb;
212-
struct delayed_work extcon_reg_dwork;
213209
bool is_u3_drd;
214210
bool manual_drd_enabled;
215211
};

drivers/usb/mtu3/mtu3_dr.c

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -238,15 +238,6 @@ static int ssusb_extcon_register(struct otg_switch_mtk *otg_sx)
238238
return 0;
239239
}
240240

241-
static void extcon_register_dwork(struct work_struct *work)
242-
{
243-
struct delayed_work *dwork = to_delayed_work(work);
244-
struct otg_switch_mtk *otg_sx =
245-
container_of(dwork, struct otg_switch_mtk, extcon_reg_dwork);
246-
247-
ssusb_extcon_register(otg_sx);
248-
}
249-
250241
/*
251242
* We provide an interface via debugfs to switch between host and device modes
252243
* depending on user input.
@@ -407,18 +398,10 @@ int ssusb_otg_switch_init(struct ssusb_mtk *ssusb)
407398
{
408399
struct otg_switch_mtk *otg_sx = &ssusb->otg_switch;
409400

410-
if (otg_sx->manual_drd_enabled) {
401+
if (otg_sx->manual_drd_enabled)
411402
ssusb_debugfs_init(ssusb);
412-
} else {
413-
INIT_DELAYED_WORK(&otg_sx->extcon_reg_dwork,
414-
extcon_register_dwork);
415-
416-
/*
417-
* It is enough to delay 1s for waiting for
418-
* host initialization
419-
*/
420-
schedule_delayed_work(&otg_sx->extcon_reg_dwork, HZ);
421-
}
403+
else
404+
ssusb_extcon_register(otg_sx);
422405

423406
return 0;
424407
}
@@ -429,6 +412,4 @@ void ssusb_otg_switch_exit(struct ssusb_mtk *ssusb)
429412

430413
if (otg_sx->manual_drd_enabled)
431414
ssusb_debugfs_exit(ssusb);
432-
else
433-
cancel_delayed_work(&otg_sx->extcon_reg_dwork);
434415
}

0 commit comments

Comments
 (0)