History

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

Pull USB/Thunderbolt fixes from Greg KH: "Here are some small USB and Thunderbolt driver fixes for 5.9-rc5. Nothing huge, just a number of bugfixes and new device ids for problems reported: - new USB serial driver ids - bug fixes for syzbot reported problems - typec driver fixes - thunderbolt driver fixes - revert of reported broken commit All of these have been in linux-next with no reported issues" * tag 'usb-5.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: usb: typec: intel_pmc_mux: Do not configure SBU and HSL Orientation in Alternate modes usb: typec: intel_pmc_mux: Do not configure Altmode HPD High usb: core: fix slab-out-of-bounds Read in read_descriptors Revert "usb: dwc3: meson-g12a: fix shared reset control use" usb: typec: ucsi: acpi: Check the _DEP dependencies usb: typec: intel_pmc_mux: Un-register the USB role switch usb: Fix out of sync data toggle if a configured device is reconfigured USB: serial: option: support dynamic Quectel USB compositions USB: serial: option: add support for SIM7070/SIM7080/SIM7090 modules thunderbolt: Use maximum USB3 link rate when reclaiming if link is not up thunderbolt: Disable ports that are not implemented USB: serial: ftdi_sio: add IDs for Xsens Mti USB converter

Linus Torvalds committed 6 years ago

Commit e4c26fa2 parents 6c7247f a29c0ad11 files · +87 −81Browse files

Unified · Split

11 files
  1. drivers/thunderbolt/switch.c +1 −0
  2. drivers/thunderbolt/tb.h +1 −1
  3. drivers/thunderbolt/tunnel.c +10 −2
  4. drivers/usb/core/message.c +42 −49
  5. drivers/usb/core/sysfs.c +5 −0
  6. drivers/usb/dwc3/dwc3-meson-g12a.c +6 −9
  7. drivers/usb/serial/ftdi_sio.c +1 −0
  8. drivers/usb/serial/ftdi_sio_ids.h +1 −0
  9. drivers/usb/serial/option.c +14 −8
  10. drivers/usb/typec/mux/intel_pmc_mux.c +2 −12
  11. drivers/usb/typec/ucsi/ucsi_acpi.c +4 −0
