All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] USB: serial: simple: add sierra wireless xm1210 gnss receiver
@ 2021-10-27 20:02 ferlandm
  2021-11-17 13:36 ` Greg KH
  2021-12-20 11:20 ` Johan Hovold
  0 siblings, 2 replies; 4+ messages in thread
From: ferlandm @ 2021-10-27 20:02 UTC (permalink / raw)
  To: johan; +Cc: gregkh, linux-usb, linux-kernel, Marc Ferland

From: Marc Ferland <ferlandm@amotus.ca>

Add device id for the Sierra Wireless XM1210 Multi-GNSS module.

https://www.sierrawireless.com/iot-solutions/products/xm1210/

$ lsusb -vd 1199:b000

Bus 002 Device 003: ID 1199:b000 Sierra Wireless, Inc. Sierra Wireless_GNSS
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.00
  bDeviceClass            0
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x1199 Sierra Wireless, Inc.
  idProduct          0xb000
  bcdDevice            0.01
  iManufacturer           1 Sierra-wireless
  iProduct                2 Sierra Wireless_GNSS
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0020
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xc0
      Self Powered
    MaxPower               50mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         0
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval             255
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval             255
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0001
  Self Powered

Device is also working correctly with:

$ echo 0x1199 0xb000 > /sys/bus/usb-serial/drivers/generic/new_id

Signed-off-by: Marc Ferland <ferlandm@amotus.ca>
---
 drivers/usb/serial/Kconfig             | 1 +
 drivers/usb/serial/usb-serial-simple.c | 7 +++++++
 2 files changed, 8 insertions(+)

diff --git a/drivers/usb/serial/Kconfig b/drivers/usb/serial/Kconfig
index de5c01257060..8008c8cbaaa0 100644
--- a/drivers/usb/serial/Kconfig
+++ b/drivers/usb/serial/Kconfig
@@ -68,6 +68,7 @@ config USB_SERIAL_SIMPLE
 		- Motorola Tetra devices
 		- Novatel Wireless GPS receivers
 		- Siemens USB/MPI adapter.
+		- Sierra Wireless GPS receiver.
 		- ViVOtech ViVOpay USB device.
 		- Infineon Modem Flashloader USB interface
 		- ZIO Motherboard USB serial interface
diff --git a/drivers/usb/serial/usb-serial-simple.c b/drivers/usb/serial/usb-serial-simple.c
index bd23a7cb1be2..9ffd24c7fb33 100644
--- a/drivers/usb/serial/usb-serial-simple.c
+++ b/drivers/usb/serial/usb-serial-simple.c
@@ -112,6 +112,11 @@ DEVICE(suunto, SUUNTO_IDS);
 	{ USB_DEVICE(0x908, 0x0004) }
 DEVICE(siemens_mpi, SIEMENS_IDS);
 
+/* Sierra Wireless_GNSS driver */
+#define SIERRA_IDS()		\
+	{ USB_DEVICE(0x1199, 0xb000) }
+DEVICE(sierra, SIERRA_IDS);
+
 /* All of the above structures mushed into two lists */
 static struct usb_serial_driver * const serial_drivers[] = {
 	&carelink_device,
@@ -127,6 +132,7 @@ static struct usb_serial_driver * const serial_drivers[] = {
 	&hp4x_device,
 	&suunto_device,
 	&siemens_mpi_device,
+	&sierra_device,
 	NULL
 };
 
@@ -144,6 +150,7 @@ static const struct usb_device_id id_table[] = {
 	HP4X_IDS(),
 	SUUNTO_IDS(),
 	SIEMENS_IDS(),
+	SIERRA_IDS(),
 	{ },
 };
 MODULE_DEVICE_TABLE(usb, id_table);
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] USB: serial: simple: add sierra wireless xm1210 gnss receiver
  2021-10-27 20:02 [PATCH] USB: serial: simple: add sierra wireless xm1210 gnss receiver ferlandm
@ 2021-11-17 13:36 ` Greg KH
  2021-11-18 16:09   ` Marc Ferland
  2021-12-20 11:20 ` Johan Hovold
  1 sibling, 1 reply; 4+ messages in thread
From: Greg KH @ 2021-11-17 13:36 UTC (permalink / raw)
  To: ferlandm; +Cc: johan, linux-usb, linux-kernel

On Wed, Oct 27, 2021 at 04:02:23PM -0400, ferlandm@amotus.ca wrote:
> From: Marc Ferland <ferlandm@amotus.ca>
> 
> Add device id for the Sierra Wireless XM1210 Multi-GNSS module.
> 
> https://www.sierrawireless.com/iot-solutions/products/xm1210/
> 
> $ lsusb -vd 1199:b000
> 
> Bus 002 Device 003: ID 1199:b000 Sierra Wireless, Inc. Sierra Wireless_GNSS

Why doesn't this device work with the qcserial.c driver instead?  Have
you tried that?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] USB: serial: simple: add sierra wireless xm1210 gnss receiver
  2021-11-17 13:36 ` Greg KH
