diff options
author | Dan Williams <dcbw@redhat.com> | 2012-07-23 15:26:07 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-08-16 12:48:03 -0400 |
commit | 731879f8e3d4c61220462160311fa650a8b96abf (patch) | |
tree | a1d50d30772f025647979a283bf284b26d3d083b | |
parent | 1e658489ba8d87b7c89ca6f734b8319acc534dbc (diff) |
USB: qcserial: fix port handling on Gobi 1K and 2K+
Bjorn's latest patchset does break Gobi 1K and 2K because on both
devices as it claims usb interface 0. That's because usbif 0 is not
handled in the switch statement, and thus the if0 gets claimed when it
should not. So let's just make things even simpler yet, and handle both
the 1K and 2K+ cases separately. This patch should not affect the new
Sierra device support, because those devices are matched via
interface-specific matching and thus should never hit the composite
code.
Signed-off-by: Dan Williams <dcbw@redhat.com>
Tested-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/usb/serial/qcserial.c | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c index 314ae8ceba41..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 | ||
241 | done: | 247 | done: |