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.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c
index cde67cacb2c3..8858201eb1d3 100644
--- a/drivers/usb/serial/qcserial.c
+++ b/drivers/usb/serial/qcserial.c
@@ -118,6 +118,8 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id)
118 118
119 spin_lock_init(&data->susp_lock); 119 spin_lock_init(&data->susp_lock);
120 120
121 usb_enable_autosuspend(serial->dev);
122
121 switch (nintf) { 123 switch (nintf) {
122 case 1: 124 case 1:
123 /* QDL mode */ 125 /* QDL mode */
@@ -150,7 +152,22 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id)
150 case 3: 152 case 3:
151 case 4: 153 case 4:
152 /* Composite mode */ 154 /* Composite mode */
153 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) {
154 dbg("Modem port found"); 171 dbg("Modem port found");
155 retval = usb_set_interface(serial->dev, ifnum, 0); 172 retval = usb_set_interface(serial->dev, ifnum, 0);
156 if (retval < 0) { 173 if (retval < 0) {
@@ -161,6 +178,20 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id)
161 kfree(data); 178 kfree(data);
162 } 179 }
163 return retval; 180 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 }
164 } 195 }
165 break; 196 break;
166 197