aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Abbott <abbotti@mev.co.uk>2005-07-28 13:40:32 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-09-08 19:22:28 -0400
commitfdcb0a0f1b8b050cbb7ed0ea2e030741ce5bb517 (patch)
treec0bfa1f6c213ea21ace7f2c79b211ad2beef2996
parent1694899fd1af43636351aac97f415fd3c9cefb1d (diff)
[PATCH] USB ftdi_sio: user specified VID/PID
ftdi_sio: Support one user specified vendor and product ID via a couple of new module parameters. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/usb/serial/ftdi_sio.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index d1964a0c4168..01edd6208991 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -269,6 +269,8 @@
269#define DRIVER_DESC "USB FTDI Serial Converters Driver" 269#define DRIVER_DESC "USB FTDI Serial Converters Driver"
270 270
271static int debug; 271static int debug;
272static __u16 vendor = FTDI_VID;
273static __u16 product;
272 274
273/* struct ftdi_sio_quirk is used by devices requiring special attention. */ 275/* struct ftdi_sio_quirk is used by devices requiring special attention. */
274struct ftdi_sio_quirk { 276struct ftdi_sio_quirk {
@@ -432,7 +434,8 @@ static struct usb_device_id id_table_combined [] = {
432 { USB_DEVICE(FTDI_VID, FTDI_MHAM_Y6_PID) }, 434 { USB_DEVICE(FTDI_VID, FTDI_MHAM_Y6_PID) },
433 { USB_DEVICE(FTDI_VID, FTDI_MHAM_Y8_PID) }, 435 { USB_DEVICE(FTDI_VID, FTDI_MHAM_Y8_PID) },
434 { USB_DEVICE(EVOLUTION_VID, EVOLUTION_ER1_PID) }, 436 { USB_DEVICE(EVOLUTION_VID, EVOLUTION_ER1_PID) },
435 { } /* Terminating entry */ 437 { }, /* Optional parameter entry */
438 { } /* Terminating entry */
436}; 439};
437 440
438MODULE_DEVICE_TABLE (usb, id_table_combined); 441MODULE_DEVICE_TABLE (usb, id_table_combined);
@@ -2030,6 +2033,15 @@ static int __init ftdi_init (void)
2030 int retval; 2033 int retval;
2031 2034
2032 dbg("%s", __FUNCTION__); 2035 dbg("%s", __FUNCTION__);
2036 if (vendor > 0 && product > 0) {
2037 /* Add user specified VID/PID to reserved element of table. */
2038 int i;
2039 for (i = 0; id_table_combined[i].idVendor; i++)
2040 ;
2041 id_table_combined[i].match_flags = USB_DEVICE_ID_MATCH_DEVICE;
2042 id_table_combined[i].idVendor = vendor;
2043 id_table_combined[i].idProduct = product;
2044 }
2033 retval = usb_serial_register(&ftdi_sio_device); 2045 retval = usb_serial_register(&ftdi_sio_device);
2034 if (retval) 2046 if (retval)
2035 goto failed_sio_register; 2047 goto failed_sio_register;
@@ -2066,4 +2078,9 @@ MODULE_LICENSE("GPL");
2066 2078
2067module_param(debug, bool, S_IRUGO | S_IWUSR); 2079module_param(debug, bool, S_IRUGO | S_IWUSR);
2068MODULE_PARM_DESC(debug, "Debug enabled or not"); 2080MODULE_PARM_DESC(debug, "Debug enabled or not");
2081module_param(vendor, ushort, 0);
2082MODULE_PARM_DESC(vendor, "User specified vendor ID (default="
2083 __MODULE_STRING(FTDI_VID)")");
2084module_param(product, ushort, 0);
2085MODULE_PARM_DESC(vendor, "User specified product ID");
2069 2086