From 5d97a11bdb0f27cf79de61b5ccdda5a7775d40a2 Mon Sep 17 00:00:00 2001 From: zwp Date: Thu, 22 Mar 2012 14:17:15 +0800 Subject: [PATCH] change device number of mu509 from ttyUSB0/1/2 to ttyUSB244/245/246. --- drivers/usb/serial/usb-serial.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) mode change 100644 => 100755 drivers/usb/serial/usb-serial.c diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c old mode 100644 new mode 100755 index 1c031309ab25..677c3b9eee75 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c @@ -53,6 +53,10 @@ static struct usb_driver usb_serial_driver = { .no_dynamic_id = 1, .supports_autosuspend = 1, }; +#ifdef CONFIG_MU509 +static int MU509_USB = 0; +#define MU509_USB_PORT (SERIAL_TTY_MINORS - 10) +#endif /* There is no MODULE_DEVICE_TABLE for usbserial.c. Instead the MODULE_DEVICE_TABLE declarations in each serial driver @@ -97,12 +101,17 @@ static struct usb_serial *get_free_serial(struct usb_serial *serial, { unsigned int i, j; int good_spot; + int a=0; dbg("%s %d", __func__, num_ports); *minor = 0; mutex_lock(&table_lock); - for (i = 0; i < SERIAL_TTY_MINORS; ++i) { +#ifdef CONFIG_MU509 + if (MU509_USB) + a= MU509_USB_PORT; +#endif + for (i = a; i < SERIAL_TTY_MINORS; ++i) { if (serial_table[i]) continue; @@ -1058,6 +1067,12 @@ int usb_serial_probe(struct usb_interface *interface, } else { serial->attached = 1; } +#ifdef CONFIG_MU509 + if ((le16_to_cpu(dev->descriptor.idVendor) == 0x12D1 ) && (le16_to_cpu(dev->descriptor.idProduct) == 0x1001)) + MU509_USB =1; + else + MU509_USB = 0; +#endif if (get_free_serial(serial, num_ports, &minor) == NULL) { dev_err(&interface->dev, "No more free serial devices\n"); -- 2.34.1