Lines Matching +full:multi +full:- +full:standard
1 // SPDX-License-Identifier: GPL-2.0-or-later
6 * Copyright (c) 2015-2018 Terry Junge <terry.junge@plantronics.com>
12 #include "hid-ids.h"
37 #define PLT_ALLOW_CONSUMER (field->application == HID_CP_CONSUMERCONTROL && \
38 (usage->hid & HID_USAGE_PAGE) == HID_UP_CONSUMER)
60 unsigned long plt_type = drv_data->device_type; in plantronics_input_mapping()
63 if (field->application == HID_GD_JOYSTICK) in plantronics_input_mapping()
67 /* non-standard types or multi-HID interfaces - plt_type is PID */ in plantronics_input_mapping()
79 /* handle standard types - plt_type is 0xffa0uuuu or 0xffa2uuuu */ in plantronics_input_mapping()
80 /* 'basic telephony compliant' - allow default consumer page map */ in plantronics_input_mapping()
86 /* not 'basic telephony' - apply legacy mapping */ in plantronics_input_mapping()
88 else if (!((field->application ^ plt_type) & HID_USAGE_PAGE)) { in plantronics_input_mapping()
89 switch (usage->hid) { in plantronics_input_mapping()
108 return -1; in plantronics_input_mapping()
111 hid_dbg(hdev, "usage: %08x (appl: %08x) - defaulted\n", in plantronics_input_mapping()
112 usage->hid, field->application); in plantronics_input_mapping()
117 hid_dbg(hdev, "usage: %08x (appl: %08x) - mapped to key %d\n", in plantronics_input_mapping()
118 usage->hid, field->application, mapped_key); in plantronics_input_mapping()
127 if (drv_data->quirks & PLT_QUIRK_DOUBLE_VOLUME_KEYS) { in plantronics_event()
135 prev_ts = drv_data->last_volume_key_ts; in plantronics_event()
137 if (jiffies_to_msecs(cur_ts - prev_ts) <= PLT_DOUBLE_KEY_TIMEOUT) in plantronics_event()
140 drv_data->last_volume_key_ts = cur_ts; in plantronics_event()
142 if (drv_data->quirks & PLT_QUIRK_FOLLOWED_OPPOSITE_VOLUME_KEYS) { in plantronics_event()
150 prev_ts = drv_data->last_volume_key_ts; in plantronics_event()
152 if (jiffies_to_msecs(cur_ts - prev_ts) <= PLT_FOLLOWED_OPPOSITE_KEY_TIMEOUT) in plantronics_event()
155 drv_data->last_volume_key_ts = cur_ts; in plantronics_event()
164 unsigned long plt_type = hdev->product; in plantronics_device_type()
166 /* multi-HID interfaces? - plt_type is PID */ in plantronics_device_type()
171 for (i = 0; i < hdev->maxcollection; i++) { in plantronics_device_type()
172 col_page = hdev->collection[i].usage & HID_USAGE_PAGE; in plantronics_device_type()
174 plt_type = hdev->collection[i].usage; in plantronics_device_type()
178 plt_type = hdev->collection[i].usage; in plantronics_device_type()
192 drv_data = devm_kzalloc(&hdev->dev, sizeof(*drv_data), GFP_KERNEL); in plantronics_probe()
194 return -ENOMEM; in plantronics_probe()
202 drv_data->device_type = plantronics_device_type(hdev); in plantronics_probe()
203 drv_data->quirks = id->driver_data; in plantronics_probe()
204 drv_data->last_volume_key_ts = jiffies - msecs_to_jiffies(PLT_DOUBLE_KEY_TIMEOUT); in plantronics_probe()