aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2007-03-10 16:45:45 -0500
committerJiri Kosina <jkosina@suse.cz>2007-03-12 09:55:26 -0400
commitd108d4fe34730135647fe32a4f8091491d3542ea (patch)
tree1965c3abc44bdff17d75aee85f603f555e1731c9 /drivers/hid
parent47a80edb1d80ae644ea374a016c8e68d43d2671f (diff)
HID: zeroing of bytes in output fields is bogus
This patch removes bogus zeroing of unused bits in output reports, introduced in Simon's patch in commit d4ae650a. According to the specification, any sane device should not care about values of unused bits. What is worse, the zeroing is done in a way which is broken and might clear certain bits in output reports which are actually _used_ - a device that has multiple fields with one value of the size 1 bit each might serve as an example of why this is bogus - the second call of hid_output_report() would clear the first bit of report, which has already been set up previously. This patch will break LEDs on SpaceNavigator, because this device is broken and takes into account the bits which it shouldn't touch. The quirk for this particular device will be provided in a separate patch. Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-core.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index e5894a75a6f3..d28d76d22043 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -875,10 +875,6 @@ static void hid_output_field(struct hid_field *field, __u8 *data)
875 unsigned size = field->report_size; 875 unsigned size = field->report_size;
876 unsigned n; 876 unsigned n;
877 877
878 /* make sure the unused bits in the last byte are zeros */
879 if (count > 0 && size > 0)
880 data[(offset+count*size-1)/8] = 0;
881
882 for (n = 0; n < count; n++) { 878 for (n = 0; n < count; n++) {
883 if (field->logical_minimum < 0) /* signed values */ 879 if (field->logical_minimum < 0) /* signed values */
884 implement(data, offset + n * size, size, s32ton(field->value[n], size)); 880 implement(data, offset + n * size, size, s32ton(field->value[n], size));