public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Matthias G. Eckermann" <mge@arcor.de>
To: Greg Kroah-Hartman <gregkh@suse.de>,
	Matthew Garrett <mjg@redhat.com>,
	Anssi Hannula <anssi.hannula@gmail.com>,
	Bernhard Rosenkraenzer <bero@arklinux.org>,
	Andrew Bird <ajb@spheresytems.co.uk>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] (qcserial.c) Enable Diagnostics Monitor and GPS ports on Gobi 2000
Date: Fri, 24 Sep 2010 18:12:01 +0200	[thread overview]
Message-ID: <20100924161201.GA10482@arcor.de> (raw)

Hello all,

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 <mge@arcor.de>


--- 
diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c
index 2846ad8..1fac621 100644
--- a/drivers/usb/serial/qcserial.c
+++ b/drivers/usb/serial/qcserial.c
@@ -150,21 +150,50 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id)
 		break;
 
 	case 3:
 	case 4:
 		/* Composite mode */
-		if (ifnum == 2) {
+		/* ifnum == 0 is a broadband network adapter */
+		if (ifnum == 1) {
+			/* 
+			 * Diagnostics Monitor (serial line 9600 8N1)
+			 * Qualcomm DM protocol
+			 * use "libqcdm" (ModemManager) for communication
+			 */
+			dbg("Diagnostics Monitor found");
+			retval = usb_set_interface(serial->dev, ifnum, 0);
+			if (retval < 0) {
+				dev_err(&serial->dev->dev,
+					"Could not set interface, error %d\n",
+					retval);
+				retval = -ENODEV;
+			}
+		} else if (ifnum == 2) {
 			dbg("Modem port found");
 			retval = usb_set_interface(serial->dev, ifnum, 0);
 			if (retval < 0) {
 				dev_err(&serial->dev->dev,
 					"Could not set interface, error %d\n",
 					retval);
 				retval = -ENODEV;
 				kfree(data);
 			}
 			return retval;
+		} else if (ifnum==3) {
+			/* 
+			 * NMEA (serial line 9600 8N1)
+			 * # echo "\$GPS_START" > /dev/ttyUSBx
+			 * # echo "\$GPS_STOP"  > /dev/ttyUSBx
+			 */
+			dbg("NMEA GPS interface found");
+			retval = usb_set_interface(serial->dev, ifnum, 0);
+			if (retval < 0) {
+				dev_err(&serial->dev->dev,
+					"Could not set interface, error %d\n",
+					retval);
+				retval = -ENODEV;
+			}
 		}
 		break;
 
 	default:
 		dev_err(&serial->dev->dev,
-- 
Voluminous documentation is  part of the problem 
not part of the solution           (Tom DeMarco)
No documentation though is not a solution either 

                 reply	other threads:[~2010-09-24 16:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100924161201.GA10482@arcor.de \
    --to=mge@arcor.de \
    --cc=ajb@spheresytems.co.uk \
    --cc=anssi.hannula@gmail.com \
    --cc=bero@arklinux.org \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mjg@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox