I have a wireless PS3 controller adapter that is plugged in to my Ubuntu 14.04 box. It has 2 modes: XInput and DInput, which as far as I can tell, it just passes two different vendor/product id's over USB (XInput has a Microsoft XBOX id, the other is generic). The XInput mode works fine (loads xpad driver), but in the DInput mode the kernel identifies the device as a mouse, instead of as a joystick.
Related Questions:
What do I need to change to make it identify as a joystick?
How does the usbhid driver assign minor numbers to a character device?
dmesg
[ 1692.151837] usb 3-1: new full-speed USB device number 8 using ohci-pci
[ 1692.325523] usb 3-1: New USB device found, idVendor=0079, idProduct=1801
[ 1692.325528] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 1692.325530] usb 3-1: Product: Mayflash PS3 Game Controller Adapater
[ 1692.325531] usb 3-1: Manufacturer: HJZ
[ 1692.341586] input: HJZ Mayflash PS3 Game Controller Adapater as /devices/pci0000:00/0000:00:12.0/usb3/3-1/3-1:1.0/input/input14
[ 1692.341854] hid-generic 0003:0079:1801.0006: input,hidraw3: USB HID v1.11 Joystick [HJZ Mayflash PS3 Game Controller Adapater] on usb-0000:00:12.0-1/input0
sudo udevadm info --path=/devices/pci0000:00/0000:00:12.0/usb3/3-1/3-1:1.0/input/input14
P: /devices/pci0000:00/0000:00:12.0/usb3/3-1/3-1:1.0/input/input14
E: ABS=ffffff
E: DEVPATH=/devices/pci0000:00/0000:00:12.0/usb3/3-1/3-1:1.0/input/input14
...
E: ID_INPUT_TABLET=1
E: ID_MODEL=Mayflash_PS3_Game_Controller_Adapater
...
E: ID_TYPE=hid
E: ID_USB_DRIVER=usbhid
ll /dev/input/by-id/
lrwxrwxrwx 1 root root 9 May 8 16:18 usb-HJZ_Mayflash_PS3_Game_Controller_Adapater-event-mouse -> ../event4
lrwxrwxrwx 1 root root 9 May 8 16:18 usb-HJZ_Mayflash_PS3_Game_Controller_Adapater-mouse -> ../mouse1
sudo udevadm monitor --property --kernel --udev
...
KERNEL[1693.830143] add /devices/pci0000:00/0000:00:12.0/usb3/3-1/3-1:1.0/input/input14/mouse1 (input)
ACTION=add
DEVNAME=/dev/input/mouse1
DEVPATH=/devices/pci0000:00/0000:00:12.0/usb3/3-1/3-1:1.0/input/input14/mouse1
MAJOR=13
MINOR=33
SEQNUM=2196
SUBSYSTEM=input
UDEV_LOG=7
...
Update
In my quest for knowledge, I found a site that lists the Major/Minor numbers for the usbhid driver. As you can see below, my device is 13,32, which is reserved by the driver for mouse0. It would appear that I need to trick(?) the driver into assigning a different Minor number to it? ...or am I headed down the wrong path? (Admittedly, I'm more familiar with Windows driver dev, than linux)
USB device number mappings
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
13 char Input drivers
0 = /dev/input/js0 First joystick
1 = /dev/input/js1 Second joystick
...
32 = /dev/input/mouse0 First mouse
33 = /dev/input/mouse1 Second mouse
ls -l /dev/input/
crw-r----- 1 root root 13, 32 May 9 11:48 mouse0
lsusb -v
Bus 003 Device 003: ID 0079:1801 DragonRise Inc.
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x0079 DragonRise Inc.
idProduct 0x1801
bcdDevice 1.00
iManufacturer 1 HJZ
iProduct 2 Mayflash PS3 Game Controller Adapater
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 34
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 500mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 0 No Subclass
bInterfaceProtocol 0 None
iInterface 0
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.11
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 428
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 1
Device Status: 0x0002
(Bus Powered)
Remote Wakeup Enabled
lsusb -v
says about the device ?