aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/hid/Makefile2
-rw-r--r--drivers/hid/hid-input-quirks.c49
-rw-r--r--drivers/hid/hid-input.c11
-rw-r--r--include/linux/hid.h3
4 files changed, 2 insertions, 63 deletions
diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile
index 735c371ca02e..0141ff88008e 100644
--- a/drivers/hid/Makefile
+++ b/drivers/hid/Makefile
@@ -1,7 +1,7 @@
1# 1#
2# Makefile for the HID driver 2# Makefile for the HID driver
3# 3#
4hid-objs := hid-core.o hid-input.o hid-input-quirks.o 4hid-objs := hid-core.o hid-input.o
5 5
6obj-$(CONFIG_HID) += hid.o 6obj-$(CONFIG_HID) += hid.o
7 7
diff --git a/drivers/hid/hid-input-quirks.c b/drivers/hid/hid-input-quirks.c
deleted file mode 100644
index 980e7456e260..000000000000
--- a/drivers/hid/hid-input-quirks.c
+++ /dev/null
@@ -1,49 +0,0 @@
1/*
2 * HID-input usage mapping quirks
3 *
4 * This is used to handle HID-input mappings for devices violating
5 * HUT 1.12 specification.
6 *
7 * Copyright (c) 2007-2008 Jiri Kosina
8 */
9
10/*
11 * This program is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by the Free
13 * Software Foundation; either version 2 of the License
14 */
15
16#include <linux/input.h>
17#include <linux/hid.h>
18
19static const struct hid_input_blacklist {
20 __u16 idVendor;
21 __u16 idProduct;
22 int (*quirk)(struct hid_usage *, struct hid_input *, unsigned long **,
23 int *);
24} hid_input_blacklist[] = {
25 { 0, 0, NULL }
26};
27
28int hidinput_mapping_quirks(struct hid_usage *usage,
29 struct hid_input *hi, unsigned long **bit, int *max)
30{
31 struct hid_device *device = input_get_drvdata(hi->input);
32 int i = 0;
33
34 while (hid_input_blacklist[i].quirk) {
35 if (hid_input_blacklist[i].idVendor == device->vendor &&
36 hid_input_blacklist[i].idProduct == device->product)
37 return hid_input_blacklist[i].quirk(usage, hi, bit,
38 max);
39 i++;
40 }
41 return 0;
42}
43
44int hidinput_event_quirks(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value)
45{
46 return 0;
47}
48
49
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index 1d2d0827820c..0a68935c20b8 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -154,7 +154,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
154{ 154{
155 struct input_dev *input = hidinput->input; 155 struct input_dev *input = hidinput->input;
156 struct hid_device *device = input_get_drvdata(input); 156 struct hid_device *device = input_get_drvdata(input);
157 int max = 0, code, ret; 157 int max = 0, code;
158 unsigned long *bit = NULL; 158 unsigned long *bit = NULL;
159 159
160 field->hidinput = hidinput; 160 field->hidinput = hidinput;
@@ -173,11 +173,6 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
173 goto ignore; 173 goto ignore;
174 } 174 }
175 175
176 /* handle input mappings for quirky devices */
177 ret = hidinput_mapping_quirks(usage, hidinput, &bit, &max);
178 if (ret)
179 goto mapped;
180
181 if (device->driver->input_mapping) { 176 if (device->driver->input_mapping) {
182 int ret = device->driver->input_mapping(device, hidinput, field, 177 int ret = device->driver->input_mapping(device, hidinput, field,
183 usage, &bit, &max); 178 usage, &bit, &max);
@@ -590,10 +585,6 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct
590 if (!usage->type) 585 if (!usage->type)
591 return; 586 return;
592 587
593 /* handle input events for quirky devices */
594 if (hidinput_event_quirks(hid, field, usage, value))
595 return;
596
597 if (usage->hat_min < usage->hat_max || usage->hat_dir) { 588 if (usage->hat_min < usage->hat_max || usage->hat_dir) {
598 int hat_dir = usage->hat_dir; 589 int hat_dir = usage->hat_dir;
599 if (!hat_dir) 590 if (!hat_dir)
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 5b47feecc101..0de5fe8894d9 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -617,9 +617,6 @@ extern void hidinput_disconnect(struct hid_device *);
617int hid_set_field(struct hid_field *, unsigned, __s32); 617int hid_set_field(struct hid_field *, unsigned, __s32);
618int hid_input_report(struct hid_device *, int type, u8 *, int, int); 618int hid_input_report(struct hid_device *, int type, u8 *, int, int);
619int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field); 619int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field);
620int hidinput_mapping_quirks(struct hid_usage *, struct hid_input *,
621 unsigned long **, int *);
622int hidinput_event_quirks(struct hid_device *, struct hid_field *, struct hid_usage *, __s32);
623void hid_output_report(struct hid_report *report, __u8 *data); 620void hid_output_report(struct hid_report *report, __u8 *data);
624struct hid_device *hid_allocate_device(void); 621struct hid_device *hid_allocate_device(void);
625int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size); 622int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size);