USB: cdc-acm - blacklist IMS PCU device
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Sat, 2 Feb 2013 19:02:14 +0000 (11:02 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 12 Mar 2013 15:50:23 +0000 (08:50 -0700)
The IMS PCU (Passenger Control Unit) device used custom protocol over serial
line, so it is presenting itself as CDC ACM device.

Now that we have proper in-kernel driver for it we need to black-list the
device in cdc-acm driver.

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/usb/class/cdc-acm.c
drivers/usb/class/cdc-acm.h

index 6e49ec6f3adcaeae67898e53cc1c5eb6cd62b756..278bf5256a9596e0b923ecd5a07cfc57362ef68f 100644 (file)
@@ -949,6 +949,10 @@ static int acm_probe(struct usb_interface *intf,
 
        /* normal quirks */
        quirks = (unsigned long)id->driver_info;
+
+       if (quirks == IGNORE_DEVICE)
+               return -ENODEV;
+
        num_rx_buf = (quirks == SINGLE_RX_URB) ? 1 : ACM_NR;
 
        /* handle quirks deadly to normal probing*/
@@ -1650,6 +1654,15 @@ static const struct usb_device_id acm_ids[] = {
        .driver_info = NO_DATA_INTERFACE,
        },
 
+#if IS_ENABLED(CONFIG_INPUT_IMS_PCU)
+       { USB_DEVICE(0x04d8, 0x0082),   /* Application mode */
+       .driver_info = IGNORE_DEVICE,
+       },
+       { USB_DEVICE(0x04d8, 0x0083),   /* Bootloader mode */
+       .driver_info = IGNORE_DEVICE,
+       },
+#endif
+
        /* control interfaces without any protocol set */
        { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM,
                USB_CDC_PROTO_NONE) },
index 35ef887b7417f00e31e237b1cbc8b28ca9d8488a..0f76e4af600e406c063083c910fdbc3780bb4edc 100644 (file)
@@ -128,3 +128,4 @@ struct acm {
 #define NO_CAP_LINE                    4
 #define NOT_A_MODEM                    8
 #define NO_DATA_INTERFACE              16
+#define IGNORE_DEVICE                  32