Input: hid-input - allow mapping unknown usages
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 16 Sep 2010 02:36:56 +0000 (19:36 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 16 Sep 2010 06:11:29 +0000 (23:11 -0700)
commitf5854fad395b93071292bff27c0121b6e32215e0
tree4420ba8623a9bb0ecef05875adf7d2da7941e862
parent1f7930c55e1c1a2b6d5793a1002b31590356558c
Input: hid-input - allow mapping unknown usages

Currently HID layer only allows to remap keycodes for known usages,
and responds with -EINVAL when user tries to map new usage code.
This precludes us form relying on udev/keymap for establishing correct
mappings and forces us to write dummy HID drivers responsible only for
setting up keymaps.

Let's allow remapping not only usages that have been set up as keys
(usage->type == EV_KEY) but also yet-unmapped usages (usage->type == 0).

Acked-by: Jarod Wilson <jarod@redhat.com>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/hid/hid-input.c