Re: Proper support for Saitek X36F joystick

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed 2020-10-28 17:29:23, Jiri Kosina wrote:
> On Wed, 28 Oct 2020, Pavel Machek wrote:
> 
> > So no, I can't even replace it with equivalent one. Perhaps hrdc got
> > decompilation wrong, or I'm doing something else wrong.
> 
> You don't need to do any decompilation -- the descriptor can be obtained 
> from /sys/kernel/debug/hid/<device>/rdesc (also lsusb in verbose enough 
> mode should present it in case no driver is bound to the device).

I discovered problem in the meantime. hrdc (I was using to de-compile
and re-compile hid descriptors) was adding padding.

But thanks for the pointer. That is very useful:

This device has four hat switches... I declared two so far

     0x0b, 0x39, 0x00, 0x01, 0x00,  //     Usage (desktop.HatSwitch)
     0x35, 0x00,                    //     PhysicalMinimum (0)
     0x46, 0x3b, 0x01,              //     PhysicalMaximum (315)
     0x15, 0x01,                    //     LogicalMinimum (1)
     0x25, 0x08,                    //     LogicalMaximum (8)
     0x65, 0x14,                    //     Unit (Degree)
     0x55, 0x00,                    //     UnitExponent (0)
     0x95, 0x01,                    //     ReportCount (1)
     0x75, 0x04,                    //     ReportSize (4)
     0x81, 0x42,                    //     Input (Variable|NullState)

     0x95, 0x01,                    //     ReportCount (1)
     0x75, 0x02,                    //     ReportSize (2)
     0x81, 0x03,                    //     Input (Constant|Variable)
     0x0b, 0x39, 0x00, 0x01, 0x00,  //     Usage (desktop.HatSwitch)
     0x35, 0x00,                    //     PhysicalMinimum (0)
     0x46, 0x3b, 0x01,              //     PhysicalMaximum (315)
     0x15, 0x01,                    //     LogicalMinimum (1)
     0x25, 0x08,                    //     LogicalMaximum (8)
     0x65, 0x14,                    //     Unit (Degree)
     0x55, 0x00,                    //     UnitExponent (0)
     0x95, 0x01,                    //     ReportCount (1)
     0x75, 0x04,                    //     ReportSize (4)
     0x81, 0x42,                    //     Input (Variable|NullState)
     0xc0,                          // EndCollection

...but Linux seems to only recognize first of them:

GenericDesktop.HatSwitch ---> Absolute.Hat0X
GenericDesktop.HatSwitch ---> Sync.Report

Is there way to get extra hats mapped as Hat1X, Hat2X and Hat3X?

(Plus, they may have different bit orders than hid expects...?)

I'm thinking that maybe I should ignore this hid stuff and just do
"normal" driver in C? Is there precedent/example for that?

Best regards,
								Pavel
-- 
http://www.livejournal.com/~pavelmachek

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux