2007-11-22 15:18:18 +01:00
|
|
|
/*
|
|
|
|
* HID-input usage mapping quirks
|
|
|
|
*
|
|
|
|
* This is used to handle HID-input mappings for devices violating
|
|
|
|
* HUT 1.12 specification.
|
|
|
|
*
|
2008-01-10 17:40:18 +01:00
|
|
|
* Copyright (c) 2007-2008 Jiri Kosina
|
2007-11-22 15:18:18 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the Free
|
|
|
|
* Software Foundation; either version 2 of the License
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/input.h>
|
|
|
|
#include <linux/hid.h>
|
|
|
|
|
|
|
|
static const struct hid_input_blacklist {
|
|
|
|
__u16 idVendor;
|
|
|
|
__u16 idProduct;
|
2008-05-16 11:49:18 +02:00
|
|
|
int (*quirk)(struct hid_usage *, struct hid_input *, unsigned long **,
|
|
|
|
int *);
|
2007-11-22 15:18:18 +01:00
|
|
|
} hid_input_blacklist[] = {
|
2008-03-28 17:06:41 +01:00
|
|
|
{ 0, 0, NULL }
|
2007-11-22 15:18:18 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
int hidinput_mapping_quirks(struct hid_usage *usage,
|
2008-05-16 11:49:18 +02:00
|
|
|
struct hid_input *hi, unsigned long **bit, int *max)
|
2007-11-22 15:18:18 +01:00
|
|
|
{
|
2008-05-16 11:49:18 +02:00
|
|
|
struct hid_device *device = input_get_drvdata(hi->input);
|
2007-11-22 15:18:18 +01:00
|
|
|
int i = 0;
|
|
|
|
|
|
|
|
while (hid_input_blacklist[i].quirk) {
|
|
|
|
if (hid_input_blacklist[i].idVendor == device->vendor &&
|
|
|
|
hid_input_blacklist[i].idProduct == device->product)
|
2008-05-16 11:49:18 +02:00
|
|
|
return hid_input_blacklist[i].quirk(usage, hi, bit,
|
|
|
|
max);
|
2007-11-22 15:18:18 +01:00
|
|
|
i++;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
2007-11-23 13:16:02 +01:00
|
|
|
|
2008-02-07 16:48:46 +01:00
|
|
|
int hidinput_event_quirks(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value)
|
2007-11-23 13:16:02 +01:00
|
|
|
{
|
2008-02-07 16:48:46 +01:00
|
|
|
return 0;
|
2007-11-23 13:16:02 +01:00
|
|
|
}
|
|
|
|
|
2007-11-22 15:18:18 +01:00
|
|
|
|