Loading...
1/*
2 * HID driver for LC Power Model RC1000MCE
3 *
4 * Copyright (c) 2011 Chris Schlund
5 * based on hid-topseed module
6 */
7
8/*
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the Free
11 * Software Foundation; either version 2 of the License, or (at your option)
12 * any later version.
13 */
14
15#include <linux/device.h>
16#include <linux/hid.h>
17#include <linux/module.h>
18
19#include "hid-ids.h"
20
21#define ts_map_key_clear(c) hid_map_usage_clear(hi, usage, bit, max, \
22 EV_KEY, (c))
23static int ts_input_mapping(struct hid_device *hdev, struct hid_input *hi,
24 struct hid_field *field, struct hid_usage *usage,
25 unsigned long **bit, int *max)
26{
27 if ((usage->hid & HID_USAGE_PAGE) != HID_UP_LOGIVENDOR)
28 return 0;
29
30 switch (usage->hid & HID_USAGE) {
31 case 0x046: ts_map_key_clear(KEY_YELLOW); break;
32 case 0x047: ts_map_key_clear(KEY_GREEN); break;
33 case 0x049: ts_map_key_clear(KEY_BLUE); break;
34 case 0x04a: ts_map_key_clear(KEY_RED); break;
35 case 0x00d: ts_map_key_clear(KEY_HOME); break;
36 case 0x025: ts_map_key_clear(KEY_TV); break;
37 case 0x048: ts_map_key_clear(KEY_VCR); break;
38 case 0x024: ts_map_key_clear(KEY_MENU); break;
39 default:
40 return 0;
41 }
42
43 return 1;
44}
45
46static const struct hid_device_id ts_devices[] = {
47 { HID_USB_DEVICE( USB_VENDOR_ID_LCPOWER, USB_DEVICE_ID_LCPOWER_LC1000) },
48 { }
49};
50MODULE_DEVICE_TABLE(hid, ts_devices);
51
52static struct hid_driver ts_driver = {
53 .name = "LC RC1000MCE",
54 .id_table = ts_devices,
55 .input_mapping = ts_input_mapping,
56};
57module_hid_driver(ts_driver);
58
59MODULE_LICENSE("GPL");
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * HID driver for LC Power Model RC1000MCE
4 *
5 * Copyright (c) 2011 Chris Schlund
6 * based on hid-topseed module
7 */
8
9/*
10 */
11
12#include <linux/device.h>
13#include <linux/hid.h>
14#include <linux/module.h>
15
16#include "hid-ids.h"
17
18#define ts_map_key_clear(c) hid_map_usage_clear(hi, usage, bit, max, \
19 EV_KEY, (c))
20static int ts_input_mapping(struct hid_device *hdev, struct hid_input *hi,
21 struct hid_field *field, struct hid_usage *usage,
22 unsigned long **bit, int *max)
23{
24 if ((usage->hid & HID_USAGE_PAGE) != HID_UP_LOGIVENDOR)
25 return 0;
26
27 switch (usage->hid & HID_USAGE) {
28 case 0x046: ts_map_key_clear(KEY_YELLOW); break;
29 case 0x047: ts_map_key_clear(KEY_GREEN); break;
30 case 0x049: ts_map_key_clear(KEY_BLUE); break;
31 case 0x04a: ts_map_key_clear(KEY_RED); break;
32 case 0x00d: ts_map_key_clear(KEY_HOME); break;
33 case 0x025: ts_map_key_clear(KEY_TV); break;
34 case 0x048: ts_map_key_clear(KEY_VCR); break;
35 case 0x024: ts_map_key_clear(KEY_MENU); break;
36 default:
37 return 0;
38 }
39
40 return 1;
41}
42
43static const struct hid_device_id ts_devices[] = {
44 { HID_USB_DEVICE( USB_VENDOR_ID_LCPOWER, USB_DEVICE_ID_LCPOWER_LC1000) },
45 { }
46};
47MODULE_DEVICE_TABLE(hid, ts_devices);
48
49static struct hid_driver ts_driver = {
50 .name = "LC RC1000MCE",
51 .id_table = ts_devices,
52 .input_mapping = ts_input_mapping,
53};
54module_hid_driver(ts_driver);
55
56MODULE_LICENSE("GPL");