aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/qcserial.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/qcserial.c')
-rw-r--r--drivers/usb/serial/qcserial.c47
1 files changed, 26 insertions, 21 deletions
diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c
index 8d103019d6aa..bfd50779f0c9 100644
--- a/drivers/usb/serial/qcserial.c
+++ b/drivers/usb/serial/qcserial.c
@@ -199,43 +199,49 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id)
199 199
200 /* default to enabling interface */ 200 /* default to enabling interface */
201 altsetting = 0; 201 altsetting = 0;
202 switch (ifnum) {
203 /* Composite mode; don't bind to the QMI/net interface as that
204 * gets handled by other drivers.
205 */
206 202
203 /* Composite mode; don't bind to the QMI/net interface as that
204 * gets handled by other drivers.
205 */
206
207 if (is_gobi1k) {
207 /* Gobi 1K USB layout: 208 /* Gobi 1K USB layout:
208 * 0: serial port (doesn't respond) 209 * 0: serial port (doesn't respond)
209 * 1: serial port (doesn't respond) 210 * 1: serial port (doesn't respond)
210 * 2: AT-capable modem port 211 * 2: AT-capable modem port
211 * 3: QMI/net 212 * 3: QMI/net
212 * 213 */
213 * Gobi 2K+ USB layout: 214 if (ifnum == 2)
215 dev_dbg(dev, "Modem port found\n");
216 else
217 altsetting = -1;
218 } else {
219 /* Gobi 2K+ USB layout:
214 * 0: QMI/net 220 * 0: QMI/net
215 * 1: DM/DIAG (use libqcdm from ModemManager for communication) 221 * 1: DM/DIAG (use libqcdm from ModemManager for communication)
216 * 2: AT-capable modem port 222 * 2: AT-capable modem port
217 * 3: NMEA 223 * 3: NMEA
218 */ 224 */
219 225 switch (ifnum) {
220 case 1: 226 case 0:
221 if (is_gobi1k) 227 /* Don't claim the QMI/net interface */
222 altsetting = -1; 228 altsetting = -1;
223 else 229 break;
230 case 1:
224 dev_dbg(dev, "Gobi 2K+ DM/DIAG interface found\n"); 231 dev_dbg(dev, "Gobi 2K+ DM/DIAG interface found\n");
225 break; 232 break;
226 case 2: 233 case 2:
227 dev_dbg(dev, "Modem port found\n"); 234 dev_dbg(dev, "Modem port found\n");
228 break; 235 break;
229 case 3: 236 case 3:
230 if (is_gobi1k)
231 altsetting = -1;
232 else
233 /* 237 /*
234 * NMEA (serial line 9600 8N1) 238 * NMEA (serial line 9600 8N1)
235 * # echo "\$GPS_START" > /dev/ttyUSBx 239 * # echo "\$GPS_START" > /dev/ttyUSBx
236 * # echo "\$GPS_STOP" > /dev/ttyUSBx 240 * # echo "\$GPS_STOP" > /dev/ttyUSBx
237 */ 241 */
238 dev_dbg(dev, "Gobi 2K+ NMEA GPS interface found\n"); 242 dev_dbg(dev, "Gobi 2K+ NMEA GPS interface found\n");
243 break;
244 }
239 } 245 }
240 246
241done: 247done:
@@ -262,8 +268,7 @@ static void qc_release(struct usb_serial *serial)
262{ 268{
263 struct usb_wwan_intf_private *priv = usb_get_serial_data(serial); 269 struct usb_wwan_intf_private *priv = usb_get_serial_data(serial);
264 270
265 /* Call usb_wwan release & free the private data allocated in qcprobe */ 271 /* Free the private data allocated in qcprobe */
266 usb_wwan_release(serial);
267 usb_set_serial_data(serial, NULL); 272 usb_set_serial_data(serial, NULL);
268 kfree(priv); 273 kfree(priv);
269} 274}
@@ -283,8 +288,8 @@ static struct usb_serial_driver qcdevice = {
283 .write_room = usb_wwan_write_room, 288 .write_room = usb_wwan_write_room,
284 .chars_in_buffer = usb_wwan_chars_in_buffer, 289 .chars_in_buffer = usb_wwan_chars_in_buffer,
285 .attach = usb_wwan_startup, 290 .attach = usb_wwan_startup,
286 .disconnect = usb_wwan_disconnect,
287 .release = qc_release, 291 .release = qc_release,
292 .port_remove = usb_wwan_port_remove,
288#ifdef CONFIG_PM 293#ifdef CONFIG_PM
289 .suspend = usb_wwan_suspend, 294 .suspend = usb_wwan_suspend,
290 .resume = usb_wwan_resume, 295 .resume = usb_wwan_resume,