There is code in the hidinput_configure_usage() function that, after
parsing the usage info, test_and_sets the usage->code bit in the
appropriate bitfield. However, if the bit is already set, it searches for
the next available bit, and sets the usage->code to it. This doesn't make
sense to me, as the usage->code was set, and arbitrarily changing it to
the next available bit will change its meaning to an incorrect setting.
For example I have a touchscreen that, because of this, is reporting ABS_Y
and ABS_Z coordinates instead of ABS_X and ABS_Y coordinates (i.e. their
usage->code was shifted because of this).
This patch changes the code to only set the bit. I left the test for
code > max in, but that probably is not needed except as a sanity check
for the set_bit().
Signed-off-by: Dan Streetman <[EMAIL PROTECTED]>
--- linux-2.6.8-rc4/drivers/usb/input/hid-input.c 2004-06-16 01:19:17.000000000
-0400
+++ linux-2.6.8-rc4-input/drivers/usb/input/hid-input.c 2004-08-10 13:30:38.000000000
-0400
@@ -383,13 +383,11 @@
set_bit(REL_HWHEEL, bit);
}
- while (usage->code <= max && test_and_set_bit(usage->code, bit)) {
- usage->code = find_next_zero_bit(bit, max + 1, usage->code);
- }
-
if (usage->code > max)
return;
+ set_bit(usage->code, bit);
+
if (usage->type == EV_ABS) {
int a = field->logical_minimum;
int b = field->logical_maximum;
-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel