From: zwp Date: Thu, 22 Mar 2012 06:17:15 +0000 (+0800) Subject: change device number of mu509 from ttyUSB0/1/2 to ttyUSB244/245/246. X-Git-Tag: firefly_0821_release~9600^2~1 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=5d97a11bdb0f27cf79de61b5ccdda5a7775d40a2;p=firefly-linux-kernel-4.4.55.git change device number of mu509 from ttyUSB0/1/2 to ttyUSB244/245/246. --- 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");