drivers/thunderbolt/switch.c+1−0
@@ -684,6 +684,7 @@ static int tb_init_port(struct tb_port *port) · 683 unmodified lines
684 if (res == -ENODEV) {684 if (res == -ENODEV) {
685 tb_dbg(port->sw->tb, " Port %d: not implemented\n",685 tb_dbg(port->sw->tb, " Port %d: not implemented\n",
686 port->port);686 port->port);
687 port->disabled = true;
687 return 0;688 return 0;
688 }689 }
689 return res;690 return res;
drivers/thunderbolt/tb.h+1−1
@@ -186,7 +186,7 @@ struct tb_switch { · 185 unmodified lines
186 * @cap_adap: Offset of the adapter specific capability (%0 if not present)186 * @cap_adap: Offset of the adapter specific capability (%0 if not present)
187 * @cap_usb4: Offset to the USB4 port capability (%0 if not present)187 * @cap_usb4: Offset to the USB4 port capability (%0 if not present)
188 * @port: Port number on switch188 * @port: Port number on switch
189 * @disabled: Disabled by eeprom189 * @disabled: Disabled by eeprom or enabled but not implemented
190 * @bonded: true if the port is bonded (two lanes combined as one)190 * @bonded: true if the port is bonded (two lanes combined as one)
191 * @dual_link_port: If the switch is connected using two ports, points191 * @dual_link_port: If the switch is connected using two ports, points
192 * to the other port.192 * to the other port.
drivers/thunderbolt/tunnel.c+10−2
@@ -951,10 +951,18 @@ static void tb_usb3_reclaim_available_bandwidth(struct tb_tunnel *tunnel, · 950 unmodified lines
951 int ret, max_rate, allocate_up, allocate_down;951 int ret, max_rate, allocate_up, allocate_down;
952 952
953 ret = usb4_usb3_port_actual_link_rate(tunnel->src_port);953 ret = usb4_usb3_port_actual_link_rate(tunnel->src_port);
954 if (ret <= 0) {954 if (ret < 0) {
955 tb_tunnel_warn(tunnel, "tunnel is not up\n");955 tb_tunnel_warn(tunnel, "failed to read actual link rate\n");
956 return;956 return;
957 } else if (!ret) {
958 /* Use maximum link rate if the link valid is not set */
959 ret = usb4_usb3_port_max_link_rate(tunnel->src_port);
960 if (ret < 0) {
961 tb_tunnel_warn(tunnel, "failed to read maximum link rate\n");
962 return;
963 }
957 }964 }
965
958 /*966 /*
959 * 90% of the max rate can be allocated for isochronous967 * 90% of the max rate can be allocated for isochronous
960 * transfers.968 * transfers.
drivers/usb/core/message.c+42−49
@@ -1205,6 +1205,34 @@ void usb_disable_interface(struct usb_device *dev, struct usb_interface *intf, · 1204 unmodified lines
1205 }1205 }
1206}1206}
1207 1207
1208/*
1209 * usb_disable_device_endpoints -- Disable all endpoints for a device
1210 * @dev: the device whose endpoints are being disabled
1211 * @skip_ep0: 0 to disable endpoint 0, 1 to skip it.
1212 */
1213static void usb_disable_device_endpoints(struct usb_device *dev, int skip_ep0)
1214{
1215 struct usb_hcd *hcd = bus_to_hcd(dev->bus);
1216 int i;
1217
1218 if (hcd->driver->check_bandwidth) {
1219 /* First pass: Cancel URBs, leave endpoint pointers intact. */
1220 for (i = skip_ep0; i < 16; ++i) {
1221 usb_disable_endpoint(dev, i, false);
1222 usb_disable_endpoint(dev, i + USB_DIR_IN, false);
1223 }
1224 /* Remove endpoints from the host controller internal state */
1225 mutex_lock(hcd->bandwidth_mutex);
1226 usb_hcd_alloc_bandwidth(dev, NULL, NULL, NULL);
1227 mutex_unlock(hcd->bandwidth_mutex);
1228 }
1229 /* Second pass: remove endpoint pointers */
1230 for (i = skip_ep0; i < 16; ++i) {
1231 usb_disable_endpoint(dev, i, true);
1232 usb_disable_endpoint(dev, i + USB_DIR_IN, true);
1233 }
1234}
1235
1208/**1236/**
1209 * usb_disable_device - Disable all the endpoints for a USB device1237 * usb_disable_device - Disable all the endpoints for a USB device
1210 * @dev: the device whose endpoints are being disabled1238 * @dev: the device whose endpoints are being disabled
@@ -1218,7 +1246,6 @@ void usb_disable_interface(struct usb_device *dev, struct usb_interface *intf, · 7 unmodified lines
1218void usb_disable_device(struct usb_device *dev, int skip_ep0)1246void usb_disable_device(struct usb_device *dev, int skip_ep0)
1219{1247{
1220 int i;1248 int i;
1221 struct usb_hcd *hcd = bus_to_hcd(dev->bus);
1222 1249
1223 /* getting rid of interfaces will disconnect1250 /* getting rid of interfaces will disconnect
1224 * any drivers bound to them (a key side effect)1251 * any drivers bound to them (a key side effect)
@@ -1264,22 +1291,8 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0) · 39 unmodified lines
1264 1291
1265 dev_dbg(&dev->dev, "%s nuking %s URBs\n", __func__,1292 dev_dbg(&dev->dev, "%s nuking %s URBs\n", __func__,
1266 skip_ep0 ? "non-ep0" : "all");1293 skip_ep0 ? "non-ep0" : "all");
1267 if (hcd->driver->check_bandwidth) {1294
1268 /* First pass: Cancel URBs, leave endpoint pointers intact. */1295 usb_disable_device_endpoints(dev, skip_ep0);
1269 for (i = skip_ep0; i < 16; ++i) {
1270 usb_disable_endpoint(dev, i, false);
1271 usb_disable_endpoint(dev, i + USB_DIR_IN, false);
1272 }
1273 /* Remove endpoints from the host controller internal state */
1274 mutex_lock(hcd->bandwidth_mutex);
1275 usb_hcd_alloc_bandwidth(dev, NULL, NULL, NULL);
1276 mutex_unlock(hcd->bandwidth_mutex);
1277 /* Second pass: remove endpoint pointers */
1278 }
1279 for (i = skip_ep0; i < 16; ++i) {
1280 usb_disable_endpoint(dev, i, true);
1281 usb_disable_endpoint(dev, i + USB_DIR_IN, true);
1282 }
1283}1296}
1284 1297
1285/**1298/**
@@ -1522,6 +1535,9 @@ EXPORT_SYMBOL_GPL(usb_set_interface); · 236 unmodified lines
1522 * The caller must own the device lock.1535 * The caller must own the device lock.
1523 *1536 *
1524 * Return: Zero on success, else a negative error code.1537 * Return: Zero on success, else a negative error code.
1538 *
1539 * If this routine fails the device will probably be in an unusable state
1540 * with endpoints disabled, and interfaces only partially enabled.
1525 */1541 */
1526int usb_reset_configuration(struct usb_device *dev)1542int usb_reset_configuration(struct usb_device *dev)
1527{1543{
@@ -1537,10 +1553,7 @@ int usb_reset_configuration(struct usb_device *dev) · 9 unmodified lines
1537 * calls during probe() are fine1553 * calls during probe() are fine
1538 */1554 */
1539 1555
1540 for (i = 1; i < 16; ++i) {1556 usb_disable_device_endpoints(dev, 1); /* skip ep0*/
1541 usb_disable_endpoint(dev, i, true);
1542 usb_disable_endpoint(dev, i + USB_DIR_IN, true);
1543 }
1544 1557
1545 config = dev->actconfig;1558 config = dev->actconfig;
1546 retval = 0;1559 retval = 0;
@@ -1553,34 +1566,10 @@ int usb_reset_configuration(struct usb_device *dev) · 6 unmodified lines
1553 mutex_unlock(hcd->bandwidth_mutex);1566 mutex_unlock(hcd->bandwidth_mutex);
1554 return -ENOMEM;1567 return -ENOMEM;
1555 }1568 }
1556 /* Make sure we have enough bandwidth for each alternate setting 0 */
1557 for (i = 0; i < config->desc.bNumInterfaces; i++) {
1558 struct usb_interface *intf = config->interface[i];
1559 struct usb_host_interface *alt;
1560 1569
1561 alt = usb_altnum_to_altsetting(intf, 0);1570 /* xHCI adds all endpoints in usb_hcd_alloc_bandwidth */
1562 if (!alt)1571 retval = usb_hcd_alloc_bandwidth(dev, config, NULL, NULL);
1563 alt = &intf->altsetting[0];
1564 if (alt != intf->cur_altsetting)
1565 retval = usb_hcd_alloc_bandwidth(dev, NULL,
1566 intf->cur_altsetting, alt);
1567 if (retval < 0)
1568 break;
1569 }
1570 /* If not, reinstate the old alternate settings */
1571 if (retval < 0) {1572 if (retval < 0) {
1572reset_old_alts:
1573 for (i--; i >= 0; i--) {
1574 struct usb_interface *intf = config->interface[i];
1575 struct usb_host_interface *alt;
1576
1577 alt = usb_altnum_to_altsetting(intf, 0);
1578 if (!alt)
1579 alt = &intf->altsetting[0];
1580 if (alt != intf->cur_altsetting)
1581 usb_hcd_alloc_bandwidth(dev, NULL,
1582 alt, intf->cur_altsetting);
1583 }
1584 usb_enable_lpm(dev);1573 usb_enable_lpm(dev);
1585 mutex_unlock(hcd->bandwidth_mutex);1574 mutex_unlock(hcd->bandwidth_mutex);
1586 return retval;1575 return retval;
@@ -1589,8 +1578,12 @@ reset_old_alts: · 2 unmodified lines
1589 USB_REQ_SET_CONFIGURATION, 0,1578 USB_REQ_SET_CONFIGURATION, 0,
1590 config->desc.bConfigurationValue, 0,1579 config->desc.bConfigurationValue, 0,
1591 NULL, 0, USB_CTRL_SET_TIMEOUT);1580 NULL, 0, USB_CTRL_SET_TIMEOUT);
1592 if (retval < 0)1581 if (retval < 0) {
1593 goto reset_old_alts;1582 usb_hcd_alloc_bandwidth(dev, NULL, NULL, NULL);
1583 usb_enable_lpm(dev);
1584 mutex_unlock(hcd->bandwidth_mutex);
1585 return retval;
1586 }
1594 mutex_unlock(hcd->bandwidth_mutex);1587 mutex_unlock(hcd->bandwidth_mutex);
1595 1588
1596 /* re-init hc/hcd interface/endpoint state */1589 /* re-init hc/hcd interface/endpoint state */
drivers/usb/core/sysfs.c+5−0
@@ -889,7 +889,11 @@ read_descriptors(struct file *filp, struct kobject *kobj, · 888 unmodified lines
889 size_t srclen, n;889 size_t srclen, n;
890 int cfgno;890 int cfgno;
891 void *src;891 void *src;
892 int retval;
892 893
894 retval = usb_lock_device_interruptible(udev);
895 if (retval < 0)
896 return -EINTR;
893 /* The binary attribute begins with the device descriptor.897 /* The binary attribute begins with the device descriptor.
894 * Following that are the raw descriptor entries for all the898 * Following that are the raw descriptor entries for all the
895 * configurations (config plus subsidiary descriptors).899 * configurations (config plus subsidiary descriptors).
@@ -914,6 +918,7 @@ read_descriptors(struct file *filp, struct kobject *kobj, · 18 unmodified lines
914 off -= srclen;918 off -= srclen;
915 }919 }
916 }920 }
921 usb_unlock_device(udev);
917 return count - nleft;922 return count - nleft;
918}923}
919 924
drivers/usb/dwc3/dwc3-meson-g12a.c+6−9
@@ -737,13 +737,13 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev) · 736 unmodified lines
737 goto err_disable_clks;737 goto err_disable_clks;
738 }738 }
739 739
740 ret = reset_control_deassert(priv->reset);740 ret = reset_control_reset(priv->reset);
741 if (ret)741 if (ret)
742 goto err_assert_reset;742 goto err_disable_clks;
743 743
744 ret = dwc3_meson_g12a_get_phys(priv);744 ret = dwc3_meson_g12a_get_phys(priv);
745 if (ret)745 if (ret)
746 goto err_assert_reset;746 goto err_disable_clks;
747 747
748 ret = priv->drvdata->setup_regmaps(priv, base);748 ret = priv->drvdata->setup_regmaps(priv, base);
749 if (ret)749 if (ret)
@@ -752,7 +752,7 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev) · 2 unmodified lines
752 if (priv->vbus) {752 if (priv->vbus) {
753 ret = regulator_enable(priv->vbus);753 ret = regulator_enable(priv->vbus);
754 if (ret)754 if (ret)
755 goto err_assert_reset;755 goto err_disable_clks;
756 }756 }
757 757
758 /* Get dr_mode */758 /* Get dr_mode */
@@ -765,13 +765,13 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev) · 6 unmodified lines
765 765
766 ret = priv->drvdata->usb_init(priv);766 ret = priv->drvdata->usb_init(priv);
767 if (ret)767 if (ret)
768 goto err_assert_reset;768 goto err_disable_clks;
769 769
770 /* Init PHYs */770 /* Init PHYs */
771 for (i = 0 ; i < PHY_COUNT ; ++i) {771 for (i = 0 ; i < PHY_COUNT ; ++i) {
772 ret = phy_init(priv->phys[i]);772 ret = phy_init(priv->phys[i]);
773 if (ret)773 if (ret)
774 goto err_assert_reset;774 goto err_disable_clks;
775 }775 }
776 776
777 /* Set PHY Power */777 /* Set PHY Power */
@@ -809,9 +809,6 @@ err_phys_exit: · 31 unmodified lines
809 for (i = 0 ; i < PHY_COUNT ; ++i)809 for (i = 0 ; i < PHY_COUNT ; ++i)
810 phy_exit(priv->phys[i]);810 phy_exit(priv->phys[i]);
811 811
812err_assert_reset:
813 reset_control_assert(priv->reset);
814
815err_disable_clks:812err_disable_clks:
816 clk_bulk_disable_unprepare(priv->drvdata->num_clks,813 clk_bulk_disable_unprepare(priv->drvdata->num_clks,
817 priv->drvdata->clks);814 priv->drvdata->clks);
drivers/usb/serial/ftdi_sio.c+1−0
@@ -713,6 +713,7 @@ static const struct usb_device_id id_table_combined[] = { · 712 unmodified lines
713 { USB_DEVICE(XSENS_VID, XSENS_AWINDA_STATION_PID) },713 { USB_DEVICE(XSENS_VID, XSENS_AWINDA_STATION_PID) },
714 { USB_DEVICE(XSENS_VID, XSENS_CONVERTER_PID) },714 { USB_DEVICE(XSENS_VID, XSENS_CONVERTER_PID) },
715 { USB_DEVICE(XSENS_VID, XSENS_MTDEVBOARD_PID) },715 { USB_DEVICE(XSENS_VID, XSENS_MTDEVBOARD_PID) },
716 { USB_DEVICE(XSENS_VID, XSENS_MTIUSBCONVERTER_PID) },
716 { USB_DEVICE(XSENS_VID, XSENS_MTW_PID) },717 { USB_DEVICE(XSENS_VID, XSENS_MTW_PID) },
717 { USB_DEVICE(FTDI_VID, FTDI_OMNI1509) },718 { USB_DEVICE(FTDI_VID, FTDI_OMNI1509) },
718 { USB_DEVICE(MOBILITY_VID, MOBILITY_USB_SERIAL_PID) },719 { USB_DEVICE(MOBILITY_VID, MOBILITY_USB_SERIAL_PID) },
drivers/usb/serial/ftdi_sio_ids.h+1−0
@@ -160,6 +160,7 @@ · 159 unmodified lines
160#define XSENS_AWINDA_DONGLE_PID 0x0102160#define XSENS_AWINDA_DONGLE_PID 0x0102
161#define XSENS_MTW_PID 0x0200 /* Xsens MTw */161#define XSENS_MTW_PID 0x0200 /* Xsens MTw */
162#define XSENS_MTDEVBOARD_PID 0x0300 /* Motion Tracker Development Board */162#define XSENS_MTDEVBOARD_PID 0x0300 /* Motion Tracker Development Board */
163#define XSENS_MTIUSBCONVERTER_PID 0x0301 /* MTi USB converter */
163#define XSENS_CONVERTER_PID 0xD00D /* Xsens USB-serial converter */164#define XSENS_CONVERTER_PID 0xD00D /* Xsens USB-serial converter */
164 165
165/* Xsens devices using FTDI VID */166/* Xsens devices using FTDI VID */
drivers/usb/serial/option.c+14−8
@@ -1094,14 +1094,18 @@ static const struct usb_device_id option_ids[] = { · 1093 unmodified lines
1094 { USB_DEVICE(QUALCOMM_VENDOR_ID, UBLOX_PRODUCT_R410M),1094 { USB_DEVICE(QUALCOMM_VENDOR_ID, UBLOX_PRODUCT_R410M),
1095 .driver_info = RSVD(1) | RSVD(3) },1095 .driver_info = RSVD(1) | RSVD(3) },
1096 /* Quectel products using Quectel vendor ID */1096 /* Quectel products using Quectel vendor ID */
1097 { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC21),1097 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC21, 0xff, 0xff, 0xff),
1098 .driver_info = RSVD(4) },1098 .driver_info = NUMEP2 },
1099 { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC25),1099 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC21, 0xff, 0, 0) },
1100 .driver_info = RSVD(4) },1100 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC25, 0xff, 0xff, 0xff),
1101 { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG95),1101 .driver_info = NUMEP2 },
1102 .driver_info = RSVD(4) },1102 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC25, 0xff, 0, 0) },
1103 { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96),1103 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG95, 0xff, 0xff, 0xff),
1104 .driver_info = RSVD(4) },1104 .driver_info = NUMEP2 },
1105 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG95, 0xff, 0, 0) },
1106 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96, 0xff, 0xff, 0xff),
1107 .driver_info = NUMEP2 },
1108 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96, 0xff, 0, 0) },
1105 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, 0xff, 0xff, 0xff),1109 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, 0xff, 0xff, 0xff),
1106 .driver_info = RSVD(1) | RSVD(2) | RSVD(3) | RSVD(4) | NUMEP2 },1110 .driver_info = RSVD(1) | RSVD(2) | RSVD(3) | RSVD(4) | NUMEP2 },
1107 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, 0xff, 0, 0) },1111 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, 0xff, 0, 0) },
@@ -1819,6 +1823,8 @@ static const struct usb_device_id option_ids[] = { · 711 unmodified lines
1819 { USB_DEVICE_INTERFACE_CLASS(0x1e0e, 0x9003, 0xff) }, /* Simcom SIM7500/SIM7600 MBIM mode */1823 { USB_DEVICE_INTERFACE_CLASS(0x1e0e, 0x9003, 0xff) }, /* Simcom SIM7500/SIM7600 MBIM mode */
1820 { USB_DEVICE_INTERFACE_CLASS(0x1e0e, 0x9011, 0xff), /* Simcom SIM7500/SIM7600 RNDIS mode */1824 { USB_DEVICE_INTERFACE_CLASS(0x1e0e, 0x9011, 0xff), /* Simcom SIM7500/SIM7600 RNDIS mode */
1821 .driver_info = RSVD(7) },1825 .driver_info = RSVD(7) },
1826 { USB_DEVICE_INTERFACE_CLASS(0x1e0e, 0x9205, 0xff) }, /* Simcom SIM7070/SIM7080/SIM7090 AT+ECM mode */
1827 { USB_DEVICE_INTERFACE_CLASS(0x1e0e, 0x9206, 0xff) }, /* Simcom SIM7070/SIM7080/SIM7090 AT-only mode */
1822 { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S_X200),1828 { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S_X200),
1823 .driver_info = NCTRL(0) | NCTRL(1) | RSVD(4) },1829 .driver_info = NCTRL(0) | NCTRL(1) | RSVD(4) },
1824 { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X220_X500D),1830 { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X220_X500D),
drivers/usb/typec/mux/intel_pmc_mux.c+2−12
@@ -61,14 +61,11 @@ enum { · 60 unmodified lines
61 61
62#define PMC_USB_ALTMODE_ORI_SHIFT 162#define PMC_USB_ALTMODE_ORI_SHIFT 1
63#define PMC_USB_ALTMODE_UFP_SHIFT 363#define PMC_USB_ALTMODE_UFP_SHIFT 3
64#define PMC_USB_ALTMODE_ORI_AUX_SHIFT 4
65#define PMC_USB_ALTMODE_ORI_HSL_SHIFT 5
66 64
67/* DP specific Mode Data bits */65/* DP specific Mode Data bits */
68#define PMC_USB_ALTMODE_DP_MODE_SHIFT 866#define PMC_USB_ALTMODE_DP_MODE_SHIFT 8
69 67
70/* TBT specific Mode Data bits */68/* TBT specific Mode Data bits */
71#define PMC_USB_ALTMODE_HPD_HIGH BIT(14)
72#define PMC_USB_ALTMODE_TBT_TYPE BIT(17)69#define PMC_USB_ALTMODE_TBT_TYPE BIT(17)
73#define PMC_USB_ALTMODE_CABLE_TYPE BIT(18)70#define PMC_USB_ALTMODE_CABLE_TYPE BIT(18)
74#define PMC_USB_ALTMODE_ACTIVE_LINK BIT(20)71#define PMC_USB_ALTMODE_ACTIVE_LINK BIT(20)
@@ -179,15 +176,9 @@ pmc_usb_mux_dp(struct pmc_usb_port *port, struct typec_mux_state *state) · 104 unmodified lines
179 req.mode_data = (port->orientation - 1) << PMC_USB_ALTMODE_ORI_SHIFT;176 req.mode_data = (port->orientation - 1) << PMC_USB_ALTMODE_ORI_SHIFT;
180 req.mode_data |= (port->role - 1) << PMC_USB_ALTMODE_UFP_SHIFT;177 req.mode_data |= (port->role - 1) << PMC_USB_ALTMODE_UFP_SHIFT;
181 178
182 req.mode_data |= sbu_orientation(port) << PMC_USB_ALTMODE_ORI_AUX_SHIFT;
183 req.mode_data |= hsl_orientation(port) << PMC_USB_ALTMODE_ORI_HSL_SHIFT;
184
185 req.mode_data |= (state->mode - TYPEC_STATE_MODAL) <<179 req.mode_data |= (state->mode - TYPEC_STATE_MODAL) <<
186 PMC_USB_ALTMODE_DP_MODE_SHIFT;180 PMC_USB_ALTMODE_DP_MODE_SHIFT;
187 181
188 if (data->status & DP_STATUS_HPD_STATE)
189 req.mode_data |= PMC_USB_ALTMODE_HPD_HIGH;
190
191 ret = pmc_usb_command(port, (void *)&req, sizeof(req));182 ret = pmc_usb_command(port, (void *)&req, sizeof(req));
192 if (ret)183 if (ret)
193 return ret;184 return ret;
@@ -212,9 +203,6 @@ pmc_usb_mux_tbt(struct pmc_usb_port *port, struct typec_mux_state *state) · 18 unmodified lines
212 req.mode_data = (port->orientation - 1) << PMC_USB_ALTMODE_ORI_SHIFT;203 req.mode_data = (port->orientation - 1) << PMC_USB_ALTMODE_ORI_SHIFT;
213 req.mode_data |= (port->role - 1) << PMC_USB_ALTMODE_UFP_SHIFT;204 req.mode_data |= (port->role - 1) << PMC_USB_ALTMODE_UFP_SHIFT;
214 205
215 req.mode_data |= sbu_orientation(port) << PMC_USB_ALTMODE_ORI_AUX_SHIFT;
216 req.mode_data |= hsl_orientation(port) << PMC_USB_ALTMODE_ORI_HSL_SHIFT;
217
218 if (TBT_ADAPTER(data->device_mode) == TBT_ADAPTER_TBT3)206 if (TBT_ADAPTER(data->device_mode) == TBT_ADAPTER_TBT3)
219 req.mode_data |= PMC_USB_ALTMODE_TBT_TYPE;207 req.mode_data |= PMC_USB_ALTMODE_TBT_TYPE;
220 208
@@ -497,6 +485,7 @@ err_remove_ports: · 276 unmodified lines
497 for (i = 0; i < pmc->num_ports; i++) {485 for (i = 0; i < pmc->num_ports; i++) {
498 typec_switch_unregister(pmc->port[i].typec_sw);486 typec_switch_unregister(pmc->port[i].typec_sw);
499 typec_mux_unregister(pmc->port[i].typec_mux);487 typec_mux_unregister(pmc->port[i].typec_mux);
488 usb_role_switch_unregister(pmc->port[i].usb_sw);
500 }489 }
501 490
502 return ret;491 return ret;
@@ -510,6 +499,7 @@ static int pmc_usb_remove(struct platform_device *pdev) · 7 unmodified lines
510 for (i = 0; i < pmc->num_ports; i++) {499 for (i = 0; i < pmc->num_ports; i++) {
511 typec_switch_unregister(pmc->port[i].typec_sw);500 typec_switch_unregister(pmc->port[i].typec_sw);
512 typec_mux_unregister(pmc->port[i].typec_mux);501 typec_mux_unregister(pmc->port[i].typec_mux);
502 usb_role_switch_unregister(pmc->port[i].usb_sw);
513 }503 }
514 504
515 return 0;505 return 0;
drivers/usb/typec/ucsi/ucsi_acpi.c+4−0
@@ -112,11 +112,15 @@ static void ucsi_acpi_notify(acpi_handle handle, u32 event, void *data) · 111 unmodified lines
112 112
113static int ucsi_acpi_probe(struct platform_device *pdev)113static int ucsi_acpi_probe(struct platform_device *pdev)
114{114{
115 struct acpi_device *adev = ACPI_COMPANION(&pdev->dev);
115 struct ucsi_acpi *ua;116 struct ucsi_acpi *ua;
116 struct resource *res;117 struct resource *res;
117 acpi_status status;118 acpi_status status;
118 int ret;119 int ret;
119 120
121 if (adev->dep_unmet)
122 return -EPROBE_DEFER;
123
120 ua = devm_kzalloc(&pdev->dev, sizeof(*ua), GFP_KERNEL);124 ua = devm_kzalloc(&pdev->dev, sizeof(*ua), GFP_KERNEL);
121 if (!ua)125 if (!ua)
122 return -ENOMEM;126 return -ENOMEM;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t