[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-xorg
Subject:    Re: xf86-input-evdev-1.2.0 broken
From:       Thomas Ilnseher <illth () gmx ! de>
Date:       2008-05-31 23:35:00
Message-ID: 1212276900.5973.12.camel () note ! localnet
[Download RAW message or body]

> Thx! I see. It actually would be weird to apply a patch to the main kernel 
> branch.
> 
I see some sarcasm ;)
> Thomas, don't you think it's unnormal to patch a kernel to make evdev working 
> stable?  

I think it's unmoral to apply crap patch to the kernel ;)

ok, I'm at home right now, so here is the patch. please note that I've
already sent it to the hid maintainer.

Anyway, you can clearly see that the patch is crap:

I had no clue what that "bits" stuff is doing, and what for these
map_*_clear functions are. So I invented a new return code (2), and
added a "goto ignore" to the hidinput_mapping function.

That is bad style, and i guess this patch won't be ever applied to the
kernel. I sent it to the maintainer in the hope that he will correct
these obvious bugs, and maybe give me some insight how things work.
Right now I'm waiting on an answer, but maybe the mail got forwarded
to /dev/null.

there is another thing here: the consumer.hwheel . the mouse obviously
has none. BUT it is still reported. I added some code to ignore this
wheel. 

But there might exist a mouse with the same vid:pid that actually has
such a wheel (both mouses might share the same electronics, only the
physical wheel and the led/photo diodes are missing on mine).

my patch would render this other mouse nonfunctional.

btw, 0x0a5c is the vid of broadcom ;) so this might affect quite a few
mouses.

Thomas
-- 
Thomas Ilnseher <illth@gmx.de>

["hid-quirk-trust15351.diff" (hid-quirk-trust15351.diff)]

--- linux/drivers/hid/hid-input-quirks.c.orig	2008-04-17 04:49:44.000000000 +0200
+++ linux/drivers/hid/hid-input-quirks.c	2008-05-30 20:36:55.867668169 +0200
@@ -24,6 +24,18 @@
 #define map_abs_clear(c)        do { map_abs(c); clear_bit(c, *bit); } while (0)
 #define map_key_clear(c)        do { map_key(c); clear_bit(c, *bit); } while (0)
 
+static int quirk_trust15351_ignore_weird_axis(struct hid_usage *usage, struct input_dev *input,
+			      unsigned long **bit, int *max)
+{
+	/* 0006.0020 is some weird absolute axis that gets mapped to abs.misc */
+	if (usage->hid == 0x60020)
+		return 2;
+	/* consumer.hwheel (but the mouse has no hwheel) */
+	if (usage->hid == 0xc0238)
+		return 2;
+	return 0;
+}
+
 static int quirk_belkin_wkbd(struct hid_usage *usage, struct input_dev *input,
 			      unsigned long **bit, int *max)
 {
@@ -306,6 +318,9 @@
 #define VENDOR_ID_PETALYNX			0x18b1
 #define DEVICE_ID_PETALYNX_MAXTER_REMOTE	0x0037
 
+#define VENDOR_ID_TRUST				0x0a5c
+#define DEVICE_IS_13531_BT			0x0001
+
 static const struct hid_input_blacklist {
 	__u16 idVendor;
 	__u16 idProduct;
@@ -332,6 +346,8 @@
 	{ VENDOR_ID_MONTEREY, DEVICE_ID_GENIUS_KB29E, quirk_cherry_genius_29e },
 
 	{ VENDOR_ID_PETALYNX, DEVICE_ID_PETALYNX_MAXTER_REMOTE, quirk_petalynx_remote },
+
+	{ VENDOR_ID_TRUST, DEVICE_IS_13531_BT, quirk_trust15351_ignore_weird_axis },
 	
 	{ 0, 0, 0 }
 };
--- linux/drivers/hid/hid-input.c.orig	2008-05-30 20:18:43.000000000 +0200
+++ linux/drivers/hid/hid-input.c	2008-05-30 20:36:55.880256291 +0200
@@ -387,6 +387,8 @@
 
 	/* handle input mappings for quirky devices */
 	ret = hidinput_mapping_quirks(usage, input, &bit, &max);
+	if (ret == 2)
+		goto ignore;
 	if (ret)
 		goto mapped;


_______________________________________________
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic