blob: 980e7456e260131d429426d747f7131233422ef6 [file] [log] [blame]
Jiri Kosina10bd0652007-11-22 15:18:18 +01001/*
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 *
Jiri Kosina85c985f2008-01-10 17:40:18 +01007 * Copyright (c) 2007-2008 Jiri Kosina
Jiri Kosina10bd0652007-11-22 15:18:18 +01008 */
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
Jiri Kosina10bd0652007-11-22 15:18:18 +010019static const struct hid_input_blacklist {
20 __u16 idVendor;
21 __u16 idProduct;
Jiri Slaby022e8c42008-05-16 11:49:18 +020022 int (*quirk)(struct hid_usage *, struct hid_input *, unsigned long **,
23 int *);
Jiri Kosina10bd0652007-11-22 15:18:18 +010024} hid_input_blacklist[] = {
Jiri Slaby282bfd42008-03-28 17:06:41 +010025 { 0, 0, NULL }
Jiri Kosina10bd0652007-11-22 15:18:18 +010026};
27
28int hidinput_mapping_quirks(struct hid_usage *usage,
Jiri Slaby022e8c42008-05-16 11:49:18 +020029 struct hid_input *hi, unsigned long **bit, int *max)
Jiri Kosina10bd0652007-11-22 15:18:18 +010030{
Jiri Slaby022e8c42008-05-16 11:49:18 +020031 struct hid_device *device = input_get_drvdata(hi->input);
Jiri Kosina10bd0652007-11-22 15:18:18 +010032 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)
Jiri Slaby022e8c42008-05-16 11:49:18 +020037 return hid_input_blacklist[i].quirk(usage, hi, bit,
38 max);
Jiri Kosina10bd0652007-11-22 15:18:18 +010039 i++;
40 }
41 return 0;
42}
Jiri Kosina87bc2aa2007-11-23 13:16:02 +010043
Jiri Kosina68a1f2c2008-02-07 16:48:46 +010044int hidinput_event_quirks(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value)
Jiri Kosina87bc2aa2007-11-23 13:16:02 +010045{
Jiri Kosina68a1f2c2008-02-07 16:48:46 +010046 return 0;
Jiri Kosina87bc2aa2007-11-23 13:16:02 +010047}
48
Jiri Kosina10bd0652007-11-22 15:18:18 +010049