Skip to content

Commit e2c8f8e

Browse files
committed
Merge tag 'usb-5.13-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB fixes from Greg KH: "Here are three small USB fixes for reported problems for 5.13-rc7. They include: - disable autosuspend for a cypress USB hub - fix the battery charger detection for the chipidea driver - fix a kernel panic in the dwc3 driver due to a previous change in 5.13-rc1. All have been in linux-next with no reported problems" * tag 'usb-5.13-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: usb: core: hub: Disable autosuspend for Cypress CY7C65632 usb: chipidea: imx: Fix Battery Charger 1.2 CDP detection usb: dwc3: core: fix kernel panic when do reboot
2 parents c3bf96e + a7d8d1c commit e2c8f8e

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

drivers/usb/chipidea/usbmisc_imx.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,16 @@ static int imx7d_charger_secondary_detection(struct imx_usbmisc_data *data)
686686
int val;
687687
unsigned long flags;
688688

689+
/* Clear VDATSRCENB0 to disable VDP_SRC and IDM_SNK required by BC 1.2 spec */
690+
spin_lock_irqsave(&usbmisc->lock, flags);
691+
val = readl(usbmisc->base + MX7D_USB_OTG_PHY_CFG2);
692+
val &= ~MX7D_USB_OTG_PHY_CFG2_CHRG_VDATSRCENB0;
693+
writel(val, usbmisc->base + MX7D_USB_OTG_PHY_CFG2);
694+
spin_unlock_irqrestore(&usbmisc->lock, flags);
695+
696+
/* TVDMSRC_DIS */
697+
msleep(20);
698+
689699
/* VDM_SRC is connected to D- and IDP_SINK is connected to D+ */
690700
spin_lock_irqsave(&usbmisc->lock, flags);
691701
val = readl(usbmisc->base + MX7D_USB_OTG_PHY_CFG2);
@@ -695,7 +705,8 @@ static int imx7d_charger_secondary_detection(struct imx_usbmisc_data *data)
695705
usbmisc->base + MX7D_USB_OTG_PHY_CFG2);
696706
spin_unlock_irqrestore(&usbmisc->lock, flags);
697707

698-
usleep_range(1000, 2000);
708+
/* TVDMSRC_ON */
709+
msleep(40);
699710

700711
/*
701712
* Per BC 1.2, check voltage of D+:
@@ -798,7 +809,8 @@ static int imx7d_charger_primary_detection(struct imx_usbmisc_data *data)
798809
usbmisc->base + MX7D_USB_OTG_PHY_CFG2);
799810
spin_unlock_irqrestore(&usbmisc->lock, flags);
800811

801-
usleep_range(1000, 2000);
812+
/* TVDPSRC_ON */
813+
msleep(40);
802814

803815
/* Check if D- is less than VDAT_REF to determine an SDP per BC 1.2 */
804816
val = readl(usbmisc->base + MX7D_USB_OTG_PHY_STATUS);

drivers/usb/core/hub.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
#define USB_VENDOR_GENESYS_LOGIC 0x05e3
4242
#define USB_VENDOR_SMSC 0x0424
4343
#define USB_PRODUCT_USB5534B 0x5534
44+
#define USB_VENDOR_CYPRESS 0x04b4
45+
#define USB_PRODUCT_CY7C65632 0x6570
4446
#define HUB_QUIRK_CHECK_PORT_AUTOSUSPEND 0x01
4547
#define HUB_QUIRK_DISABLE_AUTOSUSPEND 0x02
4648

@@ -5697,6 +5699,11 @@ static const struct usb_device_id hub_id_table[] = {
56975699
.idProduct = USB_PRODUCT_USB5534B,
56985700
.bInterfaceClass = USB_CLASS_HUB,
56995701
.driver_info = HUB_QUIRK_DISABLE_AUTOSUSPEND},
5702+
{ .match_flags = USB_DEVICE_ID_MATCH_VENDOR
5703+
| USB_DEVICE_ID_MATCH_PRODUCT,
5704+
.idVendor = USB_VENDOR_CYPRESS,
5705+
.idProduct = USB_PRODUCT_CY7C65632,
5706+
.driver_info = HUB_QUIRK_DISABLE_AUTOSUSPEND},
57005707
{ .match_flags = USB_DEVICE_ID_MATCH_VENDOR
57015708
| USB_DEVICE_ID_MATCH_INT_CLASS,
57025709
.idVendor = USB_VENDOR_GENESYS_LOGIC,

drivers/usb/dwc3/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1671,8 +1671,8 @@ static int dwc3_remove(struct platform_device *pdev)
16711671

16721672
pm_runtime_get_sync(&pdev->dev);
16731673

1674-
dwc3_debugfs_exit(dwc);
16751674
dwc3_core_exit_mode(dwc);
1675+
dwc3_debugfs_exit(dwc);
16761676

16771677
dwc3_core_exit(dwc);
16781678
dwc3_ulpi_exit(dwc);

0 commit comments

Comments
 (0)