usb/serial: Add DBC debug device support to usb_debug
authorLu Baolu <baolu.lu@linux.intel.com>
Tue, 21 Mar 2017 08:01:32 +0000 (16:01 +0800)
committerIngo Molnar <mingo@kernel.org>
Tue, 21 Mar 2017 11:30:17 +0000 (12:30 +0100)
This patch adds DBC debug device support to the usb_debug driver.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Johan Hovold <johan@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mathias Nyman <mathias.nyman@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: linux-usb@vger.kernel.org
Link: http://lkml.kernel.org/r/1490083293-3792-5-git-send-email-baolu.lu@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
drivers/usb/serial/usb_debug.c

index ca2fa5bbe17e1a9406079a89571e8dd31a083c9a..92f7e5c211628d091d715bad86b3000b041c1e81 100644 (file)
@@ -32,7 +32,18 @@ static const struct usb_device_id id_table[] = {
        { USB_DEVICE(0x0525, 0x127a) },
        { },
 };
-MODULE_DEVICE_TABLE(usb, id_table);
+
+static const struct usb_device_id dbc_id_table[] = {
+       { USB_DEVICE(0x1d6b, 0x0004) },
+       { },
+};
+
+static const struct usb_device_id id_table_combined[] = {
+       { USB_DEVICE(0x0525, 0x127a) },
+       { USB_DEVICE(0x1d6b, 0x0004) },
+       { },
+};
+MODULE_DEVICE_TABLE(usb, id_table_combined);
 
 /* This HW really does not support a serial break, so one will be
  * emulated when ever the break state is set to true.
@@ -71,9 +82,20 @@ static struct usb_serial_driver debug_device = {
        .process_read_urb =     usb_debug_process_read_urb,
 };
 
+static struct usb_serial_driver dbc_device = {
+       .driver = {
+               .owner =        THIS_MODULE,
+               .name =         "xhci_dbc",
+       },
+       .id_table =             dbc_id_table,
+       .num_ports =            1,
+       .break_ctl =            usb_debug_break_ctl,
+       .process_read_urb =     usb_debug_process_read_urb,
+};
+
 static struct usb_serial_driver * const serial_drivers[] = {
-       &debug_device, NULL
+       &debug_device, &dbc_device, NULL
 };
 
-module_usb_serial_driver(serial_drivers, id_table);
+module_usb_serial_driver(serial_drivers, id_table_combined);
 MODULE_LICENSE("GPL");