blob: 2180e0789b76ebf794f7893752f71f8fcb1584af [file] [log] [blame]
JD Cole1a3f83f2014-10-31 17:34:42 -07001/*
2 * Plantronics USB HID Driver
3 *
4 * Copyright (c) 2014 JD Cole <jd.cole@plantronics.com>
5 * Copyright (c) 2014 Terry Junge <terry.junge@plantronics.com>
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 "hid-ids.h"
16
17#include <linux/hid.h>
18#include <linux/module.h>
19
20static int plantronics_input_mapping(struct hid_device *hdev,
21 struct hid_input *hi,
22 struct hid_field *field,
23 struct hid_usage *usage,
24 unsigned long **bit, int *max)
25{
26 if (field->application == HID_CP_CONSUMERCONTROL
27 && (usage->hid & HID_USAGE_PAGE) == HID_UP_CONSUMER) {
28 hid_dbg(hdev, "usage: %08x (appl: %08x) - defaulted\n",
29 usage->hid, field->application);
30 return 0;
31 }
32
33 hid_dbg(hdev, "usage: %08x (appl: %08x) - ignored\n",
34 usage->hid, field->application);
35
36 return -1;
37}
38
JD Cole1a3f83f2014-10-31 17:34:42 -070039static const struct hid_device_id plantronics_devices[] = {
40 { HID_USB_DEVICE(USB_VENDOR_ID_PLANTRONICS, HID_ANY_ID) },
41 { }
42};
43MODULE_DEVICE_TABLE(hid, plantronics_devices);
44
45static struct hid_driver plantronics_driver = {
46 .name = "plantronics",
47 .id_table = plantronics_devices,
48 .input_mapping = plantronics_input_mapping,
JD Cole1a3f83f2014-10-31 17:34:42 -070049};
50module_hid_driver(plantronics_driver);
51
52MODULE_AUTHOR("JD Cole <jd.cole@plantronics.com>");
53MODULE_AUTHOR("Terry Junge <terry.junge@plantronics.com>");
54MODULE_DESCRIPTION("Plantronics USB HID Driver");
55MODULE_LICENSE("GPL");