Skip to content

Commit 3bfb823

Browse files
committed
Merge tag 'usb-serial-5.10-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-next
Johan writes: USB-serial updates for 5.10-rc1 Here are the USB-serial updates for 5.10-rc1, including: - new device ids - various clean ups All have been in linux-next with no reported issues. * tag 'usb-serial-5.10-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial: USB: serial: option: add Cellient MPL200 card USB: serial: ftdi_sio: use cur_altsetting for consistency USB: serial: option: Add Telit FT980-KS composition USB: serial: qcserial: fix altsetting probing USB: serial: ftdi_sio: clean up jtag quirks USB: serial: pl2303: add device-id for HP GC device USB: serial: ftdi_sio: add support for FreeCalypso JTAG+UART adapters
2 parents afb487a + 3e765ca commit 3bfb823

File tree

6 files changed

+36
-19
lines changed

6 files changed

+36
-19
lines changed

drivers/usb/serial/ftdi_sio.c

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,6 +1037,11 @@ static const struct usb_device_id id_table_combined[] = {
10371037
/* U-Blox devices */
10381038
{ USB_DEVICE(UBLOX_VID, UBLOX_C099F9P_ZED_PID) },
10391039
{ USB_DEVICE(UBLOX_VID, UBLOX_C099F9P_ODIN_PID) },
1040+
/* FreeCalypso USB adapters */
1041+
{ USB_DEVICE(FTDI_VID, FTDI_FALCONIA_JTAG_BUF_PID),
1042+
.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
1043+
{ USB_DEVICE(FTDI_VID, FTDI_FALCONIA_JTAG_UNBUF_PID),
1044+
.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
10401045
{ } /* Terminating entry */
10411046
};
10421047

@@ -1566,7 +1571,8 @@ static void ftdi_determine_type(struct usb_serial_port *port)
15661571
dev_dbg(&port->dev, "%s: bcdDevice = 0x%x, bNumInterfaces = %u\n", __func__,
15671572
version, interfaces);
15681573
if (interfaces > 1) {
1569-
int inter;
1574+
struct usb_interface *intf = serial->interface;
1575+
int ifnum = intf->cur_altsetting->desc.bInterfaceNumber;
15701576

15711577
/* Multiple interfaces.*/
15721578
if (version == 0x0800) {
@@ -1581,16 +1587,15 @@ static void ftdi_determine_type(struct usb_serial_port *port)
15811587
priv->chip_type = FT2232C;
15821588

15831589
/* Determine interface code. */
1584-
inter = serial->interface->altsetting->desc.bInterfaceNumber;
1585-
if (inter == 0) {
1590+
if (ifnum == 0)
15861591
priv->interface = INTERFACE_A;
1587-
} else if (inter == 1) {
1592+
else if (ifnum == 1)
15881593
priv->interface = INTERFACE_B;
1589-
} else if (inter == 2) {
1594+
else if (ifnum == 2)
15901595
priv->interface = INTERFACE_C;
1591-
} else if (inter == 3) {
1596+
else if (ifnum == 3)
15921597
priv->interface = INTERFACE_D;
1593-
}
1598+
15941599
/* BM-type devices have a bug where bcdDevice gets set
15951600
* to 0x200 when iSerialNumber is 0. */
15961601
if (version < 0x500) {
@@ -2330,12 +2335,11 @@ static int ftdi_NDI_device_setup(struct usb_serial *serial)
23302335
*/
23312336
static int ftdi_jtag_probe(struct usb_serial *serial)
23322337
{
2333-
struct usb_device *udev = serial->dev;
2334-
struct usb_interface *interface = serial->interface;
2338+
struct usb_interface *intf = serial->interface;
2339+
int ifnum = intf->cur_altsetting->desc.bInterfaceNumber;
23352340

2336-
if (interface == udev->actconfig->interface[0]) {
2337-
dev_info(&udev->dev,
2338-
"Ignoring serial port reserved for JTAG\n");
2341+
if (ifnum == 0) {
2342+
dev_info(&intf->dev, "Ignoring interface reserved for JTAG\n");
23392343
return -ENODEV;
23402344
}
23412345

@@ -2367,12 +2371,11 @@ static int ftdi_8u2232c_probe(struct usb_serial *serial)
23672371
*/
23682372
static int ftdi_stmclite_probe(struct usb_serial *serial)
23692373
{
2370-
struct usb_device *udev = serial->dev;
2371-
struct usb_interface *interface = serial->interface;
2374+
struct usb_interface *intf = serial->interface;
2375+
int ifnum = intf->cur_altsetting->desc.bInterfaceNumber;
23722376

2373-
if (interface == udev->actconfig->interface[0] ||
2374-
interface == udev->actconfig->interface[1]) {
2375-
dev_info(&udev->dev, "Ignoring serial port reserved for JTAG\n");
2377+
if (ifnum < 2) {
2378+
dev_info(&intf->dev, "Ignoring interface reserved for JTAG\n");
23762379
return -ENODEV;
23772380
}
23782381

drivers/usb/serial/ftdi_sio_ids.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@
3939

4040
#define FTDI_LUMEL_PD12_PID 0x6002
4141

42+
/*
43+
* Custom USB adapters made by Falconia Partners LLC
44+
* for FreeCalypso project, ID codes allocated to Falconia by FTDI.
45+
*/
46+
#define FTDI_FALCONIA_JTAG_BUF_PID 0x7150
47+
#define FTDI_FALCONIA_JTAG_UNBUF_PID 0x7151
48+
4249
/* Sienna Serial Interface by Secyourit GmbH */
4350
#define FTDI_SIENNA_PID 0x8348
4451

drivers/usb/serial/option.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,7 @@ static void option_instat_callback(struct urb *urb);
528528
/* Cellient products */
529529
#define CELLIENT_VENDOR_ID 0x2692
530530
#define CELLIENT_PRODUCT_MEN200 0x9005
531+
#define CELLIENT_PRODUCT_MPL200 0x9025
531532

532533
/* Hyundai Petatel Inc. products */
533534
#define PETATEL_VENDOR_ID 0x1ff4
@@ -1186,6 +1187,8 @@ static const struct usb_device_id option_ids[] = {
11861187
.driver_info = NCTRL(2) | RSVD(3) },
11871188
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1053, 0xff), /* Telit FN980 (ECM) */
11881189
.driver_info = NCTRL(0) | RSVD(1) },
1190+
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1054, 0xff), /* Telit FT980-KS */
1191+
.driver_info = NCTRL(2) | RSVD(3) },
11891192
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910),
11901193
.driver_info = NCTRL(0) | RSVD(1) | RSVD(3) },
11911194
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910_DUAL_MODEM),
@@ -1982,6 +1985,8 @@ static const struct usb_device_id option_ids[] = {
19821985
{ USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM2, 0xff, 0x02, 0x01) },
19831986
{ USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM2, 0xff, 0x00, 0x00) },
19841987
{ USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MEN200) },
1988+
{ USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MPL200),
1989+
.driver_info = RSVD(1) | RSVD(4) },
19851990
{ USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T_600A) },
19861991
{ USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T_600E) },
19871992
{ USB_DEVICE_AND_INTERFACE_INFO(TPLINK_VENDOR_ID, TPLINK_PRODUCT_LTE, 0xff, 0x00, 0x00) }, /* TP-Link LTE Module */

