Skip to content

Commit 1992de8

Browse files
Matthias G. Eckermanngregkh
authored andcommitted
USB: qcserial: Enable Diagnostics Monitor and GPS ports on Gobi 2000
this patch to qcserial.c enables the Diagnostics Monitor and NMEA GPS ports on Qualcomm Gobi 2000 devices. A Gobi 2000 device will provide 3 serial ports: # /dev/ttyUSB0 -> Diagnostics # /dev/ttyUSB1 -> 3G Modem # /dev/ttyUSB2 -> NMEA GPS port * The Diagnostics Monitor uses Qualcomm's DM protocol; I used libqcdm (ModemManager) to talk to it, found it working, but at least DM commands 12 and 64 are not implemented on my device (Gobi 2000 built into Thinkpad x100e). * Functionality of the 3G Modem port remains unchanged. * The GPS port and how to enable it has been confirmed now in the Gobi 3000 source code at: https://www.codeaurora.org/patches/quic/gobi/ Enable/disable GPS via: echo "\$GPS_START" > /dev/ttyUSB2 # use GPS echo "\$GPS_STOP" > /dev/ttyUSB2 Signed-off-by: Matthias G. Eckermann <[email protected]>
1 parent 6195e3c commit 1992de8

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

drivers/usb/serial/qcserial.c

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,22 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id)
152152
case 3:
153153
case 4:
154154
/* Composite mode */
155-
if (ifnum == 2) {
155+
/* ifnum == 0 is a broadband network adapter */
156+
if (ifnum == 1) {
157+
/*
158+
* Diagnostics Monitor (serial line 9600 8N1)
159+
* Qualcomm DM protocol
160+
* use "libqcdm" (ModemManager) for communication
161+
*/
162+
dbg("Diagnostics Monitor found");
163+
retval = usb_set_interface(serial->dev, ifnum, 0);
164+
if (retval < 0) {
165+
dev_err(&serial->dev->dev,
166+
"Could not set interface, error %d\n",
167+
retval);
168+
retval = -ENODEV;
169+
}
170+
} else if (ifnum == 2) {
156171
dbg("Modem port found");
157172
retval = usb_set_interface(serial->dev, ifnum, 0);
158173
if (retval < 0) {
@@ -163,6 +178,20 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id)
163178
kfree(data);
164179
}
165180
return retval;
181+
} else if (ifnum==3) {
182+
/*
183+
* NMEA (serial line 9600 8N1)
184+
* # echo "\$GPS_START" > /dev/ttyUSBx
185+
* # echo "\$GPS_STOP" > /dev/ttyUSBx
186+
*/
187+
dbg("NMEA GPS interface found");
188+
retval = usb_set_interface(serial->dev, ifnum, 0);
189+
if (retval < 0) {
190+
dev_err(&serial->dev->dev,
191+
"Could not set interface, error %d\n",
192+
retval);
193+
retval = -ENODEV;
194+
}
166195
}
167196
break;
168197

0 commit comments

Comments
 (0)