@ 2021-11-18 16:09   ` Marc Ferland
  0 siblings, 0 replies; 4+ messages in thread
From: Marc Ferland @ 2021-11-18 16:09 UTC (permalink / raw)
  To: Greg KH; +Cc: johan, linux-usb, linux-kernel

On Wed, Nov 17, 2021 at 8:36 AM Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Wed, Oct 27, 2021 at 04:02:23PM -0400, ferlandm@amotus.ca wrote:
> > From: Marc Ferland <ferlandm@amotus.ca>
> >
> > Add device id for the Sierra Wireless XM1210 Multi-GNSS module.
> >
> > https://www.sierrawireless.com/iot-solutions/products/xm1210/
> >
> > $ lsusb -vd 1199:b000
> >
> > Bus 002 Device 003: ID 1199:b000 Sierra Wireless, Inc. Sierra Wireless_GNSS
>
> Why doesn't this device work with the qcserial.c driver instead?  Have
> you tried that?
>

I just tried adding the USB_ID to the qcserial driver and it fails
with -ENODEV. Looking at the code it seems qcserial only supports the
USB_CLASS_VENDOR_SPEC interface class and this device returns an
interface class value of 0 (reserved?):

$ lsusb -vd 1199:b000 | grep bInterfaceClass
      bInterfaceClass         0

Thanks,

Marc

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] USB: serial: simple: add sierra wireless xm1210 gnss receiver
  2021-10-27 20:02 [PATCH] USB: serial: simple: add sierra wireless xm1210 gnss receiver ferlandm
  2021-11-17 13:36 ` Greg KH
@ 2021-12-20 11:20 ` Johan Hovold
  1 sibling, 0 replies; 4+ messages in thread
From: Johan Hovold @ 2021-12-20 11:20 UTC (permalink / raw)
  To: ferlandm; +Cc: gregkh, linux-usb, linux-kernel

On Wed, Oct 27, 2021 at 04:02:23PM -0400, ferlandm@amotus.ca wrote:
> From: Marc Ferland <ferlandm@amotus.ca>
> 
> Add device id for the Sierra Wireless XM1210 Multi-GNSS module.
> 
> https://www.sierrawireless.com/iot-solutions/products/xm1210/
> 
> $ lsusb -vd 1199:b000
> 
> Bus 002 Device 003: ID 1199:b000 Sierra Wireless, Inc. Sierra Wireless_GNSS
> Device Descriptor:
>   bLength                18
>   bDescriptorType         1
>   bcdUSB               1.00
>   bDeviceClass            0
>   bDeviceSubClass         0
>   bDeviceProtocol         0
>   bMaxPacketSize0        64
>   idVendor           0x1199 Sierra Wireless, Inc.
>   idProduct          0xb000
>   bcdDevice            0.01
>   iManufacturer           1 Sierra-wireless
>   iProduct                2 Sierra Wireless_GNSS
>   iSerial                 0
>   bNumConfigurations      1
>   Configuration Descriptor:
>     bLength                 9
>     bDescriptorType         2
>     wTotalLength       0x0020
>     bNumInterfaces          1
>     bConfigurationValue     1
>     iConfiguration          0
>     bmAttributes         0xc0
>       Self Powered
>     MaxPower               50mA
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        0
>       bAlternateSetting       0
>       bNumEndpoints           2
>       bInterfaceClass         0
>       bInterfaceSubClass      0
>       bInterfaceProtocol      0
>       iInterface              0
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x81  EP 1 IN
>         bmAttributes            2
>           Transfer Type            Bulk
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x0040  1x 64 bytes
>         bInterval             255
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x01  EP 1 OUT
>         bmAttributes            2
>           Transfer Type            Bulk
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x0040  1x 64 bytes
>         bInterval             255
> can't get debug descriptor: Resource temporarily unavailable
> Device Status:     0x0001
>   Self Powered
> 
> Device is also working correctly with:
> 
> $ echo 0x1199 0xb000 > /sys/bus/usb-serial/drivers/generic/new_id
> 
> Signed-off-by: Marc Ferland <ferlandm@amotus.ca>

Sorry about the late reply on this.

I've been meaning to look into adding USB support to the GNSS subsystem
and using that instead of USB serial, but I've been really short on time
lately.

The GNSS subsystem provides a generic interface to user-space regardless
of the type of interface used (e.g. serial, i2c, spi, USB) and can be
extended with GNSS specific features (e.g. power control signals) as
needed.

I've written a small generic driver for GNSS receivers with a USB
interface which I've verified using a u-blox receiver:

	https://lore.kernel.org/r/20211220111901.23206-1-johan@kernel.org

Would you mind giving it a spin with the Sierra device as well?

Johan

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-12-20 11:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-27 20:02 [PATCH] USB: serial: simple: add sierra wireless xm1210 gnss receiver ferlandm
2021-11-17 13:36 ` Greg KH
2021-11-18 16:09   ` Marc Ferland
2021-12-20 11:20 ` Johan Hovold

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.