HID: handle cases of volume knobs generating relative values
commit2c1d8aea2ca76df1b1de2aed23e3ceda2a044ed1
authorJiri Kosina <jkosina@suse.cz>
Wed, 4 Jul 2007 14:45:59 +0000 (4 16:45 +0200)
committerJiri Kosina <jkosina@suse.cz>
Mon, 9 Jul 2007 12:13:37 +0000 (9 14:13 +0200)
tree84441a52707b1239e8395b282b986dfb5a9cd3f1
parent3c5f4b25f3552c9bcb52eb956753a3c8140480b7
HID: handle cases of volume knobs generating relative values

There are some devices (for example Dell Multimedia Keyboard SK-8135) that have
a volume control knob which generates relative events instead of absolute.
hid-input maps them to ABS_VOLUME. HUT pages don't restrict volume to absolute
values.

Adding REL_VOLUME doesn't seem feasible, nothing knows how to handle it. This
patch translates relative ABS_VOLUME events into appropriate number of series
of VOLUME_UP or VOLUME_DOWN events respectively, so that userspace sees the
correct values in the end.

kernel.org bugzilla 5233

Reported-by: Jochen Eisinger <jochen@penguin-breeder.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-input.c