Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'usb-6.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB fixes from Greg KH:
"Here are a set of USB driver fixes for 6.5-rc4. Include in here are:

- new USB serial device ids

- dwc3 driver fixes for reported issues

- typec driver fixes for reported problems

- gadget driver fixes

- reverts of some problematic USB changes that went into -rc1

All of these have been in linux-next with no reported problems"

* tag 'usb-6.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (24 commits)
usb: misc: ehset: fix wrong if condition
usb: dwc3: pci: skip BYT GPIO lookup table for hardwired phy
usb: cdns3: fix incorrect calculation of ep_buf_size when more than one config
usb: gadget: call usb_gadget_check_config() to verify UDC capability
usb: typec: Use sysfs_emit_at when concatenating the string
usb: typec: Iterate pds array when showing the pd list
usb: typec: Set port->pd before adding device for typec_port
usb: typec: qcom: fix return value check in qcom_pmic_typec_probe()
Revert "usb: gadget: tegra-xudc: Fix error check in tegra_xudc_powerdomain_init()"
Revert "usb: xhci: tegra: Fix error check"
USB: gadget: Fix the memory leak in raw_gadget driver
usb: gadget: core: remove unbalanced mutex_unlock in usb_gadget_activate
Revert "usb: dwc3: core: Enable AutoRetry feature in the controller"
Revert "xhci: add quirk for host controllers that don't update endpoint DCS"
USB: quirks: add quirk for Focusrite Scarlett
usb: xhci-mtk: set the dma max_seg_size
MAINTAINERS: drop invalid usb/cdns3 Reviewer e-mail
usb: dwc3: don't reset device side if dwc3 was configured as host-only
usb: typec: ucsi: move typec_set_mode(TYPEC_STATE_SAFE) to ucsi_unregister_partner()
usb: ohci-at91: Fix the unhandle interrupt when resume
...

