Version:  2.0.40 2.2.26 2.4.37 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 3.10 3.11 3.12 3.13 3.14 3.15 3.16 3.17 3.18

Linux/drivers/usb/serial/xsens_mt.c

  1 /*
  2  * Xsens MT USB driver
  3  *
  4  * Copyright (C) 2013 Xsens <info@xsens.com>
  5  *
  6  *  This program is free software; you can redistribute it and/or
  7  *  modify it under the terms of the GNU General Public License version
  8  *  2 as published by the Free Software Foundation.
  9  */
 10 
 11 #include <linux/kernel.h>
 12 #include <linux/tty.h>
 13 #include <linux/module.h>
 14 #include <linux/usb.h>
 15 #include <linux/usb/serial.h>
 16 #include <linux/uaccess.h>
 17 
 18 #define XSENS_VID 0x2639
 19 
 20 #define MTi_10_IMU_PID          0x0001
 21 #define MTi_20_VRU_PID          0x0002
 22 #define MTi_30_AHRS_PID         0x0003
 23 
 24 #define MTi_100_IMU_PID         0x0011
 25 #define MTi_200_VRU_PID         0x0012
 26 #define MTi_300_AHRS_PID        0x0013
 27 
 28 #define MTi_G_700_GPS_INS_PID   0x0017
 29 
 30 static const struct usb_device_id id_table[] = {
 31         { USB_DEVICE(XSENS_VID, MTi_10_IMU_PID) },
 32         { USB_DEVICE(XSENS_VID, MTi_20_VRU_PID) },
 33         { USB_DEVICE(XSENS_VID, MTi_30_AHRS_PID) },
 34 
 35         { USB_DEVICE(XSENS_VID, MTi_100_IMU_PID) },
 36         { USB_DEVICE(XSENS_VID, MTi_200_VRU_PID) },
 37         { USB_DEVICE(XSENS_VID, MTi_300_AHRS_PID) },
 38 
 39         { USB_DEVICE(XSENS_VID, MTi_G_700_GPS_INS_PID) },
 40         { },
 41 };
 42 MODULE_DEVICE_TABLE(usb, id_table);
 43 
 44 static int xsens_mt_probe(struct usb_serial *serial,
 45                                         const struct usb_device_id *id)
 46 {
 47         if (serial->interface->cur_altsetting->desc.bInterfaceNumber == 1)
 48                 return 0;
 49 
 50         return -ENODEV;
 51 }
 52 
 53 static struct usb_serial_driver xsens_mt_device = {
 54         .driver = {
 55                 .owner = THIS_MODULE,
 56                 .name = "xsens_mt",
 57         },
 58         .id_table = id_table,
 59         .num_ports = 1,
 60 
 61         .probe = xsens_mt_probe,
 62 };
 63 
 64 static struct usb_serial_driver * const serial_drivers[] = {
 65         &xsens_mt_device, NULL
 66 };
 67 
 68 module_usb_serial_driver(serial_drivers, id_table);
 69 
 70 MODULE_AUTHOR("Frans Klaver <frans.klaver@xsens.com>");
 71 MODULE_DESCRIPTION("USB-serial driver for Xsens motion trackers");
 72 MODULE_LICENSE("GPL");
 73 

This page was automatically generated by LXR 0.3.1 (source).  •  Linux is a registered trademark of Linus Torvalds  •  Contact us