]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ti_usb_3410_5052: add Multi-Tech modem support
authorChris Adams <cmadams@hiwaay.net>
Sun, 11 Jan 2009 19:49:00 +0000 (19:49 +0000)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 13 Jan 2009 00:37:01 +0000 (16:37 -0800)
Add Multi-Tech cellular modem support to the ti_usb_3410_5052 driver.

Signed-off-by: Chris Adams <cmadams@hiwaay.net>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/usb/serial/ti_usb_3410_5052.c
drivers/usb/serial/ti_usb_3410_5052.h

index 1cdb1515253d07f78a68c418071b3fe8055aea65..dbae9941baa9f7664d06b7d29613f0d4098a841d 100644 (file)
@@ -176,9 +176,14 @@ static unsigned int product_5052_count;
 /* the array dimension is the number of default entries plus */
 /* TI_EXTRA_VID_PID_COUNT user defined entries plus 1 terminating */
 /* null entry */
-static struct usb_device_id ti_id_table_3410[2+TI_EXTRA_VID_PID_COUNT+1] = {
+static struct usb_device_id ti_id_table_3410[7+TI_EXTRA_VID_PID_COUNT+1] = {
        { USB_DEVICE(TI_VENDOR_ID, TI_3410_PRODUCT_ID) },
        { USB_DEVICE(TI_VENDOR_ID, TI_3410_EZ430_ID) },
+       { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_NO_FW_PRODUCT_ID) },
+       { USB_DEVICE(MTS_VENDOR_ID, MTS_CDMA_NO_FW_PRODUCT_ID) },
+       { USB_DEVICE(MTS_VENDOR_ID, MTS_CDMA_PRODUCT_ID) },
+       { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_PRODUCT_ID) },
+       { USB_DEVICE(MTS_VENDOR_ID, MTS_EDGE_PRODUCT_ID) },
 };
 
 static struct usb_device_id ti_id_table_5052[4+TI_EXTRA_VID_PID_COUNT+1] = {
@@ -191,6 +196,11 @@ static struct usb_device_id ti_id_table_5052[4+TI_EXTRA_VID_PID_COUNT+1] = {
 static struct usb_device_id ti_id_table_combined[6+2*TI_EXTRA_VID_PID_COUNT+1] = {
        { USB_DEVICE(TI_VENDOR_ID, TI_3410_PRODUCT_ID) },
        { USB_DEVICE(TI_VENDOR_ID, TI_3410_EZ430_ID) },
+       { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_NO_FW_PRODUCT_ID) },
+       { USB_DEVICE(MTS_VENDOR_ID, MTS_CDMA_NO_FW_PRODUCT_ID) },
+       { USB_DEVICE(MTS_VENDOR_ID, MTS_CDMA_PRODUCT_ID) },
+       { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_PRODUCT_ID) },
+       { USB_DEVICE(MTS_VENDOR_ID, MTS_EDGE_PRODUCT_ID) },
        { USB_DEVICE(TI_VENDOR_ID, TI_5052_BOOT_PRODUCT_ID) },
        { USB_DEVICE(TI_VENDOR_ID, TI_5152_BOOT_PRODUCT_ID) },
        { USB_DEVICE(TI_VENDOR_ID, TI_5052_EEPROM_PRODUCT_ID) },
@@ -1689,10 +1699,26 @@ static int ti_download_firmware(struct ti_device *tdev)
        sprintf(buf, "ti_usb-v%04x-p%04x.fw", dev->descriptor.idVendor,
            dev->descriptor.idProduct);
        if ((status = request_firmware(&fw_p, buf, &dev->dev)) != 0) {
-               if (tdev->td_is_3410)
-                       strcpy(buf, "ti_3410.fw");
-               else
-                       strcpy(buf, "ti_5052.fw");
+               buf[0] = '\0';
+               if (dev->descriptor.idVendor == MTS_VENDOR_ID) {
+                       switch (dev->descriptor.idProduct) {
+                       case MTS_CDMA_PRODUCT_ID:
+                               strcpy(buf, "mts_cdma.fw");
+                               break;
+                       case MTS_GSM_PRODUCT_ID:
+                               strcpy(buf, "mts_gsm.fw");
+                               break;
+                       case MTS_EDGE_PRODUCT_ID:
+                               strcpy(buf, "mts_edge.fw");
+                               break;
+                       }
+               }
+               if (buf[0] == '\0') {
+                       if (tdev->td_is_3410)
+                               strcpy(buf, "ti_3410.fw");
+                       else
+                               strcpy(buf, "ti_5052.fw");
+               }
                status = request_firmware(&fw_p, buf, &dev->dev);
        }
        if (status) {
index b5541bf991ba7ff175e91ecaeb8d069568705a73..7e4752fbf232ee33c9254ed910cc68d7b78bd8d8 100644 (file)
 #define TI_5052_EEPROM_PRODUCT_ID      0x505A  /* EEPROM, no firmware */
 #define TI_5052_FIRMWARE_PRODUCT_ID    0x505F  /* firmware is running */
 
+/* Multi-Tech vendor and product ids */
+#define MTS_VENDOR_ID                  0x06E0
+#define MTS_GSM_NO_FW_PRODUCT_ID       0xF108
+#define MTS_CDMA_NO_FW_PRODUCT_ID      0xF109
+#define MTS_CDMA_PRODUCT_ID            0xF110
+#define MTS_GSM_PRODUCT_ID             0xF111
+#define MTS_EDGE_PRODUCT_ID            0xF112
+
 /* Commands */
 #define TI_GET_VERSION                 0x01
 #define TI_GET_PORT_STATUS             0x02