+104 -115
-1
MAINTAINERS
··· 4463 4463 M: Peter Chen <peter.chen@kernel.org> 4464 4464 M: Pawel Laszczak <pawell@cadence.com> 4465 4465 R: Roger Quadros <rogerq@kernel.org> 4466 - R: Aswath Govindraju <a-govindraju@ti.com> 4467 4466 L: linux-usb@vger.kernel.org 4468 4467 S: Maintained 4469 4468 T: git git://git.kernel.org/pub/scm/linux/kernel/git/peter.chen/usb.git
+3 -1
drivers/usb/cdns3/cdns3-gadget.c
··· 3015 3015 static int cdns3_gadget_check_config(struct usb_gadget *gadget) 3016 3016 { 3017 3017 struct cdns3_device *priv_dev = gadget_to_cdns3_device(gadget); 3018 + struct cdns3_endpoint *priv_ep; 3018 3019 struct usb_ep *ep; 3019 3020 int n_in = 0; 3020 3021 int total; 3021 3022 3022 3023 list_for_each_entry(ep, &gadget->ep_list, ep_list) { 3023 - if (ep->claimed && (ep->address & USB_DIR_IN)) 3024 + priv_ep = ep_to_cdns3_ep(ep); 3025 + if ((priv_ep->flags & EP_CLAIMED) && (ep->address & USB_DIR_IN)) 3024 3026 n_in++; 3025 3027 } 3026 3028
+4
drivers/usb/core/quirks.c
··· 436 436 /* novation SoundControl XL */ 437 437 { USB_DEVICE(0x1235, 0x0061), .driver_info = USB_QUIRK_RESET_RESUME }, 438 438 439 + /* Focusrite Scarlett Solo USB */ 440 + { USB_DEVICE(0x1235, 0x8211), .driver_info = 441 + USB_QUIRK_DISCONNECT_SUSPEND }, 442 + 439 443 /* Huawei 4G LTE module */ 440 444 { USB_DEVICE(0x12d1, 0x15bb), .driver_info = 441 445 USB_QUIRK_DISCONNECT_SUSPEND },
+2 -18
drivers/usb/dwc3/core.c
··· 277 277 /* 278 278 * We're resetting only the device side because, if we're in host mode, 279 279 * XHCI driver will reset the host block. If dwc3 was configured for 280 - * host-only mode, then we can return early. 280 + * host-only mode or current role is host, then we can return early. 281 281 */ 282 - if (dwc->current_dr_role == DWC3_GCTL_PRTCAP_HOST) 282 + if (dwc->dr_mode == USB_DR_MODE_HOST || dwc->current_dr_role == DWC3_GCTL_PRTCAP_HOST) 283 283 return 0; 284 284 285 285 reg = dwc3_readl(dwc->regs, DWC3_DCTL); ··· 1207 1207 reg |= DWC3_GUCTL1_DEV_FORCE_20_CLK_FOR_30_CLK; 1208 1208 1209 1209 dwc3_writel(dwc->regs, DWC3_GUCTL1, reg); 1210 - } 1211 - 1212 - if (dwc->dr_mode == USB_DR_MODE_HOST || 1213 - dwc->dr_mode == USB_DR_MODE_OTG) { 1214 - reg = dwc3_readl(dwc->regs, DWC3_GUCTL); 1215 - 1216 - /* 1217 - * Enable Auto retry Feature to make the controller operating in 1218 - * Host mode on seeing transaction errors(CRC errors or internal 1219 - * overrun scenerios) on IN transfers to reply to the device 1220 - * with a non-terminating retry ACK (i.e, an ACK transcation 1221 - * packet with Retry=1 & Nump != 0) 1222 - */ 1223 - reg |= DWC3_GUCTL_HSTINAUTORETRY; 1224 - 1225 - dwc3_writel(dwc->regs, DWC3_GUCTL, reg); 1226 1210 } 1227 1211 1228 1212 /*
-3
drivers/usb/dwc3/core.h
··· 256 256 #define DWC3_GCTL_GBLHIBERNATIONEN BIT(1) 257 257 #define DWC3_GCTL_DSBLCLKGTNG BIT(0) 258 258 259 - /* Global User Control Register */ 260 - #define DWC3_GUCTL_HSTINAUTORETRY BIT(14) 261 - 262 259 /* Global User Control 1 Register */ 263 260 #define DWC3_GUCTL1_DEV_DECOUPLE_L1L2_EVT BIT(31) 264 261 #define DWC3_GUCTL1_TX_IPGAP_LINECHECK_DIS BIT(28)
+4 -2
drivers/usb/dwc3/dwc3-pci.c
··· 233 233 234 234 /* 235 235 * A lot of BYT devices lack ACPI resource entries for 236 - * the GPIOs, add a fallback mapping to the reference 236 + * the GPIOs. If the ACPI entry for the GPIO controller 237 + * is present add a fallback mapping to the reference 237 238 * design GPIOs which all boards seem to use. 238 239 */ 239 - gpiod_add_lookup_table(&platform_bytcr_gpios); 240 + if (acpi_dev_present("INT33FC", NULL, -1)) 241 + gpiod_add_lookup_table(&platform_bytcr_gpios); 240 242 241 243 /* 242 244 * These GPIOs will turn on the USB2 PHY. Note that we have to
+4
drivers/usb/gadget/composite.c
··· 1125 1125 goto done; 1126 1126 1127 1127 status = bind(config); 1128 + 1129 + if (status == 0) 1130 + status = usb_gadget_check_config(cdev->gadget); 1131 + 1128 1132 if (status < 0) { 1129 1133 while (!list_empty(&config->functions)) { 1130 1134 struct usb_function *f;
+7 -5
drivers/usb/gadget/legacy/raw_gadget.c
··· 310 310 dev->eps_num = i; 311 311 spin_unlock_irqrestore(&dev->lock, flags); 312 312 313 + ret = raw_queue_event(dev, USB_RAW_EVENT_CONNECT, 0, NULL); 314 + if (ret < 0) { 315 + dev_err(&gadget->dev, "failed to queue event\n"); 316 + set_gadget_data(gadget, NULL); 317 + return ret; 318 + } 319 + 313 320 /* Matches kref_put() in gadget_unbind(). */ 314 321 kref_get(&dev->count); 315 - 316 - ret = raw_queue_event(dev, USB_RAW_EVENT_CONNECT, 0, NULL); 317 - if (ret < 0) 318 - dev_err(&gadget->dev, "failed to queue event\n"); 319 - 320 322 return ret; 321 323 } 322 324
-1
drivers/usb/gadget/udc/core.c
··· 878 878 */ 879 879 if (gadget->connected) 880 880 ret = usb_gadget_connect_locked(gadget); 881 - mutex_unlock(&gadget->udc->connect_lock); 882 881 883 882 unlock: 884 883 mutex_unlock(&gadget->udc->connect_lock);
+4 -4
drivers/usb/gadget/udc/tegra-xudc.c
··· 3718 3718 int err; 3719 3719 3720 3720 xudc->genpd_dev_device = dev_pm_domain_attach_by_name(dev, "dev"); 3721 - if (IS_ERR_OR_NULL(xudc->genpd_dev_device)) { 3722 - err = PTR_ERR(xudc->genpd_dev_device) ? : -ENODATA; 3721 + if (IS_ERR(xudc->genpd_dev_device)) { 3722 + err = PTR_ERR(xudc->genpd_dev_device); 3723 3723 dev_err(dev, "failed to get device power domain: %d\n", err); 3724 3724 return err; 3725 3725 } 3726 3726 3727 3727 xudc->genpd_dev_ss = dev_pm_domain_attach_by_name(dev, "ss"); 3728 - if (IS_ERR_OR_NULL(xudc->genpd_dev_ss)) { 3729 - err = PTR_ERR(xudc->genpd_dev_ss) ? : -ENODATA; 3728 + if (IS_ERR(xudc->genpd_dev_ss)) { 3729 + err = PTR_ERR(xudc->genpd_dev_ss); 3730 3730 dev_err(dev, "failed to get SuperSpeed power domain: %d\n", err); 3731 3731 return err; 3732 3732 }
+7 -1
drivers/usb/host/ohci-at91.c
··· 672 672 else 673 673 at91_start_clock(ohci_at91); 674 674 675 - ohci_resume(hcd, false); 675 + /* 676 + * According to the comment in ohci_hcd_at91_drv_suspend() 677 + * we need to do a reset if the 48Mhz clock was stopped, 678 + * that is, if ohci_at91->wakeup is clear. Tell ohci_resume() 679 + * to reset in this case by setting its "hibernated" flag. 680 + */ 681 + ohci_resume(hcd, !ohci_at91->wakeup); 676 682 677 683 return 0; 678 684 }
+1
drivers/usb/host/xhci-mtk.c
··· 586 586 } 587 587 588 588 device_init_wakeup(dev, true); 589 + dma_set_max_seg_size(dev, UINT_MAX); 589 590 590 591 xhci = hcd_to_xhci(hcd); 591 592 xhci->main_hcd = hcd;
+1 -3
drivers/usb/host/xhci-pci.c
··· 479 479 pdev->device == 0x3432) 480 480 xhci->quirks |= XHCI_BROKEN_STREAMS; 481 481 482 - if (pdev->vendor == PCI_VENDOR_ID_VIA && pdev->device == 0x3483) { 482 + if (pdev->vendor == PCI_VENDOR_ID_VIA && pdev->device == 0x3483) 483 483 xhci->quirks |= XHCI_LPM_SUPPORT; 484 - xhci->quirks |= XHCI_EP_CTX_BROKEN_DCS; 485 - } 486 484 487 485 if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA && 488 486 pdev->device == PCI_DEVICE_ID_ASMEDIA_1042_XHCI) {
+1 -24
drivers/usb/host/xhci-ring.c
··· 626 626 struct xhci_ring *ep_ring; 627 627 struct xhci_command *cmd; 628 628 struct xhci_segment *new_seg; 629 - struct xhci_segment *halted_seg = NULL; 630 629 union xhci_trb *new_deq; 631 630 int new_cycle; 632 - union xhci_trb *halted_trb; 633 - int index = 0; 634 631 dma_addr_t addr; 635 632 u64 hw_dequeue; 636 633 bool cycle_found = false; ··· 665 668 hw_dequeue = xhci_get_hw_deq(xhci, dev, ep_index, stream_id); 666 669 new_seg = ep_ring->deq_seg; 667 670 new_deq = ep_ring->dequeue; 668 - 669 - /* 670 - * Quirk: xHC write-back of the DCS field in the hardware dequeue 671 - * pointer is wrong - use the cycle state of the TRB pointed to by 672 - * the dequeue pointer. 673 - */ 674 - if (xhci->quirks & XHCI_EP_CTX_BROKEN_DCS && 675 - !(ep->ep_state & EP_HAS_STREAMS)) 676 - halted_seg = trb_in_td(xhci, td->start_seg, 677 - td->first_trb, td->last_trb, 678 - hw_dequeue & ~0xf, false); 679 - if (halted_seg) { 680 - index = ((dma_addr_t)(hw_dequeue & ~0xf) - halted_seg->dma) / 681 - sizeof(*halted_trb); 682 - halted_trb = &halted_seg->trbs[index]; 683 - new_cycle = halted_trb->generic.field[3] & 0x1; 684 - xhci_dbg(xhci, "Endpoint DCS = %d TRB index = %d cycle = %d\n", 685 - (u8)(hw_dequeue & 0x1), index, new_cycle); 686 - } else { 687 - new_cycle = hw_dequeue & 0x1; 688 - } 671 + new_cycle = hw_dequeue & 0x1; 689 672 690 673 /* 691 674 * We want to find the pointer, segment and cycle state of the new trb
+4 -4
drivers/usb/host/xhci-tegra.c
··· 1145 1145 int err; 1146 1146 1147 1147 tegra->genpd_dev_host = dev_pm_domain_attach_by_name(dev, "xusb_host"); 1148 - if (IS_ERR_OR_NULL(tegra->genpd_dev_host)) { 1149 - err = PTR_ERR(tegra->genpd_dev_host) ? : -ENODATA; 1148 + if (IS_ERR(tegra->genpd_dev_host)) { 1149 + err = PTR_ERR(tegra->genpd_dev_host); 1150 1150 dev_err(dev, "failed to get host pm-domain: %d\n", err); 1151 1151 return err; 1152 1152 } 1153 1153 1154 1154 tegra->genpd_dev_ss = dev_pm_domain_attach_by_name(dev, "xusb_ss"); 1155 - if (IS_ERR_OR_NULL(tegra->genpd_dev_ss)) { 1156 - err = PTR_ERR(tegra->genpd_dev_ss) ? : -ENODATA; 1155 + if (IS_ERR(tegra->genpd_dev_ss)) { 1156 + err = PTR_ERR(tegra->genpd_dev_ss); 1157 1157 dev_err(dev, "failed to get superspeed pm-domain: %d\n", err); 1158 1158 return err; 1159 1159 }
+4 -4
drivers/usb/misc/ehset.c
··· 77 77 switch (test_pid) { 78 78 case TEST_SE0_NAK_PID: 79 79 ret = ehset_prepare_port_for_testing(hub_udev, portnum); 80 - if (!ret) 80 + if (ret < 0) 81 81 break; 82 82 ret = usb_control_msg_send(hub_udev, 0, USB_REQ_SET_FEATURE, 83 83 USB_RT_PORT, USB_PORT_FEAT_TEST, ··· 86 86 break; 87 87 case TEST_J_PID: 88 88 ret = ehset_prepare_port_for_testing(hub_udev, portnum); 89 - if (!ret) 89 + if (ret < 0) 90 90 break; 91 91 ret = usb_control_msg_send(hub_udev, 0, USB_REQ_SET_FEATURE, 92 92 USB_RT_PORT, USB_PORT_FEAT_TEST, ··· 95 95 break; 96 96 case TEST_K_PID: 97 97 ret = ehset_prepare_port_for_testing(hub_udev, portnum); 98 - if (!ret) 98 + if (ret < 0) 99 99 break; 100 100 ret = usb_control_msg_send(hub_udev, 0, USB_REQ_SET_FEATURE, 101 101 USB_RT_PORT, USB_PORT_FEAT_TEST, ··· 104 104 break; 105 105 case TEST_PACKET_PID: 106 106 ret = ehset_prepare_port_for_testing(hub_udev, portnum); 107 - if (!ret) 107 + if (ret < 0) 108 108 break; 109 109 ret = usb_control_msg_send(hub_udev, 0, USB_REQ_SET_FEATURE, 110 110 USB_RT_PORT, USB_PORT_FEAT_TEST,
+6
drivers/usb/serial/option.c
··· 251 251 #define QUECTEL_PRODUCT_EM061K_LTA 0x0123 252 252 #define QUECTEL_PRODUCT_EM061K_LMS 0x0124 253 253 #define QUECTEL_PRODUCT_EC25 0x0125 254 + #define QUECTEL_PRODUCT_EM060K_128 0x0128 254 255 #define QUECTEL_PRODUCT_EG91 0x0191 255 256 #define QUECTEL_PRODUCT_EG95 0x0195 256 257 #define QUECTEL_PRODUCT_BG96 0x0296 ··· 269 268 #define QUECTEL_PRODUCT_RM520N 0x0801 270 269 #define QUECTEL_PRODUCT_EC200U 0x0901 271 270 #define QUECTEL_PRODUCT_EC200S_CN 0x6002 271 + #define QUECTEL_PRODUCT_EC200A 0x6005 272 272 #define QUECTEL_PRODUCT_EM061K_LWW 0x6008 273 273 #define QUECTEL_PRODUCT_EM061K_LCN 0x6009 274 274 #define QUECTEL_PRODUCT_EC200T 0x6026 ··· 1199 1197 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K, 0xff, 0x00, 0x40) }, 1200 1198 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K, 0xff, 0xff, 0x30) }, 1201 1199 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K, 0xff, 0xff, 0x40) }, 1200 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K_128, 0xff, 0xff, 0x30) }, 1201 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K_128, 0xff, 0x00, 0x40) }, 1202 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K_128, 0xff, 0xff, 0x40) }, 1202 1203 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM061K_LCN, 0xff, 0xff, 0x30) }, 1203 1204 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM061K_LCN, 0xff, 0x00, 0x40) }, 1204 1205 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM061K_LCN, 0xff, 0xff, 0x40) }, ··· 1230 1225 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM520N, 0xff, 0, 0) }, 1231 1226 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, 0x0900, 0xff, 0, 0), /* RM500U-CN */ 1232 1227 .driver_info = ZLP }, 1228 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200A, 0xff, 0, 0) }, 1233 1229 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200U, 0xff, 0, 0) }, 1234 1230 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200S_CN, 0xff, 0, 0) }, 1235 1231 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200T, 0xff, 0, 0) },
+40 -33
drivers/usb/serial/usb-serial-simple.c
··· 38 38 { USB_DEVICE(0x0a21, 0x8001) } /* MMT-7305WW */ 39 39 DEVICE(carelink, CARELINK_IDS); 40 40 41 - /* ZIO Motherboard USB driver */ 42 - #define ZIO_IDS() \ 43 - { USB_DEVICE(0x1CBE, 0x0103) } 44 - DEVICE(zio, ZIO_IDS); 45 - 46 - /* Funsoft Serial USB driver */ 47 - #define FUNSOFT_IDS() \ 48 - { USB_DEVICE(0x1404, 0xcddc) } 49 - DEVICE(funsoft, FUNSOFT_IDS); 50 - 51 41 /* Infineon Flashloader driver */ 52 42 #define FLASHLOADER_IDS() \ 53 43 { USB_DEVICE_INTERFACE_CLASS(0x058b, 0x0041, USB_CLASS_CDC_DATA) }, \ 54 44 { USB_DEVICE(0x8087, 0x0716) }, \ 55 45 { USB_DEVICE(0x8087, 0x0801) } 56 46 DEVICE(flashloader, FLASHLOADER_IDS); 47 + 48 + /* Funsoft Serial USB driver */ 49 + #define FUNSOFT_IDS() \ 50 + { USB_DEVICE(0x1404, 0xcddc) } 51 + DEVICE(funsoft, FUNSOFT_IDS); 57 52 58 53 /* Google Serial USB SubClass */ 59 54 #define GOOGLE_IDS() \ ··· 58 63 0x01) } 59 64 DEVICE(google, GOOGLE_IDS); 60 65 66 + /* HP4x (48/49) Generic Serial driver */ 67 + #define HP4X_IDS() \ 68 + { USB_DEVICE(0x03f0, 0x0121) } 69 + DEVICE(hp4x, HP4X_IDS); 70 + 71 + /* KAUFMANN RKS+CAN VCP */ 72 + #define KAUFMANN_IDS() \ 73 + { USB_DEVICE(0x16d0, 0x0870) } 74 + DEVICE(kaufmann, KAUFMANN_IDS); 75 + 61 76 /* Libtransistor USB console */ 62 77 #define LIBTRANSISTOR_IDS() \ 63 78 { USB_DEVICE(0x1209, 0x8b00) } 64 79 DEVICE(libtransistor, LIBTRANSISTOR_IDS); 65 - 66 - /* ViVOpay USB Serial Driver */ 67 - #define VIVOPAY_IDS() \ 68 - { USB_DEVICE(0x1d5f, 0x1004) } /* ViVOpay 8800 */ 69 - DEVICE(vivopay, VIVOPAY_IDS); 70 80 71 81 /* Motorola USB Phone driver */ 72 82 #define MOTO_IDS() \ ··· 101 101 { USB_DEVICE(0x09d7, 0x0100) } /* NovAtel FlexPack GPS */ 102 102 DEVICE_N(novatel_gps, NOVATEL_IDS, 3); 103 103 104 - /* HP4x (48/49) Generic Serial driver */ 105 - #define HP4X_IDS() \ 106 - { USB_DEVICE(0x03f0, 0x0121) } 107 - DEVICE(hp4x, HP4X_IDS); 104 + /* Siemens USB/MPI adapter */ 105 + #define SIEMENS_IDS() \ 106 + { USB_DEVICE(0x908, 0x0004) } 107 + DEVICE(siemens_mpi, SIEMENS_IDS); 108 108 109 109 /* Suunto ANT+ USB Driver */ 110 110 #define SUUNTO_IDS() \ ··· 112 112 { USB_DEVICE(0x0fcf, 0x1009) } /* Dynastream ANT USB-m Stick */ 113 113 DEVICE(suunto, SUUNTO_IDS); 114 114 115 - /* Siemens USB/MPI adapter */ 116 - #define SIEMENS_IDS() \ 117 - { USB_DEVICE(0x908, 0x0004) } 118 - DEVICE(siemens_mpi, SIEMENS_IDS); 115 + /* ViVOpay USB Serial Driver */ 116 + #define VIVOPAY_IDS() \ 117 + { USB_DEVICE(0x1d5f, 0x1004) } /* ViVOpay 8800 */ 118 + DEVICE(vivopay, VIVOPAY_IDS); 119 + 120 + /* ZIO Motherboard USB driver */ 121 + #define ZIO_IDS() \ 122 + { USB_DEVICE(0x1CBE, 0x0103) } 123 + DEVICE(zio, ZIO_IDS); 119 124 120 125 /* All of the above structures mushed into two lists */ 121 126 static struct usb_serial_driver * const serial_drivers[] = { 122 127 &carelink_device, 123 - &zio_device, 124 - &funsoft_device, 125 128 &flashloader_device, 129 + &funsoft_device, 126 130 &google_device, 131 + &hp4x_device, 132 + &kaufmann_device, 127 133 &libtransistor_device, 128 - &vivopay_device, 129 134 &moto_modem_device, 130 135 &motorola_tetra_device, 131 136 &nokia_device, 132 137 &novatel_gps_device, 133 - &hp4x_device, 134 - &suunto_device, 135 138 &siemens_mpi_device, 139 + &suunto_device, 140 + &vivopay_device, 141 + &zio_device, 136 142 NULL 137 143 }; 138 144 139 145 static const struct usb_device_id id_table[] = { 140 146 CARELINK_IDS(), 141 - ZIO_IDS(), 142 - FUNSOFT_IDS(), 143 147 FLASHLOADER_IDS(), 148 + FUNSOFT_IDS(), 144 149 GOOGLE_IDS(), 150 + HP4X_IDS(), 151 + KAUFMANN_IDS(), 145 152 LIBTRANSISTOR_IDS(), 146 - VIVOPAY_IDS(), 147 153 MOTO_IDS(), 148 154 MOTOROLA_TETRA_IDS(), 149 155 NOKIA_IDS(), 150 156 NOVATEL_IDS(), 151 - HP4X_IDS(), 152 - SUUNTO_IDS(), 153 157 SIEMENS_IDS(), 158 + SUUNTO_IDS(), 159 + VIVOPAY_IDS(), 160 + ZIO_IDS(), 154 161 { }, 155 162 }; 156 163 MODULE_DEVICE_TABLE(usb, id_table);
+8 -7
drivers/usb/typec/class.c
··· 1277 1277 { 1278 1278 struct typec_port *port = to_typec_port(dev); 1279 1279 struct usb_power_delivery **pds; 1280 - struct usb_power_delivery *pd; 1281 - int ret = 0; 1280 + int i, ret = 0; 1282 1281 1283 1282 if (!port->ops || !port->ops->pd_get) 1284 1283 return -EOPNOTSUPP; ··· 1286 1287 if (!pds) 1287 1288 return 0; 1288 1289 1289 - for (pd = pds[0]; pd; pd++) { 1290 - if (pd == port->pd) 1291 - ret += sysfs_emit(buf + ret, "[%s] ", dev_name(&pd->dev)); 1290 + for (i = 0; pds[i]; i++) { 1291 + if (pds[i] == port->pd) 1292 + ret += sysfs_emit_at(buf, ret, "[%s] ", dev_name(&pds[i]->dev)); 1292 1293 else 1293 - ret += sysfs_emit(buf + ret, "%s ", dev_name(&pd->dev)); 1294 + ret += sysfs_emit_at(buf, ret, "%s ", dev_name(&pds[i]->dev)); 1294 1295 } 1295 1296 1296 1297 buf[ret - 1] = '\n'; ··· 2287 2288 return ERR_PTR(ret); 2288 2289 } 2289 2290 2291 + port->pd = cap->pd; 2292 + 2290 2293 ret = device_add(&port->dev); 2291 2294 if (ret) { 2292 2295 dev_err(parent, "failed to register port (%d)\n", ret); ··· 2296 2295 return ERR_PTR(ret); 2297 2296 } 2298 2297 2299 - ret = typec_port_set_usb_power_delivery(port, cap->pd); 2298 + ret = usb_power_delivery_link_device(port->pd, &port->dev); 2300 2299 if (ret) { 2301 2300 dev_err(&port->dev, "failed to link pd\n"); 2302 2301 device_unregister(&port->dev);
+2 -2
drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c
··· 209 209 platform_set_drvdata(pdev, tcpm); 210 210 211 211 tcpm->tcpc.fwnode = device_get_named_child_node(tcpm->dev, "connector"); 212 - if (IS_ERR(tcpm->tcpc.fwnode)) 213 - return PTR_ERR(tcpm->tcpc.fwnode); 212 + if (!tcpm->tcpc.fwnode) 213 + return -EINVAL; 214 214 215 215 tcpm->tcpm_port = tcpm_register_port(tcpm->dev, &tcpm->tcpc); 216 216 if (IS_ERR(tcpm->tcpm_port)) {
+2 -2
drivers/usb/typec/ucsi/ucsi.c
··· 785 785 if (!con->partner) 786 786 return; 787 787 788 + typec_set_mode(con->port, TYPEC_STATE_SAFE); 789 + 788 790 ucsi_unregister_partner_pdos(con); 789 791 ucsi_unregister_altmodes(con, UCSI_RECIPIENT_SOP); 790 792 typec_unregister_partner(con->partner); ··· 827 825 UCSI_CONSTAT_PARTNER_FLAG_USB) 828 826 typec_set_mode(con->port, TYPEC_STATE_USB); 829 827 } 830 - } else { 831 - typec_set_mode(con->port, TYPEC_STATE_SAFE); 832 828 } 833 829 834 830 /* Only notify USB controller if partner supports USB data */