summaryrefslogtreecommitdiff
path: root/drivers/hid/hid-microsoft.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2014-01-29 17:57:42 +0100
committerJiri Kosina <jkosina@suse.cz>2014-02-03 11:11:53 +0100
commitaac59f6a96044f423408ee17f4e8e11d904c2b80 (patch)
tree03528bb030895459f6826ed7e3481f0b957d9cdc /drivers/hid/hid-microsoft.c
parent5820e4d4ae17c0994c93d0537bd1a184267f3cae (diff)
HID: hid-microsoft: Do the check for the ms usage page per device
For some devices we may also want to do custom mappings for other pages. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-microsoft.c')
-rw-r--r--drivers/hid/hid-microsoft.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/hid/hid-microsoft.c b/drivers/hid/hid-microsoft.c
index c6ef6eed3091..5268dec5d81a 100644
--- a/drivers/hid/hid-microsoft.c
+++ b/drivers/hid/hid-microsoft.c
@@ -62,6 +62,9 @@ static int ms_ergonomy_kb_quirk(struct hid_input *hi, struct hid_usage *usage,
{
struct input_dev *input = hi->input;
+ if ((usage->hid & HID_USAGE_PAGE) != HID_UP_MSVENDOR)
+ return 0;
+
switch (usage->hid & HID_USAGE) {
case 0xfd06: ms_map_key_clear(KEY_CHAT); break;
case 0xfd07: ms_map_key_clear(KEY_PHONE); break;
@@ -83,6 +86,9 @@ static int ms_ergonomy_kb_quirk(struct hid_input *hi, struct hid_usage *usage,
static int ms_presenter_8k_quirk(struct hid_input *hi, struct hid_usage *usage,
unsigned long **bit, int *max)
{
+ if ((usage->hid & HID_USAGE_PAGE) != HID_UP_MSVENDOR)
+ return 0;
+
set_bit(EV_REP, hi->input->evbit);
switch (usage->hid & HID_USAGE) {
case 0xfd08: ms_map_key_clear(KEY_FORWARD); break;
@@ -102,9 +108,6 @@ static int ms_input_mapping(struct hid_device *hdev, struct hid_input *hi,
{
unsigned long quirks = (unsigned long)hid_get_drvdata(hdev);
- if ((usage->hid & HID_USAGE_PAGE) != HID_UP_MSVENDOR)
- return 0;
-
if (quirks & MS_ERGONOMY) {
int ret = ms_ergonomy_kb_quirk(hi, usage, bit, max);
if (ret)