diff mbox series

[2/2] gnss: usb: add support for Sierra Wireless XM1210

Message ID 20211220111901.23206-3-johan@kernel.org (mailing list archive)
State New, archived
Headers show
Series gnss: add USB support | expand

Commit Message

Johan Hovold Dec. 20, 2021, 11:19 a.m. UTC
Add support for the USB interface of the Sierra Wireless XM1210
receiver.

Note that the device only supports NMEA.

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

Reported-by: Marc Ferland <ferlandm@amotus.ca>
Link: https://lore.kernel.org/r/20211027200223.72701-1-ferlandm@amotus.ca
Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/gnss/usb.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Marc Ferland Dec. 20, 2021, 7:04 p.m. UTC | #1
On Mon, Dec 20, 2021 at 6:19 AM Johan Hovold <johan@kernel.org> wrote:
>
> Add support for the USB interface of the Sierra Wireless XM1210
> receiver.
>
> Note that the device only supports NMEA.
>
> 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
>
> Reported-by: Marc Ferland <ferlandm@amotus.ca>
> Link: https://lore.kernel.org/r/20211027200223.72701-1-ferlandm@amotus.ca
> Signed-off-by: Johan Hovold <johan@kernel.org>
> ---
>  drivers/gnss/usb.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gnss/usb.c b/drivers/gnss/usb.c
> index 5c0251034def..792235a688ea 100644
> --- a/drivers/gnss/usb.c
> +++ b/drivers/gnss/usb.c
> @@ -17,6 +17,7 @@
>  #define GNSS_USB_WRITE_TIMEOUT 1000
>
>  static const struct usb_device_id gnss_usb_id_table[] = {
> +       { USB_DEVICE(0x1199, 0xb000) },         /* Sierra Wireless XM1210 */
>         { }
>  };
>  MODULE_DEVICE_TABLE(usb, gnss_usb_id_table);
> --
> 2.32.0
>
Thank you Johan! Much appreciated!

With your patches applied on my platform (featuring the XM1210) , I get:

# lsmod | grep gnss
gnss_usb 16384 0 - Live 0xffffffffc011b000
gnss 16384 3 gnss_usb, Live 0xffffffffc0082000

# dmesg | grep gnss
gnss: GNSS driver registered with major 244
usbcore: registered new interface driver gnss-usb

# ls -l /dev/gnss0
crw-rw----    1 root     root      244,   0 Apr  8 08:39 /dev/gnss0

I also tested with gpsd and everything is working as expected, hence:

Tested-by: Marc Ferland <ferlandm@amotus.ca>

Marc
Johan Hovold Dec. 22, 2021, 2:46 p.m. UTC | #2
On Mon, Dec 20, 2021 at 02:04:49PM -0500, Marc Ferland wrote:
> On Mon, Dec 20, 2021 at 6:19 AM Johan Hovold <johan@kernel.org> wrote:
> >
> > Add support for the USB interface of the Sierra Wireless XM1210
> > receiver.
> >
> > Note that the device only supports NMEA.

> > Reported-by: Marc Ferland <ferlandm@amotus.ca>
> > Link: https://lore.kernel.org/r/20211027200223.72701-1-ferlandm@amotus.ca
> > Signed-off-by: Johan Hovold <johan@kernel.org>
> > ---
> >  drivers/gnss/usb.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/gnss/usb.c b/drivers/gnss/usb.c
> > index 5c0251034def..792235a688ea 100644
> > --- a/drivers/gnss/usb.c
> > +++ b/drivers/gnss/usb.c
> > @@ -17,6 +17,7 @@
> >  #define GNSS_USB_WRITE_TIMEOUT 1000
> >
> >  static const struct usb_device_id gnss_usb_id_table[] = {
> > +       { USB_DEVICE(0x1199, 0xb000) },         /* Sierra Wireless XM1210 */
> >         { }
> >  };
> >  MODULE_DEVICE_TABLE(usb, gnss_usb_id_table);
> > --
> > 2.32.0
> >
> Thank you Johan! Much appreciated!
> 
> With your patches applied on my platform (featuring the XM1210) , I get:
> 
> # lsmod | grep gnss
> gnss_usb 16384 0 - Live 0xffffffffc011b000
> gnss 16384 3 gnss_usb, Live 0xffffffffc0082000
> 
> # dmesg | grep gnss
> gnss: GNSS driver registered with major 244
> usbcore: registered new interface driver gnss-usb
> 
> # ls -l /dev/gnss0
> crw-rw----    1 root     root      244,   0 Apr  8 08:39 /dev/gnss0
> 
> I also tested with gpsd and everything is working as expected, hence:
> 
> Tested-by: Marc Ferland <ferlandm@amotus.ca>

Thanks for testing, Marc!

I've applied this series now after adding your Tested-by tag to both
patches.

Johan
diff mbox series

Patch

diff --git a/drivers/gnss/usb.c b/drivers/gnss/usb.c
index 5c0251034def..792235a688ea 100644
--- a/drivers/gnss/usb.c
+++ b/drivers/gnss/usb.c
@@ -17,6 +17,7 @@ 
 #define GNSS_USB_WRITE_TIMEOUT	1000
 
 static const struct usb_device_id gnss_usb_id_table[] = {
+	{ USB_DEVICE(0x1199, 0xb000) },		/* Sierra Wireless XM1210 */
 	{ }
 };
 MODULE_DEVICE_TABLE(usb, gnss_usb_id_table);