diff options
Diffstat (limited to 'drivers/usb/serial/qcserial.c')
-rw-r--r-- | drivers/usb/serial/qcserial.c | 22 |
1 files changed, 22 insertions, 0 deletions
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 | ||
93 | static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id) | 95 | static 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 | ||
166 | static int __init qcinit(void) | 188 | static int __init qcinit(void) |