0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #include <linux/device.h>
0013 #include <linux/hid.h>
0014 #include <linux/module.h>
0015
0016 #include "hid-ids.h"
0017
0018 #define ts_map_key_clear(c) hid_map_usage_clear(hi, usage, bit, max, \
0019 EV_KEY, (c))
0020 static int ts_input_mapping(struct hid_device *hdev, struct hid_input *hi,
0021 struct hid_field *field, struct hid_usage *usage,
0022 unsigned long **bit, int *max)
0023 {
0024 if ((usage->hid & HID_USAGE_PAGE) != HID_UP_LOGIVENDOR)
0025 return 0;
0026
0027 switch (usage->hid & HID_USAGE) {
0028 case 0x046: ts_map_key_clear(KEY_YELLOW); break;
0029 case 0x047: ts_map_key_clear(KEY_GREEN); break;
0030 case 0x049: ts_map_key_clear(KEY_BLUE); break;
0031 case 0x04a: ts_map_key_clear(KEY_RED); break;
0032 case 0x00d: ts_map_key_clear(KEY_HOME); break;
0033 case 0x025: ts_map_key_clear(KEY_TV); break;
0034 case 0x048: ts_map_key_clear(KEY_VCR); break;
0035 case 0x024: ts_map_key_clear(KEY_MENU); break;
0036 default:
0037 return 0;
0038 }
0039
0040 return 1;
0041 }
0042
0043 static const struct hid_device_id ts_devices[] = {
0044 { HID_USB_DEVICE( USB_VENDOR_ID_LCPOWER, USB_DEVICE_ID_LCPOWER_LC1000) },
0045 { }
0046 };
0047 MODULE_DEVICE_TABLE(hid, ts_devices);
0048
0049 static struct hid_driver ts_driver = {
0050 .name = "LC RC1000MCE",
0051 .id_table = ts_devices,
0052 .input_mapping = ts_input_mapping,
0053 };
0054 module_hid_driver(ts_driver);
0055
0056 MODULE_LICENSE("GPL");