public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Maciej Szmigiero <mhej@o2.pl>
To: Sergei Shtylyov <sshtylyov@mvista.com>
Cc: Greg KH <gregkh@suse.de>, Johan Hovold <jhovold@gmail.com>,
	Joe Perches <joe@perches.com>, Alan Cox <alan@linux.intel.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [USB]Add Samsung SGH-I500/Android modem ID switch to visor driver
Date: Sun, 06 Feb 2011 21:04:19 +0100	[thread overview]
Message-ID: <4D4EFEC3.5030702@o2.pl> (raw)
In-Reply-To: <4D4DDD54.1010905@ru.mvista.com>

W dniu 06.02.2011 00:29, Sergei Shtylyov pisze:
> Hello.
> 
> On 06.02.2011 0:41, Maciej Szmigiero wrote:
> 
>> New version of patch which autodetects devices with ACM class.
>> Tested on Galaxy Spica.
> 
>> Signed-off-by: Maciej Szmigiero <mhej@o2.pl>
> 
>> diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c
>> index 15a5d89..e1c4527 100644
>> --- a/drivers/usb/serial/visor.c
>> +++ b/drivers/usb/serial/visor.c
> [...]
>> @@ -479,6 +480,15 @@ static int visor_probe(struct usb_serial *serial,
>>
>>       dbg("%s", __func__);
>>
>> +    /* some Samsung Android phones in modem mode have the same ID */
>> +    /* as SPH-I500, but they are ACM devices, so dont bind to them */
> 
>    The preferred style for the multi-line comments is this:
> 
> /*
>  * bla
>  * bla
>  */
> 
>> +    if ((id->idVendor == SAMSUNG_VENDOR_ID)&&
>> +        (id->idProduct == SAMSUNG_SPH_I500_ID)&&
>> +        (serial->dev->descriptor.bDeviceClass == USB_CLASS_COMM)&&
>> +        (serial->dev->descriptor.bDeviceSubClass ==
>> +            USB_CDC_SUBCLASS_ACM))
> 
>    Parens around == not necessary...
> 
> WBR, Sergei

Thanks for comments, new version of this patch with style fixes follows.

Best regards,
Maciej Szmigiero

Signed-off-by: Maciej Szmigiero <mhej@o2.pl>

diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c
index 15a5d89..0f75948 100644
--- a/drivers/usb/serial/visor.c
+++ b/drivers/usb/serial/visor.c
@@ -27,6 +27,7 @@
 #include <linux/uaccess.h>
 #include <linux/usb.h>
 #include <linux/usb/serial.h>
+#include <linux/usb/cdc.h>
 #include "visor.h"
 
 /*
@@ -479,6 +480,17 @@ static int visor_probe(struct usb_serial *serial,
 
 	dbg("%s", __func__);
 
+	/*
+	 * some Samsung Android phones in modem mode have the same ID
+	 * as SPH-I500, but they are ACM devices, so dont bind to them
+	*/
+	if (id->idVendor == SAMSUNG_VENDOR_ID &&
+		id->idProduct == SAMSUNG_SPH_I500_ID &&
+		serial->dev->descriptor.bDeviceClass == USB_CLASS_COMM &&
+		serial->dev->descriptor.bDeviceSubClass ==
+			USB_CDC_SUBCLASS_ACM)
+		return -ENODEV;
+
 	if (serial->dev->actconfig->desc.bConfigurationValue != 1) {
 		dev_err(&serial->dev->dev, "active config #%d != 1 ??\n",
 			serial->dev->actconfig->desc.bConfigurationValue);



  reply	other threads:[~2011-02-06 20:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-05 19:04 [USB]Add Samsung SGH-I500/Android modem ID switch to visor driver Maciej Szmigiero
2011-02-05 19:28 ` Greg KH
2011-02-05 19:40   ` Maciej Szmigiero
2011-02-05 21:41   ` Maciej Szmigiero
2011-02-05 23:29     ` Sergei Shtylyov
2011-02-06 20:04       ` Maciej Szmigiero [this message]
2011-02-07 11:25         ` Sergei Shtylyov
2011-02-07 11:42           ` Maciej Szmigiero

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=4D4EFEC3.5030702@o2.pl \
    --to=mhej@o2.pl \
    --cc=alan@linux.intel.com \
    --cc=gregkh@suse.de \
    --cc=jhovold@gmail.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=sshtylyov@mvista.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