diff options
author | Simon Budig <simon@budig.de> | 2007-01-15 19:28:47 +0300 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2007-01-22 00:17:53 +0300 |
commit | d4ae650a904612ffb7edd3f28b69b022988d2466 (patch) | |
tree | 77e2eb83d78f5102182858bf6016481cc1d799dc /drivers/hid/hid-core.c | |
parent | 641266fdaa3c137c632f8ad2e4124248bafe7a98 (diff) | |
download | linux-d4ae650a904612ffb7edd3f28b69b022988d2466.tar.xz |
HID: proper LED-mapping for SpaceNavigator
This change introduces a mapping for LED indicators between the HID
specification and the Linux input subsystem. The previous code properly
mapped the LEDs relevant for Keyboards, but garbeled the remaining ones.
With this change all LED enums from the input system get mapped to more
or less equivalent LED numbers from the HID specification.
This patch also ensures that the unused bits in a HID report to the
device are zeroed out. This makes the 3Dconnexion SpaceNavigator fully
usable with the linux input system.
Signed-off-by: Simon Budig <simon@budig.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-core.c')
-rw-r--r-- | drivers/hid/hid-core.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 1e1a7770a6b9..38db8321b211 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -880,6 +880,10 @@ static void hid_output_field(struct hid_field *field, __u8 *data) unsigned size = field->report_size; unsigned n; + /* make sure the unused bits in the last byte are zeros */ + if (count > 0 && size > 0) + data[(count*size-1)/8] = 0; + for (n = 0; n < count; n++) { if (field->logical_minimum < 0) /* signed values */ implement(data, offset + n * size, size, s32ton(field->value[n], size)); |