diff options
| author | Greg Kroah-Hartman <gregkh@suse.de> | 2008-05-02 12:26:42 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-05-02 12:26:42 -0700 |
| commit | e3d8ee3c944048f64b453c715a4c41d3bc395f47 (patch) | |
| tree | 3c4042bb9f93291e88ed32b6358d26a099cc23a3 /usb | |
| parent | 836ea648e169f09d9150e97edff583547d9be6ee (diff) | |
| download | patches-e3d8ee3c944048f64b453c715a4c41d3bc395f47.tar.gz | |
new usb driver for motorola phones
Diffstat (limited to 'usb')
| -rw-r--r-- | usb/ti_usb-kick-firmware-into-user-space.patch | 21 | ||||
| -rw-r--r-- | usb/usb-add-new-moto_modem-driver-for-some-morotola-phones.patch | 120 |
2 files changed, 130 insertions, 11 deletions
diff --git a/usb/ti_usb-kick-firmware-into-user-space.patch b/usb/ti_usb-kick-firmware-into-user-space.patch index f18f5705ae9792..811df39bcdc96b 100644 --- a/usb/ti_usb-kick-firmware-into-user-space.patch +++ b/usb/ti_usb-kick-firmware-into-user-space.patch @@ -18,12 +18,12 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> drivers/usb/serial/Kconfig | 8 ++ drivers/usb/serial/ti_fw_3410.h | 4 + drivers/usb/serial/ti_fw_5052.h | 5 + - drivers/usb/serial/ti_usb_3410_5052.c | 108 ++++++++++++++++++++++------------ - 4 files changed, 88 insertions(+), 37 deletions(-) + drivers/usb/serial/ti_usb_3410_5052.c | 106 ++++++++++++++++++++++------------ + 4 files changed, 87 insertions(+), 36 deletions(-) --- a/drivers/usb/serial/Kconfig +++ b/drivers/usb/serial/Kconfig -@@ -514,6 +514,14 @@ config USB_SERIAL_TI +@@ -523,6 +523,14 @@ config USB_SERIAL_TI To compile this driver as a module, choose M here: the module will be called ti_usb_3410_5052. @@ -146,11 +146,10 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> - - memcpy(buffer, firmware, firmware_size); - memset(buffer+firmware_size, 0xff, buffer_size-firmware_size); -- -- for(pos = sizeof(struct ti_firmware_header); pos < buffer_size; pos++) + int status; + int len; -+ + +- for(pos = sizeof(struct ti_firmware_header); pos < buffer_size; pos++) + for(pos = sizeof(struct ti_firmware_header); pos < size; pos++) cs = (__u8)(cs + buffer[pos]); @@ -174,8 +173,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + return status; +} + - -- kfree(buffer); ++ +static int ti_download_firmware(struct ti_device *tdev, int type) +{ + int status = -ENOMEM; @@ -185,7 +183,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + unsigned int pipe = usb_sndbulkpipe(dev, + tdev->td_serial->port[0]->bulk_out_endpointAddress); + const struct firmware *fw_p; - ++ +#ifdef CONFIG_USB_SERIAL_TI_FIRMWARE + switch (type) { + case 3410: @@ -200,7 +198,8 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> +#else + char buf[32]; + sprintf(buf, "ti_usb-%d.bin", type); -+ + +- kfree(buffer); + if (request_firmware(&fw_p, buf, &dev->dev)) { + dev_err(&dev->dev, "%s - firmware not found\n", __func__); + return -ENOENT; @@ -210,7 +209,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + return -ENOENT; + } +#endif -+ + + buffer_size = TI_FIRMWARE_BUF_SIZE + sizeof(struct ti_firmware_header); + buffer = kmalloc(buffer_size, GFP_KERNEL); + if (buffer) { diff --git a/usb/usb-add-new-moto_modem-driver-for-some-morotola-phones.patch b/usb/usb-add-new-moto_modem-driver-for-some-morotola-phones.patch new file mode 100644 index 00000000000000..a6054b0bc4fff6 --- /dev/null +++ b/usb/usb-add-new-moto_modem-driver-for-some-morotola-phones.patch @@ -0,0 +1,120 @@ +From foo@baz Tue Apr 9 12:12:43 2002 +Date: Fri, 2 May 2008 12:02:20 -0700 +To: Greg KH <greg@kroah.com> +From: Greg Kroah-Hartman <gregkh@suse.de> +Subject: USB: add new moto_modem driver for some Morotola phones + +This should work on a KRZR K1m, and some other Motorola phones that do +not use the "standard" cdc ACM protocol to talk to USB hosts. + +Cc: Jeff Garzik <jeff@garzik.org> +Cc: Jiang Dejun <a5652c@motorola.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/serial/Kconfig | 9 +++++ + drivers/usb/serial/Makefile | 1 + drivers/usb/serial/moto_modem.c | 70 ++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 80 insertions(+) + +--- a/drivers/usb/serial/Kconfig ++++ b/drivers/usb/serial/Kconfig +@@ -447,6 +447,15 @@ config USB_SERIAL_MOS7840 + To compile this driver as a module, choose M here: the + module will be called mos7840. If unsure, choose N. + ++config USB_SERIAL_MOTOROLA ++ tristate "USB Motorola Phone modem driver" ++ ---help--- ++ Say Y here if you want to use a Motorola phone with a USB ++ connector as a modem link. ++ ++ To compile this driver as a module, choose M here: the ++ module will be called moto_modem. If unsure, choose N. ++ + config USB_SERIAL_NAVMAN + tristate "USB Navman GPS device" + help +--- a/drivers/usb/serial/Makefile ++++ b/drivers/usb/serial/Makefile +@@ -39,6 +39,7 @@ obj-$(CONFIG_USB_SERIAL_KOBIL_SCT) += k + obj-$(CONFIG_USB_SERIAL_MCT_U232) += mct_u232.o + obj-$(CONFIG_USB_SERIAL_MOS7720) += mos7720.o + obj-$(CONFIG_USB_SERIAL_MOS7840) += mos7840.o ++obj-$(CONFIG_USB_SERIAL_MOTOROLA) += moto_modem.o + obj-$(CONFIG_USB_SERIAL_NAVMAN) += navman.o + obj-$(CONFIG_USB_SERIAL_OMNINET) += omninet.o + obj-$(CONFIG_USB_SERIAL_OPTION) += option.o +--- /dev/null ++++ b/drivers/usb/serial/moto_modem.c +@@ -0,0 +1,70 @@ ++/* ++ * Motorola USB Phone driver ++ * ++ * Copyright (C) 2008 Greg Kroah-Hartman <greg@kroah.com> ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ * {sigh} ++ * Mororola should be using the CDC ACM USB spec, but instead ++ * they try to just "do their own thing"... This driver should handle a ++ * few phones in which a basic "dumb serial connection" is needed to be ++ * able to get a connection through to them. ++ */ ++ ++#include <linux/kernel.h> ++#include <linux/init.h> ++#include <linux/tty.h> ++#include <linux/module.h> ++#include <linux/usb.h> ++#include <linux/usb/serial.h> ++ ++static struct usb_device_id id_table [] = { ++ { USB_DEVICE(0x05c6, 0x3197) }, /* unknown Motorola phone */ ++ { USB_DEVICE(0x0c44, 0x0022) }, /* unknown Mororola phone */ ++ { USB_DEVICE(0x22b8, 0x2a64) }, /* Motorola KRZR K1m */ ++ { }, ++}; ++MODULE_DEVICE_TABLE(usb, id_table); ++ ++static struct usb_driver moto_driver = { ++ .name = "moto-modem", ++ .probe = usb_serial_probe, ++ .disconnect = usb_serial_disconnect, ++ .id_table = id_table, ++ .no_dynamic_id = 1, ++}; ++ ++static struct usb_serial_driver moto_device = { ++ .driver = { ++ .owner = THIS_MODULE, ++ .name = "moto-modem", ++ }, ++ .id_table = id_table, ++ .num_ports = 1, ++}; ++ ++static int __init moto_init(void) ++{ ++ int retval; ++ ++ retval = usb_serial_register(&moto_device); ++ if (retval) ++ return retval; ++ retval = usb_register(&moto_driver); ++ if (retval) ++ usb_serial_deregister(&moto_device); ++ return retval; ++} ++ ++static void __exit moto_exit(void) ++{ ++ usb_deregister(&moto_driver); ++ usb_serial_deregister(&moto_device); ++} ++ ++module_init(moto_init); ++module_exit(moto_exit); ++MODULE_LICENSE("GPL"); |
