Source
1
1
/*
2
2
* Plantronics USB HID Driver
3
3
*
4
4
* Copyright (c) 2014 JD Cole <jd.cole@plantronics.com>
5
-
* Copyright (c) 2015 Terry Junge <terry.junge@plantronics.com>
5
+
* Copyright (c) 2015-2018 Terry Junge <terry.junge@plantronics.com>
6
6
*/
7
7
8
8
/*
9
9
* This program is free software; you can redistribute it and/or modify it
10
10
* under the terms of the GNU General Public License as published by the Free
11
11
* Software Foundation; either version 2 of the License, or (at your option)
12
12
* any later version.
13
13
*/
14
14
15
15
#include "hid-ids.h"
41
41
42
42
static int plantronics_input_mapping(struct hid_device *hdev,
43
43
struct hid_input *hi,
44
44
struct hid_field *field,
45
45
struct hid_usage *usage,
46
46
unsigned long **bit, int *max)
47
47
{
48
48
unsigned short mapped_key;
49
49
unsigned long plt_type = (unsigned long)hid_get_drvdata(hdev);
50
50
51
+
/* special case for PTT products */
52
+
if (field->application == HID_GD_JOYSTICK)
53
+
goto defaulted;
54
+
51
55
/* handle volume up/down mapping */
52
56
/* non-standard types or multi-HID interfaces - plt_type is PID */
53
57
if (!(plt_type & HID_USAGE_PAGE)) {
54
58
switch (plt_type) {
55
59
case PLT_DA60:
56
60
if (PLT_ALLOW_CONSUMER)
57
61
goto defaulted;
58
62
goto ignored;
59
63
default:
60
64
if (PLT_ALLOW_CONSUMER)