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

Merge tag 'usb-serial-3.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-next

Johan writes:

USB-serial updates for v3.17-rc1

Here are some minor fixes and clean-ups to the ftdi_sio, mos7840 and kl5kusb105
drivers for v3.17-rc1.

Signed-off-by: Johan Hovold <johan@kernel.org>

+23 -59
+23 -59
drivers/usb/serial/ftdi_sio.c
··· 87 87 }; 88 88 89 89 static int ftdi_jtag_probe(struct usb_serial *serial); 90 - static int ftdi_mtxorb_hack_setup(struct usb_serial *serial); 91 90 static int ftdi_NDI_device_setup(struct usb_serial *serial); 92 91 static int ftdi_stmclite_probe(struct usb_serial *serial); 93 92 static int ftdi_8u2232c_probe(struct usb_serial *serial); ··· 95 96 96 97 static struct ftdi_sio_quirk ftdi_jtag_quirk = { 97 98 .probe = ftdi_jtag_probe, 98 - }; 99 - 100 - static struct ftdi_sio_quirk ftdi_mtxorb_hack_quirk = { 101 - .probe = ftdi_mtxorb_hack_setup, 102 99 }; 103 100 104 101 static struct ftdi_sio_quirk ftdi_NDI_device_quirk = { ··· 251 256 { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0124_PID) }, 252 257 { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0125_PID) }, 253 258 { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0126_PID) }, 254 - { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0127_PID), 255 - .driver_info = (kernel_ulong_t)&ftdi_mtxorb_hack_quirk }, 259 + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0127_PID) }, 256 260 { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0128_PID) }, 257 261 { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0129_PID) }, 258 262 { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_012A_PID) }, 259 263 { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_012B_PID) }, 260 - { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_012C_PID), 261 - .driver_info = (kernel_ulong_t)&ftdi_mtxorb_hack_quirk }, 264 + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_012C_PID) }, 262 265 { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_012D_PID) }, 263 266 { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_012E_PID) }, 264 267 { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_012F_PID) }, ··· 295 302 { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0150_PID) }, 296 303 { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0151_PID) }, 297 304 { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0152_PID) }, 298 - { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0153_PID), 299 - .driver_info = (kernel_ulong_t)&ftdi_mtxorb_hack_quirk }, 300 - { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0154_PID), 301 - .driver_info = (kernel_ulong_t)&ftdi_mtxorb_hack_quirk }, 302 - { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0155_PID), 303 - .driver_info = (kernel_ulong_t)&ftdi_mtxorb_hack_quirk }, 304 - { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0156_PID), 305 - .driver_info = (kernel_ulong_t)&ftdi_mtxorb_hack_quirk }, 306 - { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0157_PID), 307 - .driver_info = (kernel_ulong_t)&ftdi_mtxorb_hack_quirk }, 308 - { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0158_PID), 309 - .driver_info = (kernel_ulong_t)&ftdi_mtxorb_hack_quirk }, 305 + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0153_PID) }, 306 + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0154_PID) }, 307 + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0155_PID) }, 308 + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0156_PID) }, 309 + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0157_PID) }, 310 + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0158_PID) }, 310 311 { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0159_PID) }, 311 312 { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_015A_PID) }, 312 313 { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_015B_PID) }, ··· 1546 1559 } 1547 1560 1548 1561 1549 - /* Determine the maximum packet size for the device. This depends on the chip 1550 - * type and the USB host capabilities. The value should be obtained from the 1551 - * device descriptor as the chip will use the appropriate values for the host.*/ 1562 + /* 1563 + * Determine the maximum packet size for the device. This depends on the chip 1564 + * type and the USB host capabilities. The value should be obtained from the 1565 + * device descriptor as the chip will use the appropriate values for the host. 1566 + */ 1552 1567 static void ftdi_set_max_packet_size(struct usb_serial_port *port) 1553 1568 { 1554 1569 struct ftdi_private *priv = usb_get_serial_port_data(port); 1555 - struct usb_serial *serial = port->serial; 1556 - struct usb_device *udev = serial->dev; 1557 - 1558 - struct usb_interface *interface = serial->interface; 1570 + struct usb_interface *interface = port->serial->interface; 1559 1571 struct usb_endpoint_descriptor *ep_desc; 1560 - 1561 1572 unsigned num_endpoints; 1562 1573 unsigned i; 1563 1574 1564 1575 num_endpoints = interface->cur_altsetting->desc.bNumEndpoints; 1565 - dev_info(&udev->dev, "Number of endpoints %d\n", num_endpoints); 1566 - 1567 1576 if (!num_endpoints) 1568 1577 return; 1569 1578 1570 - /* NOTE: some customers have programmed FT232R/FT245R devices 1571 - * with an endpoint size of 0 - not good. In this case, we 1579 + /* 1580 + * NOTE: Some customers have programmed FT232R/FT245R devices 1581 + * with an endpoint size of 0 - not good. In this case, we 1572 1582 * want to override the endpoint descriptor setting and use a 1573 - * value of 64 for wMaxPacketSize */ 1583 + * value of 64 for wMaxPacketSize. 1584 + */ 1574 1585 for (i = 0; i < num_endpoints; i++) { 1575 - dev_info(&udev->dev, "Endpoint %d MaxPacketSize %d\n", i+1, 1576 - interface->cur_altsetting->endpoint[i].desc.wMaxPacketSize); 1577 1586 ep_desc = &interface->cur_altsetting->endpoint[i].desc; 1578 - if (ep_desc->wMaxPacketSize == 0) { 1587 + if (!ep_desc->wMaxPacketSize) { 1579 1588 ep_desc->wMaxPacketSize = cpu_to_le16(0x40); 1580 - dev_info(&udev->dev, "Overriding wMaxPacketSize on endpoint %d\n", i); 1589 + dev_warn(&port->dev, "Overriding wMaxPacketSize on endpoint %d\n", 1590 + usb_endpoint_num(ep_desc)); 1581 1591 } 1582 1592 } 1583 1593 1584 - /* set max packet size based on descriptor */ 1594 + /* Set max packet size based on last descriptor. */ 1585 1595 priv->max_packet_size = usb_endpoint_maxp(ep_desc); 1586 - 1587 - dev_info(&udev->dev, "Setting MaxPacketSize %d\n", priv->max_packet_size); 1588 1596 } 1589 1597 1590 1598 ··· 1843 1861 interface == udev->actconfig->interface[1]) { 1844 1862 dev_info(&udev->dev, "Ignoring serial port reserved for JTAG\n"); 1845 1863 return -ENODEV; 1846 - } 1847 - 1848 - return 0; 1849 - } 1850 - 1851 - /* 1852 - * The Matrix Orbital VK204-25-USB has an invalid IN endpoint. 1853 - * We have to correct it if we want to read from it. 1854 - */ 1855 - static int ftdi_mtxorb_hack_setup(struct usb_serial *serial) 1856 - { 1857 - struct usb_host_endpoint *ep = serial->dev->ep_in[1]; 1858 - struct usb_endpoint_descriptor *ep_desc = &ep->desc; 1859 - 1860 - if (ep->enabled && ep_desc->wMaxPacketSize == 0) { 1861 - ep_desc->wMaxPacketSize = cpu_to_le16(0x40); 1862 - dev_info(&serial->dev->dev, 1863 - "Fixing invalid wMaxPacketSize on read pipe\n"); 1864 1864 } 1865 1865 1866 1866 return 0;