diff options
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/phy/allwinner/phy-sun4i-usb.c | 5 | ||||
| -rw-r--r-- | drivers/usb/class/cdc-acm.c | 4 | ||||
| -rw-r--r-- | drivers/usb/common/common.c | 2 | ||||
| -rw-r--r-- | drivers/usb/core/hcd.c | 3 | ||||
| -rw-r--r-- | drivers/usb/dwc3/dwc3-pci.c | 4 | ||||
| -rw-r--r-- | drivers/usb/gadget/function/f_hid.c | 6 | ||||
| -rw-r--r-- | drivers/usb/gadget/udc/net2272.c | 1 | ||||
| -rw-r--r-- | drivers/usb/gadget/udc/net2280.c | 8 | ||||
| -rw-r--r-- | drivers/usb/host/u132-hcd.c | 3 | ||||
| -rw-r--r-- | drivers/usb/host/xhci-dbgcap.c | 5 | ||||
| -rw-r--r-- | drivers/usb/host/xhci-hub.c | 19 | ||||
| -rw-r--r-- | drivers/usb/host/xhci-rcar.c | 1 | ||||
| -rw-r--r-- | drivers/usb/host/xhci-ring.c | 9 | ||||
| -rw-r--r-- | drivers/usb/host/xhci.h | 8 | ||||
| -rw-r--r-- | drivers/usb/misc/usb251xb.c | 4 | ||||
| -rw-r--r-- | drivers/usb/mtu3/Kconfig | 1 | ||||
| -rw-r--r-- | drivers/usb/typec/tcpm/tcpm.c | 27 | ||||
| -rw-r--r-- | drivers/usb/typec/tcpm/wcove.c | 9 |
18 files changed, 90 insertions, 29 deletions
diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c b/drivers/phy/allwinner/phy-sun4i-usb.c index 5163097b43df..4bbd9ede38c8 100644 --- a/drivers/phy/allwinner/phy-sun4i-usb.c +++ b/drivers/phy/allwinner/phy-sun4i-usb.c | |||
| @@ -485,8 +485,11 @@ static int sun4i_usb_phy_set_mode(struct phy *_phy, | |||
| 485 | struct sun4i_usb_phy_data *data = to_sun4i_usb_phy_data(phy); | 485 | struct sun4i_usb_phy_data *data = to_sun4i_usb_phy_data(phy); |
| 486 | int new_mode; | 486 | int new_mode; |
| 487 | 487 | ||
| 488 | if (phy->index != 0) | 488 | if (phy->index != 0) { |
| 489 | if (mode == PHY_MODE_USB_HOST) | ||
| 490 | return 0; | ||
| 489 | return -EINVAL; | 491 | return -EINVAL; |
| 492 | } | ||
| 490 | 493 | ||
| 491 | switch (mode) { | 494 | switch (mode) { |
| 492 | case PHY_MODE_USB_HOST: | 495 | case PHY_MODE_USB_HOST: |
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 739f8960811a..ec666eb4b7b4 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c | |||
| @@ -558,10 +558,8 @@ static void acm_softint(struct work_struct *work) | |||
| 558 | clear_bit(EVENT_RX_STALL, &acm->flags); | 558 | clear_bit(EVENT_RX_STALL, &acm->flags); |
| 559 | } | 559 | } |
| 560 | 560 | ||
| 561 | if (test_bit(EVENT_TTY_WAKEUP, &acm->flags)) { | 561 | if (test_and_clear_bit(EVENT_TTY_WAKEUP, &acm->flags)) |
| 562 | tty_port_tty_wakeup(&acm->port); | 562 | tty_port_tty_wakeup(&acm->port); |
| 563 | clear_bit(EVENT_TTY_WAKEUP, &acm->flags); | ||
| 564 | } | ||
| 565 | } | 563 | } |
| 566 | 564 | ||
| 567 | /* | 565 | /* |
diff --git a/drivers/usb/common/common.c b/drivers/usb/common/common.c index 48277bbc15e4..73c8e6591746 100644 --- a/drivers/usb/common/common.c +++ b/drivers/usb/common/common.c | |||
| @@ -145,6 +145,8 @@ enum usb_dr_mode of_usb_get_dr_mode_by_phy(struct device_node *np, int arg0) | |||
| 145 | 145 | ||
| 146 | do { | 146 | do { |
| 147 | controller = of_find_node_with_property(controller, "phys"); | 147 | controller = of_find_node_with_property(controller, "phys"); |
| 148 | if (!of_device_is_available(controller)) | ||
| 149 | continue; | ||
| 148 | index = 0; | 150 | index = 0; |
| 149 | do { | 151 | do { |
| 150 | if (arg0 == -1) { | 152 | if (arg0 == -1) { |
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 3189181bb628..975d7c1288e3 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c | |||
| @@ -2742,6 +2742,9 @@ int usb_add_hcd(struct usb_hcd *hcd, | |||
| 2742 | retval = usb_phy_roothub_set_mode(hcd->phy_roothub, | 2742 | retval = usb_phy_roothub_set_mode(hcd->phy_roothub, |
| 2743 | PHY_MODE_USB_HOST_SS); | 2743 | PHY_MODE_USB_HOST_SS); |
| 2744 | if (retval) | 2744 | if (retval) |
| 2745 | retval = usb_phy_roothub_set_mode(hcd->phy_roothub, | ||
| 2746 | PHY_MODE_USB_HOST); | ||
| 2747 | if (retval) | ||
| 2745 | goto err_usb_phy_roothub_power_on; | 2748 | goto err_usb_phy_roothub_power_on; |
| 2746 | 2749 | ||
| 2747 | retval = usb_phy_roothub_power_on(hcd->phy_roothub); | 2750 | retval = usb_phy_roothub_power_on(hcd->phy_roothub); |
diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c index fdc6e4e403e8..8cced3609e24 100644 --- a/drivers/usb/dwc3/dwc3-pci.c +++ b/drivers/usb/dwc3/dwc3-pci.c | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | #define PCI_DEVICE_ID_INTEL_BXT_M 0x1aaa | 29 | #define PCI_DEVICE_ID_INTEL_BXT_M 0x1aaa |
| 30 | #define PCI_DEVICE_ID_INTEL_APL 0x5aaa | 30 | #define PCI_DEVICE_ID_INTEL_APL 0x5aaa |
| 31 | #define PCI_DEVICE_ID_INTEL_KBP 0xa2b0 | 31 | #define PCI_DEVICE_ID_INTEL_KBP 0xa2b0 |
| 32 | #define PCI_DEVICE_ID_INTEL_CMLH 0x02ee | ||
| 32 | #define PCI_DEVICE_ID_INTEL_GLK 0x31aa | 33 | #define PCI_DEVICE_ID_INTEL_GLK 0x31aa |
| 33 | #define PCI_DEVICE_ID_INTEL_CNPLP 0x9dee | 34 | #define PCI_DEVICE_ID_INTEL_CNPLP 0x9dee |
| 34 | #define PCI_DEVICE_ID_INTEL_CNPH 0xa36e | 35 | #define PCI_DEVICE_ID_INTEL_CNPH 0xa36e |
| @@ -305,6 +306,9 @@ static const struct pci_device_id dwc3_pci_id_table[] = { | |||
| 305 | { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_MRFLD), | 306 | { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_MRFLD), |
| 306 | (kernel_ulong_t) &dwc3_pci_mrfld_properties, }, | 307 | (kernel_ulong_t) &dwc3_pci_mrfld_properties, }, |
| 307 | 308 | ||
| 309 | { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_CMLH), | ||
| 310 | (kernel_ulong_t) &dwc3_pci_intel_properties, }, | ||
| 311 | |||
| 308 | { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_SPTLP), | 312 | { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_SPTLP), |
| 309 | (kernel_ulong_t) &dwc3_pci_intel_properties, }, | 313 | (kernel_ulong_t) &dwc3_pci_intel_properties, }, |
| 310 | 314 | ||
diff --git a/drivers/usb/gadget/function/f_hid.c b/drivers/usb/gadget/function/f_hid.c index 75b113a5b25c..f3816a5c861e 100644 --- a/drivers/usb/gadget/function/f_hid.c +++ b/drivers/usb/gadget/function/f_hid.c | |||
| @@ -391,20 +391,20 @@ try_again: | |||
| 391 | req->complete = f_hidg_req_complete; | 391 | req->complete = f_hidg_req_complete; |
| 392 | req->context = hidg; | 392 | req->context = hidg; |
| 393 | 393 | ||
| 394 | spin_unlock_irqrestore(&hidg->write_spinlock, flags); | ||
| 395 | |||
| 394 | status = usb_ep_queue(hidg->in_ep, req, GFP_ATOMIC); | 396 | status = usb_ep_queue(hidg->in_ep, req, GFP_ATOMIC); |
| 395 | if (status < 0) { | 397 | if (status < 0) { |
| 396 | ERROR(hidg->func.config->cdev, | 398 | ERROR(hidg->func.config->cdev, |
| 397 | "usb_ep_queue error on int endpoint %zd\n", status); | 399 | "usb_ep_queue error on int endpoint %zd\n", status); |
| 398 | goto release_write_pending_unlocked; | 400 | goto release_write_pending; |
| 399 | } else { | 401 | } else { |
| 400 | status = count; | 402 | status = count; |
| 401 | } | 403 | } |
| 402 | spin_unlock_irqrestore(&hidg->write_spinlock, flags); | ||
| 403 | 404 | ||
| 404 | return status; | 405 | return status; |
| 405 | release_write_pending: | 406 | release_write_pending: |
| 406 | spin_lock_irqsave(&hidg->write_spinlock, flags); | 407 | spin_lock_irqsave(&hidg->write_spinlock, flags); |
| 407 | release_write_pending_unlocked: | ||
| 408 | hidg->write_pending = 0; | 408 | hidg->write_pending = 0; |
| 409 | spin_unlock_irqrestore(&hidg->write_spinlock, flags); | 409 | spin_unlock_irqrestore(&hidg->write_spinlock, flags); |
| 410 | 410 | ||
diff --git a/drivers/usb/gadget/udc/net2272.c b/drivers/usb/gadget/udc/net2272.c index b77f3126580e..c2011cd7df8c 100644 --- a/drivers/usb/gadget/udc/net2272.c +++ b/drivers/usb/gadget/udc/net2272.c | |||
| @@ -945,6 +945,7 @@ net2272_dequeue(struct usb_ep *_ep, struct usb_request *_req) | |||
| 945 | break; | 945 | break; |
| 946 | } | 946 | } |
| 947 | if (&req->req != _req) { | 947 | if (&req->req != _req) { |
| 948 | ep->stopped = stopped; | ||
| 948 | spin_unlock_irqrestore(&ep->dev->lock, flags); | 949 | spin_unlock_irqrestore(&ep->dev->lock, flags); |
| 949 | return -EINVAL; | 950 | return -EINVAL; |
| 950 | } | 951 | } |
diff --git a/drivers/usb/gadget/udc/net2280.c b/drivers/usb/gadget/udc/net2280.c index f63f82450bf4..898339e5df10 100644 --- a/drivers/usb/gadget/udc/net2280.c +++ b/drivers/usb/gadget/udc/net2280.c | |||
| @@ -866,9 +866,6 @@ static void start_queue(struct net2280_ep *ep, u32 dmactl, u32 td_dma) | |||
| 866 | (void) readl(&ep->dev->pci->pcimstctl); | 866 | (void) readl(&ep->dev->pci->pcimstctl); |
| 867 | 867 | ||
| 868 | writel(BIT(DMA_START), &dma->dmastat); | 868 | writel(BIT(DMA_START), &dma->dmastat); |
| 869 | |||
| 870 | if (!ep->is_in) | ||
| 871 | stop_out_naking(ep); | ||
| 872 | } | 869 | } |
| 873 | 870 | ||
| 874 | static void start_dma(struct net2280_ep *ep, struct net2280_request *req) | 871 | static void start_dma(struct net2280_ep *ep, struct net2280_request *req) |
| @@ -907,6 +904,7 @@ static void start_dma(struct net2280_ep *ep, struct net2280_request *req) | |||
| 907 | writel(BIT(DMA_START), &dma->dmastat); | 904 | writel(BIT(DMA_START), &dma->dmastat); |
| 908 | return; | 905 | return; |
| 909 | } | 906 | } |
| 907 | stop_out_naking(ep); | ||
| 910 | } | 908 | } |
| 911 | 909 | ||
| 912 | tmp = dmactl_default; | 910 | tmp = dmactl_default; |
| @@ -1275,9 +1273,9 @@ static int net2280_dequeue(struct usb_ep *_ep, struct usb_request *_req) | |||
| 1275 | break; | 1273 | break; |
| 1276 | } | 1274 | } |
| 1277 | if (&req->req != _req) { | 1275 | if (&req->req != _req) { |
| 1276 | ep->stopped = stopped; | ||
| 1278 | spin_unlock_irqrestore(&ep->dev->lock, flags); | 1277 | spin_unlock_irqrestore(&ep->dev->lock, flags); |
| 1279 | dev_err(&ep->dev->pdev->dev, "%s: Request mismatch\n", | 1278 | ep_dbg(ep->dev, "%s: Request mismatch\n", __func__); |
| 1280 | __func__); | ||
| 1281 | return -EINVAL; | 1279 | return -EINVAL; |
| 1282 | } | 1280 | } |
| 1283 | 1281 | ||
diff --git a/drivers/usb/host/u132-hcd.c b/drivers/usb/host/u132-hcd.c index 934584f0a20a..6343fbacd244 100644 --- a/drivers/usb/host/u132-hcd.c +++ b/drivers/usb/host/u132-hcd.c | |||
| @@ -3204,6 +3204,9 @@ static int __init u132_hcd_init(void) | |||
| 3204 | printk(KERN_INFO "driver %s\n", hcd_name); | 3204 | printk(KERN_INFO "driver %s\n", hcd_name); |
| 3205 | workqueue = create_singlethread_workqueue("u132"); | 3205 | workqueue = create_singlethread_workqueue("u132"); |
| 3206 | retval = platform_driver_register(&u132_platform_driver); | 3206 | retval = platform_driver_register(&u132_platform_driver); |
| 3207 | if (retval) | ||
| 3208 | destroy_workqueue(workqueue); | ||
| 3209 | |||
| 3207 | return retval; | 3210 | return retval; |
| 3208 | } | 3211 | } |
| 3209 | 3212 | ||
diff --git a/drivers/usb/host/xhci-dbgcap.c b/drivers/usb/host/xhci-dbgcap.c index c78be578abb0..d932cc31711e 100644 --- a/drivers/usb/host/xhci-dbgcap.c +++ b/drivers/usb/host/xhci-dbgcap.c | |||
| @@ -516,7 +516,6 @@ static int xhci_do_dbc_stop(struct xhci_hcd *xhci) | |||
| 516 | return -1; | 516 | return -1; |
| 517 | 517 | ||
| 518 | writel(0, &dbc->regs->control); | 518 | writel(0, &dbc->regs->control); |
| 519 | xhci_dbc_mem_cleanup(xhci); | ||
| 520 | dbc->state = DS_DISABLED; | 519 | dbc->state = DS_DISABLED; |
| 521 | 520 | ||
| 522 | return 0; | 521 | return 0; |
| @@ -562,8 +561,10 @@ static void xhci_dbc_stop(struct xhci_hcd *xhci) | |||
| 562 | ret = xhci_do_dbc_stop(xhci); | 561 | ret = xhci_do_dbc_stop(xhci); |
| 563 | spin_unlock_irqrestore(&dbc->lock, flags); | 562 | spin_unlock_irqrestore(&dbc->lock, flags); |
| 564 | 563 | ||
| 565 | if (!ret) | 564 | if (!ret) { |
| 565 | xhci_dbc_mem_cleanup(xhci); | ||
| 566 | pm_runtime_put_sync(xhci_to_hcd(xhci)->self.controller); | 566 | pm_runtime_put_sync(xhci_to_hcd(xhci)->self.controller); |
| 567 | } | ||
| 567 | } | 568 | } |
| 568 | 569 | ||
| 569 | static void | 570 | static void |
diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c index e2eece693655..96a740543183 100644 --- a/drivers/usb/host/xhci-hub.c +++ b/drivers/usb/host/xhci-hub.c | |||
| @@ -1545,20 +1545,25 @@ int xhci_bus_suspend(struct usb_hcd *hcd) | |||
| 1545 | port_index = max_ports; | 1545 | port_index = max_ports; |
| 1546 | while (port_index--) { | 1546 | while (port_index--) { |
| 1547 | u32 t1, t2; | 1547 | u32 t1, t2; |
| 1548 | 1548 | int retries = 10; | |
| 1549 | retry: | ||
| 1549 | t1 = readl(ports[port_index]->addr); | 1550 | t1 = readl(ports[port_index]->addr); |
| 1550 | t2 = xhci_port_state_to_neutral(t1); | 1551 | t2 = xhci_port_state_to_neutral(t1); |
| 1551 | portsc_buf[port_index] = 0; | 1552 | portsc_buf[port_index] = 0; |
| 1552 | 1553 | ||
| 1553 | /* Bail out if a USB3 port has a new device in link training */ | 1554 | /* |
| 1554 | if ((hcd->speed >= HCD_USB3) && | 1555 | * Give a USB3 port in link training time to finish, but don't |
| 1556 | * prevent suspend as port might be stuck | ||
| 1557 | */ | ||
| 1558 | if ((hcd->speed >= HCD_USB3) && retries-- && | ||
| 1555 | (t1 & PORT_PLS_MASK) == XDEV_POLLING) { | 1559 | (t1 & PORT_PLS_MASK) == XDEV_POLLING) { |
| 1556 | bus_state->bus_suspended = 0; | ||
| 1557 | spin_unlock_irqrestore(&xhci->lock, flags); | 1560 | spin_unlock_irqrestore(&xhci->lock, flags); |
| 1558 | xhci_dbg(xhci, "Bus suspend bailout, port in polling\n"); | 1561 | msleep(XHCI_PORT_POLLING_LFPS_TIME); |
| 1559 | return -EBUSY; | 1562 | spin_lock_irqsave(&xhci->lock, flags); |
| 1563 | xhci_dbg(xhci, "port %d polling in bus suspend, waiting\n", | ||
| 1564 | port_index); | ||
| 1565 | goto retry; | ||
| 1560 | } | 1566 | } |
| 1561 | |||
| 1562 | /* suspend ports in U0, or bail out for new connect changes */ | 1567 | /* suspend ports in U0, or bail out for new connect changes */ |
| 1563 | if ((t1 & PORT_PE) && (t1 & PORT_PLS_MASK) == XDEV_U0) { | 1568 | if ((t1 & PORT_PE) && (t1 & PORT_PLS_MASK) == XDEV_U0) { |
| 1564 | if ((t1 & PORT_CSC) && wake_enabled) { | 1569 | if ((t1 & PORT_CSC) && wake_enabled) { |
diff --git a/drivers/usb/host/xhci-rcar.c b/drivers/usb/host/xhci-rcar.c index a6e463715779..671bce18782c 100644 --- a/drivers/usb/host/xhci-rcar.c +++ b/drivers/usb/host/xhci-rcar.c | |||
| @@ -246,6 +246,7 @@ int xhci_rcar_init_quirk(struct usb_hcd *hcd) | |||
| 246 | if (!xhci_rcar_wait_for_pll_active(hcd)) | 246 | if (!xhci_rcar_wait_for_pll_active(hcd)) |
| 247 | return -ETIMEDOUT; | 247 | return -ETIMEDOUT; |
| 248 | 248 | ||
| 249 | xhci->quirks |= XHCI_TRUST_TX_LENGTH; | ||
| 249 | return xhci_rcar_download_firmware(hcd); | 250 | return xhci_rcar_download_firmware(hcd); |
| 250 | } | 251 | } |
| 251 | 252 | ||
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 40fa25c4d041..9215a28dad40 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c | |||
| @@ -1647,10 +1647,13 @@ static void handle_port_status(struct xhci_hcd *xhci, | |||
| 1647 | } | 1647 | } |
| 1648 | } | 1648 | } |
| 1649 | 1649 | ||
| 1650 | if ((portsc & PORT_PLC) && (portsc & PORT_PLS_MASK) == XDEV_U0 && | 1650 | if ((portsc & PORT_PLC) && |
| 1651 | DEV_SUPERSPEED_ANY(portsc)) { | 1651 | DEV_SUPERSPEED_ANY(portsc) && |
| 1652 | ((portsc & PORT_PLS_MASK) == XDEV_U0 || | ||
| 1653 | (portsc & PORT_PLS_MASK) == XDEV_U1 || | ||
| 1654 | (portsc & PORT_PLS_MASK) == XDEV_U2)) { | ||
| 1652 | xhci_dbg(xhci, "resume SS port %d finished\n", port_id); | 1655 | xhci_dbg(xhci, "resume SS port %d finished\n", port_id); |
| 1653 | /* We've just brought the device into U0 through either the | 1656 | /* We've just brought the device into U0/1/2 through either the |
| 1654 | * Resume state after a device remote wakeup, or through the | 1657 | * Resume state after a device remote wakeup, or through the |
| 1655 | * U3Exit state after a host-initiated resume. If it's a device | 1658 | * U3Exit state after a host-initiated resume. If it's a device |
| 1656 | * initiated remote wake, don't pass up the link state change, | 1659 | * initiated remote wake, don't pass up the link state change, |
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index 652dc36e3012..9334cdee382a 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h | |||
| @@ -452,6 +452,14 @@ struct xhci_op_regs { | |||
| 452 | */ | 452 | */ |
| 453 | #define XHCI_DEFAULT_BESL 4 | 453 | #define XHCI_DEFAULT_BESL 4 |
| 454 | 454 | ||
| 455 | /* | ||
| 456 | * USB3 specification define a 360ms tPollingLFPSTiemout for USB3 ports | ||
| 457 | * to complete link training. usually link trainig completes much faster | ||
| 458 | * so check status 10 times with 36ms sleep in places we need to wait for | ||
| 459 | * polling to complete. | ||
| 460 | */ | ||
| 461 | #define XHCI_PORT_POLLING_LFPS_TIME 36 | ||
| 462 | |||
| 455 | /** | 463 | /** |
| 456 | * struct xhci_intr_reg - Interrupt Register Set | 464 | * struct xhci_intr_reg - Interrupt Register Set |
| 457 | * @irq_pending: IMAN - Interrupt Management Register. Used to enable | 465 | * @irq_pending: IMAN - Interrupt Management Register. Used to enable |
diff --git a/drivers/usb/misc/usb251xb.c b/drivers/usb/misc/usb251xb.c index 4d72b7d1d383..04684849d683 100644 --- a/drivers/usb/misc/usb251xb.c +++ b/drivers/usb/misc/usb251xb.c | |||
| @@ -547,7 +547,7 @@ static int usb251xb_get_ofdata(struct usb251xb *hub, | |||
| 547 | */ | 547 | */ |
| 548 | hub->port_swap = USB251XB_DEF_PORT_SWAP; | 548 | hub->port_swap = USB251XB_DEF_PORT_SWAP; |
| 549 | of_property_for_each_u32(np, "swap-dx-lanes", prop, p, port) { | 549 | of_property_for_each_u32(np, "swap-dx-lanes", prop, p, port) { |
| 550 | if ((port >= 0) && (port <= data->port_cnt)) | 550 | if (port <= data->port_cnt) |
| 551 | hub->port_swap |= BIT(port); | 551 | hub->port_swap |= BIT(port); |
| 552 | } | 552 | } |
| 553 | 553 | ||
| @@ -612,7 +612,7 @@ static int usb251xb_probe(struct usb251xb *hub) | |||
| 612 | dev); | 612 | dev); |
| 613 | int err; | 613 | int err; |
| 614 | 614 | ||
| 615 | if (np) { | 615 | if (np && of_id) { |
| 616 | err = usb251xb_get_ofdata(hub, | 616 | err = usb251xb_get_ofdata(hub, |
| 617 | (struct usb251xb_data *)of_id->data); | 617 | (struct usb251xb_data *)of_id->data); |
| 618 | if (err) { | 618 | if (err) { |
diff --git a/drivers/usb/mtu3/Kconfig b/drivers/usb/mtu3/Kconfig index bcc23486c4ed..928c2cd6fc00 100644 --- a/drivers/usb/mtu3/Kconfig +++ b/drivers/usb/mtu3/Kconfig | |||
| @@ -6,6 +6,7 @@ config USB_MTU3 | |||
| 6 | tristate "MediaTek USB3 Dual Role controller" | 6 | tristate "MediaTek USB3 Dual Role controller" |
| 7 | depends on USB || USB_GADGET | 7 | depends on USB || USB_GADGET |
| 8 | depends on ARCH_MEDIATEK || COMPILE_TEST | 8 | depends on ARCH_MEDIATEK || COMPILE_TEST |
| 9 | depends on EXTCON || !EXTCON | ||
| 9 | select USB_XHCI_MTK if USB_SUPPORT && USB_XHCI_HCD | 10 | select USB_XHCI_MTK if USB_SUPPORT && USB_XHCI_HCD |
| 10 | help | 11 | help |
| 11 | Say Y or M here if your system runs on MediaTek SoCs with | 12 | Say Y or M here if your system runs on MediaTek SoCs with |
diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c index 0f62db091d8d..a2233d72ae7c 100644 --- a/drivers/usb/typec/tcpm/tcpm.c +++ b/drivers/usb/typec/tcpm/tcpm.c | |||
| @@ -37,6 +37,7 @@ | |||
| 37 | S(SRC_ATTACHED), \ | 37 | S(SRC_ATTACHED), \ |
| 38 | S(SRC_STARTUP), \ | 38 | S(SRC_STARTUP), \ |
| 39 | S(SRC_SEND_CAPABILITIES), \ | 39 | S(SRC_SEND_CAPABILITIES), \ |
| 40 | S(SRC_SEND_CAPABILITIES_TIMEOUT), \ | ||
| 40 | S(SRC_NEGOTIATE_CAPABILITIES), \ | 41 | S(SRC_NEGOTIATE_CAPABILITIES), \ |
| 41 | S(SRC_TRANSITION_SUPPLY), \ | 42 | S(SRC_TRANSITION_SUPPLY), \ |
| 42 | S(SRC_READY), \ | 43 | S(SRC_READY), \ |
| @@ -2966,10 +2967,34 @@ static void run_state_machine(struct tcpm_port *port) | |||
| 2966 | /* port->hard_reset_count = 0; */ | 2967 | /* port->hard_reset_count = 0; */ |
| 2967 | port->caps_count = 0; | 2968 | port->caps_count = 0; |
| 2968 | port->pd_capable = true; | 2969 | port->pd_capable = true; |
| 2969 | tcpm_set_state_cond(port, hard_reset_state(port), | 2970 | tcpm_set_state_cond(port, SRC_SEND_CAPABILITIES_TIMEOUT, |
| 2970 | PD_T_SEND_SOURCE_CAP); | 2971 | PD_T_SEND_SOURCE_CAP); |
| 2971 | } | 2972 | } |
| 2972 | break; | 2973 | break; |
| 2974 | case SRC_SEND_CAPABILITIES_TIMEOUT: | ||
| 2975 | /* | ||
| 2976 | * Error recovery for a PD_DATA_SOURCE_CAP reply timeout. | ||
| 2977 | * | ||
| 2978 | * PD 2.0 sinks are supposed to accept src-capabilities with a | ||
| 2979 | * 3.0 header and simply ignore any src PDOs which the sink does | ||
| 2980 | * not understand such as PPS but some 2.0 sinks instead ignore | ||
| 2981 | * the entire PD_DATA_SOURCE_CAP message, causing contract | ||
| 2982 | * negotiation to fail. | ||
| 2983 | * | ||
| 2984 | * After PD_N_HARD_RESET_COUNT hard-reset attempts, we try | ||
| 2985 | * sending src-capabilities with a lower PD revision to | ||
| 2986 | * make these broken sinks work. | ||
| 2987 | */ | ||
| 2988 | if (port->hard_reset_count < PD_N_HARD_RESET_COUNT) { | ||
| 2989 | tcpm_set_state(port, HARD_RESET_SEND, 0); | ||
| 2990 | } else if (port->negotiated_rev > PD_REV20) { | ||
| 2991 | port->negotiated_rev--; | ||
| 2992 | port->hard_reset_count = 0; | ||
| 2993 | tcpm_set_state(port, SRC_SEND_CAPABILITIES, 0); | ||
| 2994 | } else { | ||
| 2995 | tcpm_set_state(port, hard_reset_state(port), 0); | ||
| 2996 | } | ||
| 2997 | break; | ||
| 2973 | case SRC_NEGOTIATE_CAPABILITIES: | 2998 | case SRC_NEGOTIATE_CAPABILITIES: |
| 2974 | ret = tcpm_pd_check_request(port); | 2999 | ret = tcpm_pd_check_request(port); |
| 2975 | if (ret < 0) { | 3000 | if (ret < 0) { |
diff --git a/drivers/usb/typec/tcpm/wcove.c b/drivers/usb/typec/tcpm/wcove.c index 423208e19383..6770afd40765 100644 --- a/drivers/usb/typec/tcpm/wcove.c +++ b/drivers/usb/typec/tcpm/wcove.c | |||
| @@ -615,8 +615,13 @@ static int wcove_typec_probe(struct platform_device *pdev) | |||
| 615 | wcove->dev = &pdev->dev; | 615 | wcove->dev = &pdev->dev; |
| 616 | wcove->regmap = pmic->regmap; | 616 | wcove->regmap = pmic->regmap; |
| 617 | 617 | ||
| 618 | irq = regmap_irq_get_virq(pmic->irq_chip_data_chgr, | 618 | irq = platform_get_irq(pdev, 0); |
| 619 | platform_get_irq(pdev, 0)); | 619 | if (irq < 0) { |
| 620 | dev_err(&pdev->dev, "Failed to get IRQ: %d\n", irq); | ||
| 621 | return irq; | ||
| 622 | } | ||
| 623 | |||
| 624 | irq = regmap_irq_get_virq(pmic->irq_chip_data_chgr, irq); | ||
| 620 | if (irq < 0) | 625 | if (irq < 0) |
| 621 | return irq; | 626 | return irq; |
| 622 | 627 | ||