drivers/usb/serial/pl2303.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ static const struct usb_device_id id_table[] = {
100100
{ USB_DEVICE(HP_VENDOR_ID, HP_LD220_PRODUCT_ID) },
101101
{ USB_DEVICE(HP_VENDOR_ID, HP_LD220TA_PRODUCT_ID) },
102102
{ USB_DEVICE(HP_VENDOR_ID, HP_LD381_PRODUCT_ID) },
103+
{ USB_DEVICE(HP_VENDOR_ID, HP_LD381GC_PRODUCT_ID) },
103104
{ USB_DEVICE(HP_VENDOR_ID, HP_LD960_PRODUCT_ID) },
104105
{ USB_DEVICE(HP_VENDOR_ID, HP_LD960TA_PRODUCT_ID) },
105106
{ USB_DEVICE(HP_VENDOR_ID, HP_LCM220_PRODUCT_ID) },

drivers/usb/serial/pl2303.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@
127127

128128
/* Hewlett-Packard POS Pole Displays */
129129
#define HP_VENDOR_ID 0x03f0
130+
#define HP_LD381GC_PRODUCT_ID 0x0183
130131
#define HP_LM920_PRODUCT_ID 0x026b
131132
#define HP_TD620_PRODUCT_ID 0x0956
132133
#define HP_LD960_PRODUCT_ID 0x0b39

drivers/usb/serial/qcserial.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,11 +243,11 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id)
243243
/* QDL mode */
244244
/* Gobi 2000 has a single altsetting, older ones have two */
245245
if (serial->interface->num_altsetting == 2)
246-
intf = &serial->interface->altsetting[1];
246+
intf = usb_altnum_to_altsetting(serial->interface, 1);
247247
else if (serial->interface->num_altsetting > 2)
248248
goto done;
249249

250-
if (intf->desc.bNumEndpoints == 2 &&
250+
if (intf && intf->desc.bNumEndpoints == 2 &&
251251
usb_endpoint_is_bulk_in(&intf->endpoint[0].desc) &&
252252
usb_endpoint_is_bulk_out(&intf->endpoint[1].desc)) {
253253
dev_dbg(dev, "QDL port found\n");

0 commit comments

Comments
 (0)