aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial
diff options
context:
space:
mode:
authorMatthew Garrett <mjg@redhat.com>2010-04-01 12:31:09 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-05-20 16:21:37 -0400
commit3d7e59ad88fdb6bc50ae9b7e822d4bb5f68b68f9 (patch)
treed7ed39b734ef2cdf4591f18195230c609ea578c1 /drivers/usb/serial
parent8b4c6a3ab596961b784659c71dc24b341f938a1a (diff)
USB: qcserial: Use generic USB wwan code
Make qcserial use the generic USB wwan code. This should result in a performance improvement. Signed-off-by: Matthew Garrett <mjg@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r--drivers/usb/serial/Kconfig1
-rw-r--r--drivers/usb/serial/qcserial.c22
2 files changed, 23 insertions, 0 deletions
diff --git a/drivers/usb/serial/Kconfig b/drivers/usb/serial/Kconfig
index fdc889dc9fd8..efb6dc7aa450 100644
--- a/drivers/usb/serial/Kconfig
+++ b/drivers/usb/serial/Kconfig
@@ -485,6 +485,7 @@ config USB_SERIAL_QCAUX
485 485
486config USB_SERIAL_QUALCOMM 486config USB_SERIAL_QUALCOMM
487 tristate "USB Qualcomm Serial modem" 487 tristate "USB Qualcomm Serial modem"
488 select USB_SERIAL_WWAN
488 help 489 help
489 Say Y here if you have a Qualcomm USB modem device. These are 490 Say Y here if you have a Qualcomm USB modem device. These are
490 usually wireless cellular modems. 491 usually wireless cellular modems.
diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c
index 53a2d5a935a2..9215f6c582c3 100644
--- a/drivers/usb/serial/qcserial.c
+++ b/drivers/usb/serial/qcserial.c
@@ -15,6 +15,8 @@
15#include <linux/tty_flip.h> 15#include <linux/tty_flip.h>
16#include <linux/usb.h> 16#include <linux/usb.h>
17#include <linux/usb/serial.h> 17#include <linux/usb/serial.h>
18#include <linux/slab.h>
19#include "usb-wwan.h"
18 20
19#define DRIVER_AUTHOR "Qualcomm Inc" 21#define DRIVER_AUTHOR "Qualcomm Inc"
20#define DRIVER_DESC "Qualcomm USB Serial driver" 22#define DRIVER_DESC "Qualcomm USB Serial driver"
@@ -92,6 +94,7 @@ static struct usb_driver qcdriver = {
92 94
93static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id) 95static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id)
94{ 96{
97 struct usb_wwan_intf_private *data;
95 int retval = -ENODEV; 98 int retval = -ENODEV;
96 __u8 nintf; 99 __u8 nintf;
97 __u8 ifnum; 100 __u8 ifnum;
@@ -103,6 +106,13 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id)
103 ifnum = serial->interface->cur_altsetting->desc.bInterfaceNumber; 106 ifnum = serial->interface->cur_altsetting->desc.bInterfaceNumber;
104 dbg("This Interface = %d", ifnum); 107 dbg("This Interface = %d", ifnum);
105 108
109 data = serial->private = kzalloc(sizeof(struct usb_wwan_intf_private),
110 GFP_KERNEL);
111 if (!data)
112 return -ENOMEM;
113
114 spin_lock_init(&data->susp_lock);
115
106 switch (nintf) { 116 switch (nintf) {
107 case 1: 117 case 1:
108 /* QDL mode */ 118 /* QDL mode */
@@ -161,6 +171,18 @@ static struct usb_serial_driver qcdevice = {
161 .usb_driver = &qcdriver, 171 .usb_driver = &qcdriver,
162 .num_ports = 1, 172 .num_ports = 1,
163 .probe = qcprobe, 173 .probe = qcprobe,
174 .open = usb_wwan_open,
175 .close = usb_wwan_close,
176 .write = usb_wwan_write,
177 .write_room = usb_wwan_write_room,
178 .chars_in_buffer = usb_wwan_chars_in_buffer,
179 .attach = usb_wwan_startup,
180 .disconnect = usb_wwan_disconnect,
181 .release = usb_wwan_release,
182#ifdef CONFIG_PM
183 .suspend = usb_wwan_suspend,
184 .resume = usb_wwan_resume,
185#endif
164}; 186};
165 187
166static int __init qcinit(void) 188static int __init qcinit(void)