Linux Input/HID development
 help / color / mirror / Atom feed
* Missing axis on Gembird JPD-DUALFORCE2 since Linux 3.18
@ 2015-08-10  8:26 Orivej Desh
  2015-08-10 14:27 ` Benjamin Tissoires
  0 siblings, 1 reply; 6+ messages in thread
From: Orivej Desh @ 2015-08-10  8:26 UTC (permalink / raw)
  To: linux-input

I have one of those gamepads, and since Linux 3.18 the kernel hides one
of its axes.

In Linux 3.17 jstest reports it as

     Joystick (PC Game Controller       ) has 7 axes (X, Y, Z, Rx, Rz, Hat0X, Hat0Y)

and in Linux 3.18 as

     Joystick (PC Game Controller       ) has 6 axes (X, Y, Z, Rz, Hat0X, Hat0Y)

It has 6 physical axes (X, Y, Rx, Ry, Hat0X, Hat0Y), but Ry is reported
as Rz, and Z emits noise (which had to be silenced with jscal).

I bisected disappearing axis to the following commit [1], but if I
understand correctly, it is the device that is wrong by misreporting
some property of Rx.

I can remap Rz to Ry in userspace with ioctl(fd, JSIOCSAXMAP, ...),
though I never had to.  Can I likewise restore Rx in userspace (and also
delete Z)?  If not, or if this device justifies a quirk, how should it
be added?

usb-devices report: [2].

[1]
commit 79346d620e9de87912de73337f6df8b7f9a46888
Author: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Date:   Mon Aug 25 13:07:10 2014 -0400

    HID: input: force generic axis to be mapped to their user space axis

    Atmel 840B digitizer presents a stylus interface which reports twice
    the X coordinate and then twice the Y coordinate. In its current
    implementation, hid-input assign the first X to X, then the second to Y,
    then the first Y to Z, then the second one to RX.

    This is wrong, and X should always be mapped to X, no matter what.
    A solution consists in forcing X, Y, Z, RX, RY, RZ to be mapped to their
    correct user space counter part.

    Reported-by: Éric Brunet <Eric.Brunet@lps.ens.fr>
    Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
    Signed-off-by: Jiri Kosina <jkosina@suse.cz>

diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index 2619f7f..2df7fdd 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -599,6 +599,12 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
                /* These usage IDs map directly to the usage codes. */
                case HID_GD_X: case HID_GD_Y: case HID_GD_Z:
                case HID_GD_RX: case HID_GD_RY: case HID_GD_RZ:
+                       if (field->flags & HID_MAIN_ITEM_RELATIVE)
+                               map_rel(usage->hid & 0xf);
+                       else
+                               map_abs_clear(usage->hid & 0xf);
+                       break;
+
                case HID_GD_SLIDER: case HID_GD_DIAL: case HID_GD_WHEEL:
                        if (field->flags & HID_MAIN_ITEM_RELATIVE)
                                map_rel(usage->hid & 0xf);

[2]
T:  Bus=09 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  2 Spd=1.5 MxCh= 0
D:  Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=11ff ProdID=3331 Rev=01.07
S:  Product=PC Game Controller
C:  #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=500mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid


--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2015-08-11 15:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-10  8:26 Missing axis on Gembird JPD-DUALFORCE2 since Linux 3.18 Orivej Desh
2015-08-10 14:27 ` Benjamin Tissoires
2015-08-10 21:36   ` Orivej Desh
2015-08-10 21:53     ` Benjamin Tissoires
2015-08-10 22:28       ` Orivej Desh
2015-08-11 15:35         ` Benjamin Tissoires

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox