• Home
  • Raw
  • Download

Lines Matching +full:timeout +full:- +full:tap +full:- +full:ms

1 // SPDX-License-Identifier: GPL-2.0-only
6 * Copyright (c) 2012-2013 Google (c)
7 * Copyright (c) 2013-2014 Red Hat Inc.
25 #include <linux/fixp-arith.h>
28 #include "hid-ids.h"
37 "Disable Tap-To-Click mode reporting for touchpads (only on the K400 currently).");
78 /* Convenience constant to check for any high-res support. */
116 u8 params[HIDPP_REPORT_VERY_LONG_MAX_LENGTH - 4U];
122 u8 params[HIDPP_REPORT_VERY_LONG_MAX_LENGTH - 4U];
151 * struct hidpp_scroll_counter - Utility class for processing high-resolution
155 * @remainder: counts the number of high-resolution units moved since the last
156 * low-resolution event (REL_WHEEL or REL_HWHEEL) was sent. Should
158 * @direction: direction of last movement (1 or -1)
223 switch (hidpp_report->report_id) { in __hidpp_send_report()
231 fields_count = hidpp->very_long_report_length; in __hidpp_send_report()
234 return -ENODEV; in __hidpp_send_report()
241 hidpp_report->device_index = 0xff; in __hidpp_send_report()
243 if (hidpp->quirks & HIDPP_QUIRK_FORCE_OUTPUT_REPORTS) { in __hidpp_send_report()
246 ret = hid_hw_raw_request(hdev, hidpp_report->report_id, in __hidpp_send_report()
251 return ret == fields_count ? 0 : -1; in __hidpp_send_report()
257 * - If ' something else' is positive, that means that an error has been raised
259 * - If ' something else' is negative, that means that we had a classic error
260 * (-ENOMEM, -EPIPE, etc...)
268 mutex_lock(&hidpp->send_mutex); in hidpp_send_message_sync()
270 hidpp->send_receive_buf = response; in hidpp_send_message_sync()
271 hidpp->answer_available = false; in hidpp_send_message_sync()
279 ret = __hidpp_send_report(hidpp->hid_dev, message); in hidpp_send_message_sync()
287 if (!wait_event_timeout(hidpp->wait, hidpp->answer_available, in hidpp_send_message_sync()
289 dbg_hid("%s:timeout waiting for response\n", __func__); in hidpp_send_message_sync()
291 ret = -ETIMEDOUT; in hidpp_send_message_sync()
294 if (response->report_id == REPORT_ID_HIDPP_SHORT && in hidpp_send_message_sync()
295 response->rap.sub_id == HIDPP_ERROR) { in hidpp_send_message_sync()
296 ret = response->rap.params[1]; in hidpp_send_message_sync()
301 if ((response->report_id == REPORT_ID_HIDPP_LONG || in hidpp_send_message_sync()
302 response->report_id == REPORT_ID_HIDPP_VERY_LONG) && in hidpp_send_message_sync()
303 response->fap.feature_index == HIDPP20_ERROR) { in hidpp_send_message_sync()
304 ret = response->fap.params[1]; in hidpp_send_message_sync()
310 mutex_unlock(&hidpp->send_mutex); in hidpp_send_message_sync()
322 if (param_count > sizeof(message->fap.params)) in hidpp_send_fap_command_sync()
323 return -EINVAL; in hidpp_send_fap_command_sync()
327 return -ENOMEM; in hidpp_send_fap_command_sync()
329 if (param_count > (HIDPP_REPORT_LONG_LENGTH - 4)) in hidpp_send_fap_command_sync()
330 message->report_id = REPORT_ID_HIDPP_VERY_LONG; in hidpp_send_fap_command_sync()
332 message->report_id = REPORT_ID_HIDPP_LONG; in hidpp_send_fap_command_sync()
333 message->fap.feature_index = feat_index; in hidpp_send_fap_command_sync()
334 message->fap.funcindex_clientid = funcindex_clientid; in hidpp_send_fap_command_sync()
335 memcpy(&message->fap.params, params, param_count); in hidpp_send_fap_command_sync()
351 !(hidpp_dev->supported_reports & HIDPP_REPORT_SHORT_SUPPORTED)) in hidpp_send_rap_command_sync()
356 max_count = HIDPP_REPORT_SHORT_LENGTH - 4; in hidpp_send_rap_command_sync()
359 max_count = HIDPP_REPORT_LONG_LENGTH - 4; in hidpp_send_rap_command_sync()
362 max_count = hidpp_dev->very_long_report_length - 4; in hidpp_send_rap_command_sync()
365 return -EINVAL; in hidpp_send_rap_command_sync()
369 return -EINVAL; in hidpp_send_rap_command_sync()
373 return -ENOMEM; in hidpp_send_rap_command_sync()
374 message->report_id = report_id; in hidpp_send_rap_command_sync()
375 message->rap.sub_id = sub_id; in hidpp_send_rap_command_sync()
376 message->rap.reg_address = reg_address; in hidpp_send_rap_command_sync()
377 memcpy(&message->rap.params, params, param_count); in hidpp_send_rap_command_sync()
394 return (answer->fap.feature_index == question->fap.feature_index) && in hidpp_match_answer()
395 (answer->fap.funcindex_clientid == question->fap.funcindex_clientid); in hidpp_match_answer()
401 return ((answer->rap.sub_id == HIDPP_ERROR) || in hidpp_match_error()
402 (answer->fap.feature_index == HIDPP20_ERROR)) && in hidpp_match_error()
403 (answer->fap.funcindex_clientid == question->fap.feature_index) && in hidpp_match_error()
404 (answer->fap.params[0] == question->fap.funcindex_clientid); in hidpp_match_error()
410 return (hidpp->wireless_feature_index && in hidpp_report_is_connect_event()
411 (report->fap.feature_index == hidpp->wireless_feature_index)) || in hidpp_report_is_connect_event()
412 ((report->report_id == REPORT_ID_HIDPP_SHORT) && in hidpp_report_is_connect_event()
413 (report->rap.sub_id == 0x41)); in hidpp_report_is_connect_event()
444 * hidpp_scroll_counter_handle_scroll() - Send high- and low-resolution scroll
445 * events given a high-resolution wheel
448 * @hi_res_value: the movement of the wheel, in the mouse's high-resolution
451 * Given a high-resolution movement, this function converts the movement into
452 * fractions of 120 and emits high-resolution scroll events for the input
454 * emit low-resolution scroll events when appropriate for
455 * backwards-compatibility with userspace input libraries.
464 hi_res_value = hi_res_value * 120/counter->wheel_multiplier; in hidpp_scroll_counter_handle_scroll()
467 remainder = counter->remainder; in hidpp_scroll_counter_handle_scroll()
468 direction = hi_res_value > 0 ? 1 : -1; in hidpp_scroll_counter_handle_scroll()
471 previous = counter->last_time; in hidpp_scroll_counter_handle_scroll()
472 counter->last_time = now; in hidpp_scroll_counter_handle_scroll()
479 if (now - previous > 1000000000 || direction != counter->direction) in hidpp_scroll_counter_handle_scroll()
482 counter->direction = direction; in hidpp_scroll_counter_handle_scroll()
486 * after slow movement, so we want the threshold for low-res events to in hidpp_scroll_counter_handle_scroll()
492 * is half-way to the next detent (i.e. scroll 1 detent after a in hidpp_scroll_counter_handle_scroll()
498 low_res_value = (hi_res_value > 0 ? 1 : -1); in hidpp_scroll_counter_handle_scroll()
500 remainder -= low_res_value * 120; in hidpp_scroll_counter_handle_scroll()
502 counter->remainder = remainder; in hidpp_scroll_counter_handle_scroll()
505 /* -------------------------------------------------------------------------- */
507 /* -------------------------------------------------------------------------- */
515 * hidpp10_set_register - Modify a HID++ 1.0 register.
567 /* On HID++ 1.0 devices, high-res scroll was called "scrolling acceleration". */
647 hidpp->battery.level = in hidpp10_query_battery_status()
650 hidpp->battery.status = status; in hidpp10_query_battery_status()
652 hidpp->battery.online = status == POWER_SUPPLY_STATUS_DISCHARGING || in hidpp10_query_battery_status()
699 hidpp->battery.capacity = response.rap.params[0]; in hidpp10_query_battery_mileage()
701 hidpp->battery.status = status; in hidpp10_query_battery_mileage()
703 hidpp->battery.online = status == POWER_SUPPLY_STATUS_DISCHARGING || in hidpp10_query_battery_mileage()
715 if (report->report_id != REPORT_ID_HIDPP_SHORT) in hidpp10_battery_event()
718 switch (report->rap.sub_id) { in hidpp10_battery_event()
720 capacity = hidpp->battery.capacity; in hidpp10_battery_event()
721 level = hidpp10_battery_status_map_level(report->rawbytes[1]); in hidpp10_battery_event()
722 status = hidpp10_battery_status_map_status(report->rawbytes[2]); in hidpp10_battery_event()
725 capacity = report->rap.params[0]; in hidpp10_battery_event()
726 level = hidpp->battery.level; in hidpp10_battery_event()
727 status = hidpp10_battery_mileage_map_status(report->rawbytes[3]); in hidpp10_battery_event()
733 changed = capacity != hidpp->battery.capacity || in hidpp10_battery_event()
734 level != hidpp->battery.level || in hidpp10_battery_event()
735 status != hidpp->battery.status; in hidpp10_battery_event()
738 hidpp->battery.online = status == POWER_SUPPLY_STATUS_DISCHARGING || in hidpp10_battery_event()
742 hidpp->battery.level = level; in hidpp10_battery_event()
743 hidpp->battery.status = status; in hidpp10_battery_event()
744 if (hidpp->battery.ps) in hidpp10_battery_event()
745 power_supply_changed(hidpp->battery.ps); in hidpp10_battery_event()
815 struct hid_device *hdev = hidpp->hid_dev; in hidpp_unifying_init()
824 snprintf(hdev->uniq, sizeof(hdev->uniq), "%4phD", &serial); in hidpp_unifying_init()
825 dbg_hid("HID++ Unifying: Got serial: %s\n", hdev->uniq); in hidpp_unifying_init()
829 return -EIO; in hidpp_unifying_init()
831 snprintf(hdev->name, sizeof(hdev->name), "%s", name); in hidpp_unifying_init()
838 /* -------------------------------------------------------------------------- */
840 /* -------------------------------------------------------------------------- */
863 return -ENOENT; in hidpp_root_get_feature()
885 hidpp->protocol_major = 1; in hidpp_root_get_protocol_version()
886 hidpp->protocol_minor = 0; in hidpp_root_get_protocol_version()
892 return -EIO; in hidpp_root_get_protocol_version()
895 hid_err(hidpp->hid_dev, "%s: received protocol error 0x%02x\n", in hidpp_root_get_protocol_version()
897 return -EPROTO; in hidpp_root_get_protocol_version()
903 hid_err(hidpp->hid_dev, "%s: ping mismatch 0x%02x != 0x%02x\n", in hidpp_root_get_protocol_version()
905 return -EPROTO; in hidpp_root_get_protocol_version()
908 hidpp->protocol_major = response.rap.params[0]; in hidpp_root_get_protocol_version()
909 hidpp->protocol_minor = response.rap.params[1]; in hidpp_root_get_protocol_version()
912 hid_info(hidpp->hid_dev, "HID++ %u.%u device connected.\n", in hidpp_root_get_protocol_version()
913 hidpp->protocol_major, hidpp->protocol_minor); in hidpp_root_get_protocol_version()
917 /* -------------------------------------------------------------------------- */
919 /* -------------------------------------------------------------------------- */
951 struct hid_device *hdev = hidpp->hid_dev; in hidpp_serial_init()
959 snprintf(hdev->uniq, sizeof(hdev->uniq), "%4phD", &serial); in hidpp_serial_init()
960 dbg_hid("HID++ DeviceInformation: Got serial: %s\n", hdev->uniq); in hidpp_serial_init()
965 /* -------------------------------------------------------------------------- */
967 /* -------------------------------------------------------------------------- */
985 hid_err(hidpp->hid_dev, "%s: received protocol error 0x%02x\n", in hidpp_devicenametype_get_count()
987 return -EPROTO; in hidpp_devicenametype_get_count()
1009 hid_err(hidpp->hid_dev, "%s: received protocol error 0x%02x\n", in hidpp_devicenametype_get_device_name()
1011 return -EPROTO; in hidpp_devicenametype_get_device_name()
1018 count = hidpp->very_long_report_length - 4; in hidpp_devicenametype_get_device_name()
1021 count = HIDPP_REPORT_LONG_LENGTH - 4; in hidpp_devicenametype_get_device_name()
1024 count = HIDPP_REPORT_SHORT_LENGTH - 4; in hidpp_devicenametype_get_device_name()
1027 return -EPROTO; in hidpp_devicenametype_get_device_name()
1065 __name_length - index); in hidpp_get_device_name()
1079 /* -------------------------------------------------------------------------- */
1081 /* -------------------------------------------------------------------------- */
1168 return -EIO; in hidpp20_batterylevel_get_battery_capacity()
1170 hid_err(hidpp->hid_dev, "%s: received protocol error 0x%02x\n", in hidpp20_batterylevel_get_battery_capacity()
1172 return -EPROTO; in hidpp20_batterylevel_get_battery_capacity()
1196 hid_err(hidpp->hid_dev, "%s: received protocol error 0x%02x\n", in hidpp20_batterylevel_get_battery_info()
1198 return -EPROTO; in hidpp20_batterylevel_get_battery_info()
1207 hidpp->capabilities |= HIDPP_CAPABILITY_BATTERY_LEVEL_STATUS; in hidpp20_batterylevel_get_battery_info()
1209 hidpp->capabilities |= HIDPP_CAPABILITY_BATTERY_MILEAGE; in hidpp20_batterylevel_get_battery_info()
1220 if (hidpp->battery.feature_index == 0xff) { in hidpp20_query_battery_info()
1223 &hidpp->battery.feature_index, in hidpp20_query_battery_info()
1230 hidpp->battery.feature_index, in hidpp20_query_battery_info()
1237 hidpp->battery.feature_index); in hidpp20_query_battery_info()
1241 hidpp->battery.status = status; in hidpp20_query_battery_info()
1242 hidpp->battery.capacity = capacity; in hidpp20_query_battery_info()
1243 hidpp->battery.level = level; in hidpp20_query_battery_info()
1245 hidpp->battery.online = status == POWER_SUPPLY_STATUS_DISCHARGING || in hidpp20_query_battery_info()
1258 if (report->fap.feature_index != hidpp->battery.feature_index || in hidpp20_battery_event()
1259 report->fap.funcindex_clientid != EVENT_BATTERY_LEVEL_STATUS_BROADCAST) in hidpp20_battery_event()
1262 status = hidpp20_batterylevel_map_status_capacity(report->fap.params, in hidpp20_battery_event()
1268 hidpp->battery.online = status == POWER_SUPPLY_STATUS_DISCHARGING || in hidpp20_battery_event()
1271 changed = capacity != hidpp->battery.capacity || in hidpp20_battery_event()
1272 level != hidpp->battery.level || in hidpp20_battery_event()
1273 status != hidpp->battery.status; in hidpp20_battery_event()
1276 hidpp->battery.level = level; in hidpp20_battery_event()
1277 hidpp->battery.capacity = capacity; in hidpp20_battery_event()
1278 hidpp->battery.status = status; in hidpp20_battery_event()
1279 if (hidpp->battery.ps) in hidpp20_battery_event()
1280 power_supply_changed(hidpp->battery.ps); in hidpp20_battery_event()
1286 /* -------------------------------------------------------------------------- */
1288 /* -------------------------------------------------------------------------- */
1353 hid_err(hidpp->hid_dev, "%s: received protocol error 0x%02x\n", in hidpp20_battery_get_battery_voltage()
1355 return -EPROTO; in hidpp20_battery_get_battery_voltage()
1360 hidpp->capabilities |= HIDPP_CAPABILITY_BATTERY_VOLTAGE; in hidpp20_battery_get_battery_voltage()
1374 if (hidpp->battery.voltage_feature_index == 0xff) { in hidpp20_query_battery_voltage_info()
1376 &hidpp->battery.voltage_feature_index, in hidpp20_query_battery_voltage_info()
1383 hidpp->battery.voltage_feature_index, in hidpp20_query_battery_voltage_info()
1389 hidpp->battery.status = status; in hidpp20_query_battery_voltage_info()
1390 hidpp->battery.voltage = voltage; in hidpp20_query_battery_voltage_info()
1391 hidpp->battery.level = level; in hidpp20_query_battery_voltage_info()
1392 hidpp->battery.charge_type = charge_type; in hidpp20_query_battery_voltage_info()
1393 hidpp->battery.online = status != POWER_SUPPLY_STATUS_NOT_CHARGING; in hidpp20_query_battery_voltage_info()
1404 if (report->fap.feature_index != hidpp->battery.voltage_feature_index || in hidpp20_battery_voltage_event()
1405 report->fap.funcindex_clientid != EVENT_BATTERY_VOLTAGE_STATUS_BROADCAST) in hidpp20_battery_voltage_event()
1408 status = hidpp20_battery_map_status_voltage(report->fap.params, &voltage, in hidpp20_battery_voltage_event()
1411 hidpp->battery.online = status != POWER_SUPPLY_STATUS_NOT_CHARGING; in hidpp20_battery_voltage_event()
1413 if (voltage != hidpp->battery.voltage || status != hidpp->battery.status) { in hidpp20_battery_voltage_event()
1414 hidpp->battery.voltage = voltage; in hidpp20_battery_voltage_event()
1415 hidpp->battery.status = status; in hidpp20_battery_voltage_event()
1416 hidpp->battery.level = level; in hidpp20_battery_voltage_event()
1417 hidpp->battery.charge_type = charge_type; in hidpp20_battery_voltage_event()
1418 if (hidpp->battery.ps) in hidpp20_battery_voltage_event()
1419 power_supply_changed(hidpp->battery.ps); in hidpp20_battery_voltage_event()
1445 val->intval = hidpp->battery.status; in hidpp_battery_get_property()
1448 val->intval = hidpp->battery.capacity; in hidpp_battery_get_property()
1451 val->intval = hidpp->battery.level; in hidpp_battery_get_property()
1454 val->intval = POWER_SUPPLY_SCOPE_DEVICE; in hidpp_battery_get_property()
1457 val->intval = hidpp->battery.online; in hidpp_battery_get_property()
1460 if (!strncmp(hidpp->name, "Logitech ", 9)) in hidpp_battery_get_property()
1461 val->strval = hidpp->name + 9; in hidpp_battery_get_property()
1463 val->strval = hidpp->name; in hidpp_battery_get_property()
1466 val->strval = "Logitech"; in hidpp_battery_get_property()
1469 val->strval = hidpp->hid_dev->uniq; in hidpp_battery_get_property()
1473 val->intval = hidpp->battery.voltage * 1000; in hidpp_battery_get_property()
1476 val->intval = hidpp->battery.charge_type; in hidpp_battery_get_property()
1479 ret = -EINVAL; in hidpp_battery_get_property()
1486 /* -------------------------------------------------------------------------- */
1488 /* -------------------------------------------------------------------------- */
1503 /* -------------------------------------------------------------------------- */
1504 /* 0x2120: Hi-resolution scrolling */
1505 /* -------------------------------------------------------------------------- */
1537 /* -------------------------------------------------------------------------- */
1539 /* -------------------------------------------------------------------------- */
1568 hid_warn(hidpp->hid_dev, in hidpp_hrw_get_wheel_capability()
1596 /* -------------------------------------------------------------------------- */
1598 /* -------------------------------------------------------------------------- */
1615 if (hidpp->battery.feature_index == 0xff) { in hidpp_solar_request_battery_event()
1618 &hidpp->battery.solar_feature_index, in hidpp_solar_request_battery_event()
1625 hidpp->battery.solar_feature_index, in hidpp_solar_request_battery_event()
1629 hid_err(hidpp->hid_dev, "%s: received protocol error 0x%02x\n", in hidpp_solar_request_battery_event()
1631 return -EPROTO; in hidpp_solar_request_battery_event()
1636 hidpp->capabilities |= HIDPP_CAPABILITY_BATTERY_MILEAGE; in hidpp_solar_request_battery_event()
1648 function = report->fap.funcindex_clientid; in hidpp_solar_battery_event()
1651 if (report->fap.feature_index != hidpp->battery.solar_feature_index || in hidpp_solar_battery_event()
1657 capacity = report->fap.params[0]; in hidpp_solar_battery_event()
1661 lux = (report->fap.params[1] << 8) | report->fap.params[2]; in hidpp_solar_battery_event()
1669 if (capacity < hidpp->battery.capacity) in hidpp_solar_battery_event()
1679 hidpp->battery.online = true; in hidpp_solar_battery_event()
1680 if (capacity != hidpp->battery.capacity || in hidpp_solar_battery_event()
1681 status != hidpp->battery.status) { in hidpp_solar_battery_event()
1682 hidpp->battery.capacity = capacity; in hidpp_solar_battery_event()
1683 hidpp->battery.status = status; in hidpp_solar_battery_event()
1684 if (hidpp->battery.ps) in hidpp_solar_battery_event()
1685 power_supply_changed(hidpp->battery.ps); in hidpp_solar_battery_event()
1691 /* -------------------------------------------------------------------------- */
1693 /* -------------------------------------------------------------------------- */
1707 * send a set state command to the device by reading the current items->state
1719 CMD_TOUCHPAD_FW_ITEMS_SET, &items->state, 1, &response); in hidpp_touchpad_fw_items_set()
1722 hid_err(hidpp->hid_dev, "%s: received protocol error 0x%02x\n", in hidpp_touchpad_fw_items_set()
1724 return -EPROTO; in hidpp_touchpad_fw_items_set()
1729 items->presence = params[0]; in hidpp_touchpad_fw_items_set()
1730 items->desired_state = params[1]; in hidpp_touchpad_fw_items_set()
1731 items->state = params[2]; in hidpp_touchpad_fw_items_set()
1732 items->persistent = params[3]; in hidpp_touchpad_fw_items_set()
1737 /* -------------------------------------------------------------------------- */
1739 /* -------------------------------------------------------------------------- */
1792 hid_err(hidpp->hid_dev, "%s: received protocol error 0x%02x\n", in hidpp_touchpad_get_raw_info()
1794 return -EPROTO; in hidpp_touchpad_get_raw_info()
1799 raw_info->x_size = get_unaligned_be16(&params[0]); in hidpp_touchpad_get_raw_info()
1800 raw_info->y_size = get_unaligned_be16(&params[2]); in hidpp_touchpad_get_raw_info()
1801 raw_info->z_range = params[4]; in hidpp_touchpad_get_raw_info()
1802 raw_info->area_range = params[5]; in hidpp_touchpad_get_raw_info()
1803 raw_info->maxcontacts = params[7]; in hidpp_touchpad_get_raw_info()
1804 raw_info->origin = params[8]; in hidpp_touchpad_get_raw_info()
1806 raw_info->res = get_unaligned_be16(&params[13]) * 2 / 51; in hidpp_touchpad_get_raw_info()
1819 * bit 0 - enable raw in hidpp_touchpad_set_raw_report_state()
1820 * bit 1 - 16bit Z, no area in hidpp_touchpad_set_raw_report_state()
1821 * bit 2 - enhanced sensitivity in hidpp_touchpad_set_raw_report_state()
1822 * bit 3 - width, height (4 bits each) instead of area in hidpp_touchpad_set_raw_report_state()
1823 * bit 4 - send raw + gestures (degrades smoothness) in hidpp_touchpad_set_raw_report_state()
1824 * remaining bits - reserved in hidpp_touchpad_set_raw_report_state()
1838 finger->x = x_m << 6 | data[1]; in hidpp_touchpad_touch_event()
1839 finger->y = y_m << 6 | data[3]; in hidpp_touchpad_touch_event()
1841 finger->contact_type = data[0] >> 6; in hidpp_touchpad_touch_event()
1842 finger->contact_status = data[2] >> 6; in hidpp_touchpad_touch_event()
1844 finger->z = data[4]; in hidpp_touchpad_touch_event()
1845 finger->area = data[5]; in hidpp_touchpad_touch_event()
1846 finger->finger_id = data[6] >> 4; in hidpp_touchpad_touch_event()
1853 raw_xy->end_of_frame = data[8] & 0x01; in hidpp_touchpad_raw_xy_event()
1854 raw_xy->spurious_flag = (data[8] >> 1) & 0x01; in hidpp_touchpad_raw_xy_event()
1855 raw_xy->finger_count = data[15] & 0x0f; in hidpp_touchpad_raw_xy_event()
1856 raw_xy->button = (data[8] >> 2) & 0x01; in hidpp_touchpad_raw_xy_event()
1858 if (raw_xy->finger_count) { in hidpp_touchpad_raw_xy_event()
1859 hidpp_touchpad_touch_event(&data[2], &raw_xy->fingers[0]); in hidpp_touchpad_raw_xy_event()
1860 hidpp_touchpad_touch_event(&data[9], &raw_xy->fingers[1]); in hidpp_touchpad_raw_xy_event()
1864 /* -------------------------------------------------------------------------- */
1866 /* -------------------------------------------------------------------------- */
1897 #define HIDPP_FF_EFFECTID_NONE -1
1898 #define HIDPP_FF_EFFECTID_AUTOCENTER -2
1938 -1
1945 -1
1967 for (i = 0; i < data->num_effects; i++) in hidpp_ff_find_effect()
1968 if (data->effect_ids[i] == effect_id) in hidpp_ff_find_effect()
1977 struct hidpp_ff_private_data *data = wd->data; in hidpp_ff_work_handler()
1983 switch (wd->effect_id) { in hidpp_ff_work_handler()
1985 wd->params[0] = data->slot_autocenter; in hidpp_ff_work_handler()
1992 wd->params[0] = hidpp_ff_find_effect(data, wd->effect_id); in hidpp_ff_work_handler()
1997 ret = hidpp_send_fap_command_sync(data->hidpp, data->feature_index, in hidpp_ff_work_handler()
1998 wd->command, wd->params, wd->size, &response); in hidpp_ff_work_handler()
2001 hid_err(data->hidpp->hid_dev, "Failed to send command to device!\n"); in hidpp_ff_work_handler()
2006 switch (wd->command) { in hidpp_ff_work_handler()
2009 if (slot > 0 && slot <= data->num_effects) { in hidpp_ff_work_handler()
2010 if (wd->effect_id >= 0) in hidpp_ff_work_handler()
2012 data->effect_ids[slot-1] = wd->effect_id; in hidpp_ff_work_handler()
2013 else if (wd->effect_id >= HIDPP_FF_EFFECTID_AUTOCENTER) in hidpp_ff_work_handler()
2015 data->slot_autocenter = slot; in hidpp_ff_work_handler()
2019 if (wd->effect_id >= 0) in hidpp_ff_work_handler()
2021 data->effect_ids[wd->params[0]-1] = -1; in hidpp_ff_work_handler()
2022 else if (wd->effect_id >= HIDPP_FF_EFFECTID_AUTOCENTER) in hidpp_ff_work_handler()
2024 data->slot_autocenter = 0; in hidpp_ff_work_handler()
2027 data->gain = (wd->params[0] << 8) + wd->params[1]; in hidpp_ff_work_handler()
2030 data->range = (wd->params[0] << 8) + wd->params[1]; in hidpp_ff_work_handler()
2038 atomic_dec(&data->workqueue_size); in hidpp_ff_work_handler()
2048 return -ENOMEM; in hidpp_ff_queue_work()
2050 INIT_WORK(&wd->work, hidpp_ff_work_handler); in hidpp_ff_queue_work()
2052 wd->data = data; in hidpp_ff_queue_work()
2053 wd->effect_id = effect_id; in hidpp_ff_queue_work()
2054 wd->command = command; in hidpp_ff_queue_work()
2055 wd->size = size; in hidpp_ff_queue_work()
2056 memcpy(wd->params, params, size); in hidpp_ff_queue_work()
2058 atomic_inc(&data->workqueue_size); in hidpp_ff_queue_work()
2059 queue_work(data->wq, &wd->work); in hidpp_ff_queue_work()
2062 s = atomic_read(&data->workqueue_size); in hidpp_ff_queue_work()
2064 …hid_warn(data->hidpp->hid_dev, "Force feedback command queue contains %d commands, causing substan… in hidpp_ff_queue_work()
2071 struct hidpp_ff_private_data *data = dev->ff->private; in hidpp_ff_upload_effect()
2077 params[2] = effect->replay.length >> 8; in hidpp_ff_upload_effect()
2078 params[3] = effect->replay.length & 255; in hidpp_ff_upload_effect()
2079 params[4] = effect->replay.delay >> 8; in hidpp_ff_upload_effect()
2080 params[5] = effect->replay.delay & 255; in hidpp_ff_upload_effect()
2082 switch (effect->type) { in hidpp_ff_upload_effect()
2084 force = (effect->u.constant.level * fixp_sin16((effect->direction * 360) >> 16)) >> 15; in hidpp_ff_upload_effect()
2088 params[8] = effect->u.constant.envelope.attack_level >> 7; in hidpp_ff_upload_effect()
2089 params[9] = effect->u.constant.envelope.attack_length >> 8; in hidpp_ff_upload_effect()
2090 params[10] = effect->u.constant.envelope.attack_length & 255; in hidpp_ff_upload_effect()
2091 params[11] = effect->u.constant.envelope.fade_level >> 7; in hidpp_ff_upload_effect()
2092 params[12] = effect->u.constant.envelope.fade_length >> 8; in hidpp_ff_upload_effect()
2093 params[13] = effect->u.constant.envelope.fade_length & 255; in hidpp_ff_upload_effect()
2096 effect->u.constant.level, in hidpp_ff_upload_effect()
2097 effect->direction, force); in hidpp_ff_upload_effect()
2098 dbg_hid(" envelope attack=(%d, %d ms) fade=(%d, %d ms)\n", in hidpp_ff_upload_effect()
2099 effect->u.constant.envelope.attack_level, in hidpp_ff_upload_effect()
2100 effect->u.constant.envelope.attack_length, in hidpp_ff_upload_effect()
2101 effect->u.constant.envelope.fade_level, in hidpp_ff_upload_effect()
2102 effect->u.constant.envelope.fade_length); in hidpp_ff_upload_effect()
2106 switch (effect->u.periodic.waveform) { in hidpp_ff_upload_effect()
2123 …hid_err(data->hidpp->hid_dev, "Unexpected periodic waveform type %i!\n", effect->u.periodic.wavefo… in hidpp_ff_upload_effect()
2124 return -EINVAL; in hidpp_ff_upload_effect()
2126 force = (effect->u.periodic.magnitude * fixp_sin16((effect->direction * 360) >> 16)) >> 15; in hidpp_ff_upload_effect()
2127 params[6] = effect->u.periodic.magnitude >> 8; in hidpp_ff_upload_effect()
2128 params[7] = effect->u.periodic.magnitude & 255; in hidpp_ff_upload_effect()
2129 params[8] = effect->u.periodic.offset >> 8; in hidpp_ff_upload_effect()
2130 params[9] = effect->u.periodic.offset & 255; in hidpp_ff_upload_effect()
2131 params[10] = effect->u.periodic.period >> 8; in hidpp_ff_upload_effect()
2132 params[11] = effect->u.periodic.period & 255; in hidpp_ff_upload_effect()
2133 params[12] = effect->u.periodic.phase >> 8; in hidpp_ff_upload_effect()
2134 params[13] = effect->u.periodic.phase & 255; in hidpp_ff_upload_effect()
2135 params[14] = effect->u.periodic.envelope.attack_level >> 7; in hidpp_ff_upload_effect()
2136 params[15] = effect->u.periodic.envelope.attack_length >> 8; in hidpp_ff_upload_effect()
2137 params[16] = effect->u.periodic.envelope.attack_length & 255; in hidpp_ff_upload_effect()
2138 params[17] = effect->u.periodic.envelope.fade_level >> 7; in hidpp_ff_upload_effect()
2139 params[18] = effect->u.periodic.envelope.fade_length >> 8; in hidpp_ff_upload_effect()
2140 params[19] = effect->u.periodic.envelope.fade_length & 255; in hidpp_ff_upload_effect()
2142 dbg_hid("Uploading periodic force mag=%d/dir=%d, offset=%d, period=%d ms, phase=%d\n", in hidpp_ff_upload_effect()
2143 effect->u.periodic.magnitude, effect->direction, in hidpp_ff_upload_effect()
2144 effect->u.periodic.offset, in hidpp_ff_upload_effect()
2145 effect->u.periodic.period, in hidpp_ff_upload_effect()
2146 effect->u.periodic.phase); in hidpp_ff_upload_effect()
2147 dbg_hid(" envelope attack=(%d, %d ms) fade=(%d, %d ms)\n", in hidpp_ff_upload_effect()
2148 effect->u.periodic.envelope.attack_level, in hidpp_ff_upload_effect()
2149 effect->u.periodic.envelope.attack_length, in hidpp_ff_upload_effect()
2150 effect->u.periodic.envelope.fade_level, in hidpp_ff_upload_effect()
2151 effect->u.periodic.envelope.fade_length); in hidpp_ff_upload_effect()
2156 force = (effect->u.ramp.start_level * fixp_sin16((effect->direction * 360) >> 16)) >> 15; in hidpp_ff_upload_effect()
2159 force = (effect->u.ramp.end_level * fixp_sin16((effect->direction * 360) >> 16)) >> 15; in hidpp_ff_upload_effect()
2162 params[10] = effect->u.ramp.envelope.attack_level >> 7; in hidpp_ff_upload_effect()
2163 params[11] = effect->u.ramp.envelope.attack_length >> 8; in hidpp_ff_upload_effect()
2164 params[12] = effect->u.ramp.envelope.attack_length & 255; in hidpp_ff_upload_effect()
2165 params[13] = effect->u.ramp.envelope.fade_level >> 7; in hidpp_ff_upload_effect()
2166 params[14] = effect->u.ramp.envelope.fade_length >> 8; in hidpp_ff_upload_effect()
2167 params[15] = effect->u.ramp.envelope.fade_length & 255; in hidpp_ff_upload_effect()
2169 dbg_hid("Uploading ramp force level=%d -> %d in dir %d = %d\n", in hidpp_ff_upload_effect()
2170 effect->u.ramp.start_level, in hidpp_ff_upload_effect()
2171 effect->u.ramp.end_level, in hidpp_ff_upload_effect()
2172 effect->direction, force); in hidpp_ff_upload_effect()
2173 dbg_hid(" envelope attack=(%d, %d ms) fade=(%d, %d ms)\n", in hidpp_ff_upload_effect()
2174 effect->u.ramp.envelope.attack_level, in hidpp_ff_upload_effect()
2175 effect->u.ramp.envelope.attack_length, in hidpp_ff_upload_effect()
2176 effect->u.ramp.envelope.fade_level, in hidpp_ff_upload_effect()
2177 effect->u.ramp.envelope.fade_length); in hidpp_ff_upload_effect()
2183 params[1] = HIDPP_FF_CONDITION_CMDS[effect->type - FF_SPRING]; in hidpp_ff_upload_effect()
2184 params[6] = effect->u.condition[0].left_saturation >> 9; in hidpp_ff_upload_effect()
2185 params[7] = (effect->u.condition[0].left_saturation >> 1) & 255; in hidpp_ff_upload_effect()
2186 params[8] = effect->u.condition[0].left_coeff >> 8; in hidpp_ff_upload_effect()
2187 params[9] = effect->u.condition[0].left_coeff & 255; in hidpp_ff_upload_effect()
2188 params[10] = effect->u.condition[0].deadband >> 9; in hidpp_ff_upload_effect()
2189 params[11] = (effect->u.condition[0].deadband >> 1) & 255; in hidpp_ff_upload_effect()
2190 params[12] = effect->u.condition[0].center >> 8; in hidpp_ff_upload_effect()
2191 params[13] = effect->u.condition[0].center & 255; in hidpp_ff_upload_effect()
2192 params[14] = effect->u.condition[0].right_coeff >> 8; in hidpp_ff_upload_effect()
2193 params[15] = effect->u.condition[0].right_coeff & 255; in hidpp_ff_upload_effect()
2194 params[16] = effect->u.condition[0].right_saturation >> 9; in hidpp_ff_upload_effect()
2195 params[17] = (effect->u.condition[0].right_saturation >> 1) & 255; in hidpp_ff_upload_effect()
2198 HIDPP_FF_CONDITION_NAMES[effect->type - FF_SPRING], in hidpp_ff_upload_effect()
2199 effect->u.condition[0].left_coeff, in hidpp_ff_upload_effect()
2200 effect->u.condition[0].left_saturation, in hidpp_ff_upload_effect()
2201 effect->u.condition[0].right_coeff, in hidpp_ff_upload_effect()
2202 effect->u.condition[0].right_saturation); in hidpp_ff_upload_effect()
2204 effect->u.condition[0].deadband, in hidpp_ff_upload_effect()
2205 effect->u.condition[0].center); in hidpp_ff_upload_effect()
2208 hid_err(data->hidpp->hid_dev, "Unexpected force type %i!\n", effect->type); in hidpp_ff_upload_effect()
2209 return -EINVAL; in hidpp_ff_upload_effect()
2212 return hidpp_ff_queue_work(data, effect->id, HIDPP_FF_DOWNLOAD_EFFECT, params, size); in hidpp_ff_upload_effect()
2217 struct hidpp_ff_private_data *data = dev->ff->private; in hidpp_ff_playback()
2229 struct hidpp_ff_private_data *data = dev->ff->private; in hidpp_ff_erase_effect()
2239 struct hidpp_ff_private_data *data = dev->ff->private; in hidpp_ff_set_autocenter()
2261 struct hidpp_ff_private_data *data = dev->ff->private; in hidpp_ff_set_gain()
2277 struct hid_input *hidinput = list_entry(hid->inputs.next, struct hid_input, list); in hidpp_ff_range_show()
2278 struct input_dev *idev = hidinput->input; in hidpp_ff_range_show()
2279 struct hidpp_ff_private_data *data = idev->ff->private; in hidpp_ff_range_show()
2281 return scnprintf(buf, PAGE_SIZE, "%u\n", data->range); in hidpp_ff_range_show()
2287 struct hid_input *hidinput = list_entry(hid->inputs.next, struct hid_input, list); in hidpp_ff_range_store()
2288 struct input_dev *idev = hidinput->input; in hidpp_ff_range_store()
2289 struct hidpp_ff_private_data *data = idev->ff->private; in hidpp_ff_range_store()
2298 hidpp_ff_queue_work(data, -1, HIDPP_FF_SET_APERTURE, params, ARRAY_SIZE(params)); in hidpp_ff_range_store()
2307 struct hidpp_ff_private_data *data = ff->private; in hidpp_ff_destroy()
2308 struct hid_device *hid = data->hidpp->hid_dev; in hidpp_ff_destroy()
2312 device_remove_file(&hid->dev, &dev_attr_range); in hidpp_ff_destroy()
2313 destroy_workqueue(data->wq); in hidpp_ff_destroy()
2314 kfree(data->effect_ids); in hidpp_ff_destroy()
2320 struct hid_device *hid = hidpp->hid_dev; in hidpp_ff_init()
2323 const struct usb_device_descriptor *udesc = &(hid_to_usb_dev(hid)->descriptor); in hidpp_ff_init()
2324 const u16 bcdDevice = le16_to_cpu(udesc->bcdDevice); in hidpp_ff_init()
2326 int error, j, num_slots = data->num_effects; in hidpp_ff_init()
2329 if (list_empty(&hid->inputs)) { in hidpp_ff_init()
2331 return -ENODEV; in hidpp_ff_init()
2333 hidinput = list_entry(hid->inputs.next, struct hid_input, list); in hidpp_ff_init()
2334 dev = hidinput->input; in hidpp_ff_init()
2338 return -EINVAL; in hidpp_ff_init()
2346 set_bit(hidpp_ff_effects[j], dev->ffbit); in hidpp_ff_init()
2349 set_bit(hidpp_ff_effects_v2[j], dev->ffbit); in hidpp_ff_init()
2363 return -ENOMEM; in hidpp_ff_init()
2364 data->effect_ids = kcalloc(num_slots, sizeof(int), GFP_KERNEL); in hidpp_ff_init()
2365 if (!data->effect_ids) { in hidpp_ff_init()
2367 return -ENOMEM; in hidpp_ff_init()
2369 data->wq = create_singlethread_workqueue("hidpp-ff-sendqueue"); in hidpp_ff_init()
2370 if (!data->wq) { in hidpp_ff_init()
2371 kfree(data->effect_ids); in hidpp_ff_init()
2373 return -ENOMEM; in hidpp_ff_init()
2376 data->hidpp = hidpp; in hidpp_ff_init()
2377 data->version = version; in hidpp_ff_init()
2379 data->effect_ids[j] = -1; in hidpp_ff_init()
2381 ff = dev->ff; in hidpp_ff_init()
2382 ff->private = data; in hidpp_ff_init()
2384 ff->upload = hidpp_ff_upload_effect; in hidpp_ff_init()
2385 ff->erase = hidpp_ff_erase_effect; in hidpp_ff_init()
2386 ff->playback = hidpp_ff_playback; in hidpp_ff_init()
2387 ff->set_gain = hidpp_ff_set_gain; in hidpp_ff_init()
2388 ff->set_autocenter = hidpp_ff_set_autocenter; in hidpp_ff_init()
2389 ff->destroy = hidpp_ff_destroy; in hidpp_ff_init()
2392 error = device_create_file(&(hidpp->hid_dev->dev), &dev_attr_range); in hidpp_ff_init()
2394 hid_warn(hidpp->hid_dev, "Unable to create sysfs interface for \"range\", errno %d!\n", error); in hidpp_ff_init()
2397 atomic_set(&data->workqueue_size, 0); in hidpp_ff_init()
2411 /* -------------------------------------------------------------------------- */
2413 /* -------------------------------------------------------------------------- */
2431 return -1; in wtp_input_mapping()
2437 struct wtp_data *wd = hidpp->private_data; in wtp_populate_input()
2439 __set_bit(EV_ABS, input_dev->evbit); in wtp_populate_input()
2440 __set_bit(EV_KEY, input_dev->evbit); in wtp_populate_input()
2441 __clear_bit(EV_REL, input_dev->evbit); in wtp_populate_input()
2442 __clear_bit(EV_LED, input_dev->evbit); in wtp_populate_input()
2444 input_set_abs_params(input_dev, ABS_MT_POSITION_X, 0, wd->x_size, 0, 0); in wtp_populate_input()
2445 input_abs_set_res(input_dev, ABS_MT_POSITION_X, wd->resolution); in wtp_populate_input()
2446 input_set_abs_params(input_dev, ABS_MT_POSITION_Y, 0, wd->y_size, 0, 0); in wtp_populate_input()
2447 input_abs_set_res(input_dev, ABS_MT_POSITION_Y, wd->resolution); in wtp_populate_input()
2454 if (hidpp->quirks & HIDPP_QUIRK_WTP_PHYSICAL_BUTTONS) in wtp_populate_input()
2457 __set_bit(INPUT_PROP_BUTTONPAD, input_dev->propbit); in wtp_populate_input()
2459 input_mt_init_slots(input_dev, wd->maxcontacts, INPUT_MT_POINTER | in wtp_populate_input()
2466 struct wtp_data *wd = hidpp->private_data; in wtp_touch_event()
2469 if (!touch_report->finger_id || touch_report->contact_type) in wtp_touch_event()
2473 slot = input_mt_get_slot_by_key(hidpp->input, touch_report->finger_id); in wtp_touch_event()
2475 input_mt_slot(hidpp->input, slot); in wtp_touch_event()
2476 input_mt_report_slot_state(hidpp->input, MT_TOOL_FINGER, in wtp_touch_event()
2477 touch_report->contact_status); in wtp_touch_event()
2478 if (touch_report->contact_status) { in wtp_touch_event()
2479 input_event(hidpp->input, EV_ABS, ABS_MT_POSITION_X, in wtp_touch_event()
2480 touch_report->x); in wtp_touch_event()
2481 input_event(hidpp->input, EV_ABS, ABS_MT_POSITION_Y, in wtp_touch_event()
2482 wd->flip_y ? wd->y_size - touch_report->y : in wtp_touch_event()
2483 touch_report->y); in wtp_touch_event()
2484 input_event(hidpp->input, EV_ABS, ABS_MT_PRESSURE, in wtp_touch_event()
2485 touch_report->area); in wtp_touch_event()
2495 wtp_touch_event(hidpp, &(raw->fingers[i])); in wtp_send_raw_xy_event()
2497 if (raw->end_of_frame && in wtp_send_raw_xy_event()
2498 !(hidpp->quirks & HIDPP_QUIRK_WTP_PHYSICAL_BUTTONS)) in wtp_send_raw_xy_event()
2499 input_event(hidpp->input, EV_KEY, BTN_LEFT, raw->button); in wtp_send_raw_xy_event()
2501 if (raw->end_of_frame || raw->finger_count <= 2) { in wtp_send_raw_xy_event()
2502 input_mt_sync_frame(hidpp->input); in wtp_send_raw_xy_event()
2503 input_sync(hidpp->input); in wtp_send_raw_xy_event()
2509 struct wtp_data *wd = hidpp->private_data; in wtp_mouse_raw_xy_event()
2535 .finger_count = wd->maxcontacts, in wtp_mouse_raw_xy_event()
2549 struct wtp_data *wd = hidpp->private_data; in wtp_raw_event()
2553 if (!wd || !hidpp->input) in wtp_raw_event()
2563 if (hidpp->quirks & HIDPP_QUIRK_WTP_PHYSICAL_BUTTONS) { in wtp_raw_event()
2564 input_event(hidpp->input, EV_KEY, BTN_LEFT, in wtp_raw_event()
2566 input_event(hidpp->input, EV_KEY, BTN_RIGHT, in wtp_raw_event()
2568 input_sync(hidpp->input); in wtp_raw_event()
2577 if ((report->fap.feature_index != wd->mt_feature_index) || in wtp_raw_event()
2578 (report->fap.funcindex_clientid != EVENT_TOUCHPAD_RAW_XY)) in wtp_raw_event()
2591 struct wtp_data *wd = hidpp->private_data; in wtp_get_config()
2597 &wd->mt_feature_index, &feature_type); in wtp_get_config()
2602 ret = hidpp_touchpad_get_raw_info(hidpp, wd->mt_feature_index, in wtp_get_config()
2607 wd->x_size = raw_info.x_size; in wtp_get_config()
2608 wd->y_size = raw_info.y_size; in wtp_get_config()
2609 wd->maxcontacts = raw_info.maxcontacts; in wtp_get_config()
2610 wd->flip_y = raw_info.origin == TOUCHPAD_RAW_XY_ORIGIN_LOWER_LEFT; in wtp_get_config()
2611 wd->resolution = raw_info.res; in wtp_get_config()
2612 if (!wd->resolution) in wtp_get_config()
2613 wd->resolution = WTP_MANUAL_RESOLUTION; in wtp_get_config()
2623 wd = devm_kzalloc(&hdev->dev, sizeof(struct wtp_data), in wtp_allocate()
2626 return -ENOMEM; in wtp_allocate()
2628 hidpp->private_data = wd; in wtp_allocate()
2636 struct wtp_data *wd = hidpp->private_data; in wtp_connect()
2639 if (!wd->x_size) { in wtp_connect()
2647 return hidpp_touchpad_set_raw_report_state(hidpp, wd->mt_feature_index, in wtp_connect()
2651 /* ------------------------------------------------------------------------- */
2653 /* ------------------------------------------------------------------------- */
2664 * forward button -> Super_R
2665 * backward button -> Super_L+'d' (press only)
2666 * middle button -> 1st time: Alt_L+SuperL+XF86TouchpadOff (press only)
2667 * 2nd time: left-click (press only)
2668 * NB: press-only means that when the button is pressed, the
2676 * - it never sends a keyboard key event
2677 * - for the three mouse button it sends:
2718 if (!hidpp->input) { in m560_raw_event()
2720 return -EINVAL; in m560_raw_event()
2734 * data[1] = device-id in m560_raw_event()
2736 * data[5] = 0xaf -> middle in m560_raw_event()
2737 * 0xb0 -> forward in m560_raw_event()
2738 * 0xae -> backward in m560_raw_event()
2739 * 0x00 -> release all in m560_raw_event()
2745 input_report_key(hidpp->input, BTN_MIDDLE, 1); in m560_raw_event()
2748 input_report_key(hidpp->input, BTN_FORWARD, 1); in m560_raw_event()
2751 input_report_key(hidpp->input, BTN_BACK, 1); in m560_raw_event()
2754 input_report_key(hidpp->input, BTN_BACK, 0); in m560_raw_event()
2755 input_report_key(hidpp->input, BTN_FORWARD, 0); in m560_raw_event()
2756 input_report_key(hidpp->input, BTN_MIDDLE, 0); in m560_raw_event()
2762 input_sync(hidpp->input); in m560_raw_event()
2776 input_report_key(hidpp->input, BTN_LEFT, in m560_raw_event()
2778 input_report_key(hidpp->input, BTN_RIGHT, in m560_raw_event()
2782 input_report_rel(hidpp->input, REL_HWHEEL, -1); in m560_raw_event()
2783 input_report_rel(hidpp->input, REL_HWHEEL_HI_RES, in m560_raw_event()
2784 -120); in m560_raw_event()
2786 input_report_rel(hidpp->input, REL_HWHEEL, 1); in m560_raw_event()
2787 input_report_rel(hidpp->input, REL_HWHEEL_HI_RES, in m560_raw_event()
2792 input_report_rel(hidpp->input, REL_X, v); in m560_raw_event()
2795 input_report_rel(hidpp->input, REL_Y, v); in m560_raw_event()
2799 hidpp_scroll_counter_handle_scroll(hidpp->input, in m560_raw_event()
2800 &hidpp->vertical_wheel_counter, v); in m560_raw_event()
2802 input_sync(hidpp->input); in m560_raw_event()
2811 __set_bit(EV_KEY, input_dev->evbit); in m560_populate_input()
2812 __set_bit(BTN_MIDDLE, input_dev->keybit); in m560_populate_input()
2813 __set_bit(BTN_RIGHT, input_dev->keybit); in m560_populate_input()
2814 __set_bit(BTN_LEFT, input_dev->keybit); in m560_populate_input()
2815 __set_bit(BTN_BACK, input_dev->keybit); in m560_populate_input()
2816 __set_bit(BTN_FORWARD, input_dev->keybit); in m560_populate_input()
2818 __set_bit(EV_REL, input_dev->evbit); in m560_populate_input()
2819 __set_bit(REL_X, input_dev->relbit); in m560_populate_input()
2820 __set_bit(REL_Y, input_dev->relbit); in m560_populate_input()
2821 __set_bit(REL_WHEEL, input_dev->relbit); in m560_populate_input()
2822 __set_bit(REL_HWHEEL, input_dev->relbit); in m560_populate_input()
2823 __set_bit(REL_WHEEL_HI_RES, input_dev->relbit); in m560_populate_input()
2824 __set_bit(REL_HWHEEL_HI_RES, input_dev->relbit); in m560_populate_input()
2831 return -1; in m560_input_mapping()
2834 /* ------------------------------------------------------------------------- */
2836 /* ------------------------------------------------------------------------- */
2841 * tap-to-click but the setting is not remembered accross reset, annoying some
2854 struct k400_private_data *k400 = hidpp->private_data; in k400_disable_tap_to_click()
2859 if (!k400->feature_index) { in k400_disable_tap_to_click()
2862 &k400->feature_index, &feature_type); in k400_disable_tap_to_click()
2868 ret = hidpp_touchpad_fw_items_set(hidpp, k400->feature_index, &items); in k400_disable_tap_to_click()
2880 k400 = devm_kzalloc(&hdev->dev, sizeof(struct k400_private_data), in k400_allocate()
2883 return -ENOMEM; in k400_allocate()
2885 hidpp->private_data = k400; in k400_allocate()
2900 /* ------------------------------------------------------------------------- */
2902 /* ------------------------------------------------------------------------- */
2918 ret = hidpp_send_fap_command_sync(hidpp, data->feature_index, in g920_ff_set_autocenter()
2923 hid_warn(hidpp->hid_dev, "Failed to autocenter device!\n"); in g920_ff_set_autocenter()
2925 data->slot_autocenter = response.fap.params[0]; in g920_ff_set_autocenter()
2941 &data->feature_index, &feature_type); in g920_get_config()
2946 ret = hidpp_send_fap_command_sync(hidpp, data->feature_index, in g920_get_config()
2953 hid_err(hidpp->hid_dev, in g920_get_config()
2955 return -EPROTO; in g920_get_config()
2958 data->num_effects = response.fap.params[0] - HIDPP_FF_RESERVED_SLOTS; in g920_get_config()
2961 ret = hidpp_send_fap_command_sync(hidpp, data->feature_index, in g920_get_config()
2966 hid_warn(hidpp->hid_dev, "Failed to reset all forces!\n"); in g920_get_config()
2968 ret = hidpp_send_fap_command_sync(hidpp, data->feature_index, in g920_get_config()
2973 hid_warn(hidpp->hid_dev, in g920_get_config()
2976 data->range = ret ? in g920_get_config()
2980 ret = hidpp_send_fap_command_sync(hidpp, data->feature_index, in g920_get_config()
2985 hid_warn(hidpp->hid_dev, in g920_get_config()
2987 data->gain = ret ? in g920_get_config()
2995 /* -------------------------------------------------------------------------- */
2997 /* -------------------------------------------------------------------------- */
3004 if ((usage->hid & HID_USAGE_PAGE) != HID_UP_LOGIVENDOR) in lg_dinovo_input_mapping()
3007 switch (usage->hid & HID_USAGE) { in lg_dinovo_input_mapping()
3015 /* -------------------------------------------------------------------------- */
3017 /* -------------------------------------------------------------------------- */
3030 if (!hidpp->input) in hidpp10_wheel_raw_event()
3031 return -EINVAL; in hidpp10_wheel_raw_event()
3042 input_report_rel(hidpp->input, REL_WHEEL, value); in hidpp10_wheel_raw_event()
3043 input_report_rel(hidpp->input, REL_WHEEL_HI_RES, value * 120); in hidpp10_wheel_raw_event()
3044 input_report_rel(hidpp->input, REL_HWHEEL, hvalue); in hidpp10_wheel_raw_event()
3045 input_report_rel(hidpp->input, REL_HWHEEL_HI_RES, hvalue * 120); in hidpp10_wheel_raw_event()
3046 input_sync(hidpp->input); in hidpp10_wheel_raw_event()
3054 __set_bit(EV_REL, input_dev->evbit); in hidpp10_wheel_populate_input()
3055 __set_bit(REL_WHEEL, input_dev->relbit); in hidpp10_wheel_populate_input()
3056 __set_bit(REL_WHEEL_HI_RES, input_dev->relbit); in hidpp10_wheel_populate_input()
3057 __set_bit(REL_HWHEEL, input_dev->relbit); in hidpp10_wheel_populate_input()
3058 __set_bit(REL_HWHEEL_HI_RES, input_dev->relbit); in hidpp10_wheel_populate_input()
3061 /* -------------------------------------------------------------------------- */
3063 /* -------------------------------------------------------------------------- */
3076 if (!hidpp->input) in hidpp10_extra_mouse_buttons_raw_event()
3077 return -EINVAL; in hidpp10_extra_mouse_buttons_raw_event()
3090 * the same usb-id show different behavior, so we handle both cases. in hidpp10_extra_mouse_buttons_raw_event()
3093 input_report_key(hidpp->input, BTN_MOUSE + i, in hidpp10_extra_mouse_buttons_raw_event()
3098 input_report_key(hidpp->input, BTN_MISC + i, in hidpp10_extra_mouse_buttons_raw_event()
3101 input_sync(hidpp->input); in hidpp10_extra_mouse_buttons_raw_event()
3108 /* BTN_MOUSE - BTN_MOUSE+7 are set already by the descriptor */ in hidpp10_extra_mouse_buttons_populate_input()
3109 __set_bit(BTN_0, input_dev->keybit); in hidpp10_extra_mouse_buttons_populate_input()
3110 __set_bit(BTN_1, input_dev->keybit); in hidpp10_extra_mouse_buttons_populate_input()
3111 __set_bit(BTN_2, input_dev->keybit); in hidpp10_extra_mouse_buttons_populate_input()
3112 __set_bit(BTN_3, input_dev->keybit); in hidpp10_extra_mouse_buttons_populate_input()
3113 __set_bit(BTN_4, input_dev->keybit); in hidpp10_extra_mouse_buttons_populate_input()
3114 __set_bit(BTN_5, input_dev->keybit); in hidpp10_extra_mouse_buttons_populate_input()
3115 __set_bit(BTN_6, input_dev->keybit); in hidpp10_extra_mouse_buttons_populate_input()
3116 __set_bit(BTN_7, input_dev->keybit); in hidpp10_extra_mouse_buttons_populate_input()
3119 /* -------------------------------------------------------------------------- */
3120 /* HID++1.0 kbds which only report 0x10xx consumer usages through sub-id 0x03 */
3121 /* -------------------------------------------------------------------------- */
3123 /* Find the consumer-page input report desc and change Maximums to 0x107f */
3142 size = *rsize - (consumer_rdesc - rdesc); in hidpp10_consumer_keys_report_fixup()
3178 hid_report_raw_event(hidpp->hid_dev, HID_INPUT_REPORT, in hidpp10_consumer_keys_raw_event()
3184 /* -------------------------------------------------------------------------- */
3185 /* High-resolution scroll wheels */
3186 /* -------------------------------------------------------------------------- */
3193 if (hidpp->quirks & HIDPP_QUIRK_HI_RES_SCROLL_X2121) { in hi_res_scroll_enable()
3197 } else if (hidpp->quirks & HIDPP_QUIRK_HI_RES_SCROLL_X2120) { in hi_res_scroll_enable()
3200 } else /* if (hidpp->quirks & HIDPP_QUIRK_HI_RES_SCROLL_1P0) */ { in hi_res_scroll_enable()
3210 hidpp->vertical_wheel_counter.wheel_multiplier = multiplier; in hi_res_scroll_enable()
3211 hid_dbg(hidpp->hid_dev, "wheel multiplier = %d\n", multiplier); in hi_res_scroll_enable()
3215 /* -------------------------------------------------------------------------- */
3217 /* -------------------------------------------------------------------------- */
3228 if (hdev->group == HID_GROUP_LOGITECH_27MHZ_DEVICE || in hidpp_report_fixup()
3229 (hidpp->quirks & HIDPP_QUIRK_HIDPP_CONSUMER_VENDOR_KEYS)) in hidpp_report_fixup()
3244 if (hidpp->quirks & HIDPP_QUIRK_CLASS_WTP) in hidpp_input_mapping()
3246 else if (hidpp->quirks & HIDPP_QUIRK_CLASS_M560 && in hidpp_input_mapping()
3247 field->application != HID_GD_MOUSE) in hidpp_input_mapping()
3250 if (hdev->product == DINOVO_MINI_PRODUCT_ID) in hidpp_input_mapping()
3266 if (hidpp->quirks & HIDPP_QUIRK_CLASS_G920) { in hidpp_input_mapped()
3267 if (usage->type == EV_ABS && (usage->code == ABS_X || in hidpp_input_mapped()
3268 usage->code == ABS_Y || usage->code == ABS_Z || in hidpp_input_mapped()
3269 usage->code == ABS_RZ)) { in hidpp_input_mapped()
3270 field->application = HID_GD_MULTIAXIS; in hidpp_input_mapped()
3281 hidpp->input = input; in hidpp_populate_input()
3283 if (hidpp->quirks & HIDPP_QUIRK_CLASS_WTP) in hidpp_populate_input()
3285 else if (hidpp->quirks & HIDPP_QUIRK_CLASS_M560) in hidpp_populate_input()
3288 if (hidpp->quirks & HIDPP_QUIRK_HIDPP_WHEELS) in hidpp_populate_input()
3291 if (hidpp->quirks & HIDPP_QUIRK_HIDPP_EXTRA_MOUSE_BTNS) in hidpp_populate_input()
3299 struct input_dev *input = hidinput->input; in hidpp_input_configured()
3312 struct hidpp_report *question = hidpp->send_receive_buf; in hidpp_raw_hidpp_event()
3313 struct hidpp_report *answer = hidpp->send_receive_buf; in hidpp_raw_hidpp_event()
3321 if (unlikely(mutex_is_locked(&hidpp->send_mutex))) { in hidpp_raw_hidpp_event()
3329 hidpp->answer_available = true; in hidpp_raw_hidpp_event()
3330 wake_up(&hidpp->wait); in hidpp_raw_hidpp_event()
3333 * We return 1 to hid-core to avoid forwarding the in hidpp_raw_hidpp_event()
3342 atomic_set(&hidpp->connected, in hidpp_raw_hidpp_event()
3343 !(report->rap.params[0] & (1 << 6))); in hidpp_raw_hidpp_event()
3344 if (schedule_work(&hidpp->work) == 0) in hidpp_raw_hidpp_event()
3349 if (hidpp->capabilities & HIDPP_CAPABILITY_HIDPP20_BATTERY) { in hidpp_raw_hidpp_event()
3361 if (hidpp->capabilities & HIDPP_CAPABILITY_HIDPP10_BATTERY) { in hidpp_raw_hidpp_event()
3367 if (hidpp->quirks & HIDPP_QUIRK_HIDPP_WHEELS) { in hidpp_raw_hidpp_event()
3373 if (hidpp->quirks & HIDPP_QUIRK_HIDPP_EXTRA_MOUSE_BTNS) { in hidpp_raw_hidpp_event()
3379 if (hidpp->quirks & HIDPP_QUIRK_HIDPP_CONSUMER_VENDOR_KEYS) { in hidpp_raw_hidpp_event()
3400 if (size != hidpp->very_long_report_length) { in hidpp_raw_event()
3430 if (hidpp->quirks & HIDPP_QUIRK_CLASS_WTP) in hidpp_raw_event()
3432 else if (hidpp->quirks & HIDPP_QUIRK_CLASS_M560) in hidpp_raw_event()
3450 counter = &hidpp->vertical_wheel_counter; in hidpp_event()
3452 * the input device set, or high-res scroll enabling may fail. In such in hidpp_event()
3456 if (!(hidpp->quirks & HIDPP_QUIRK_HI_RES_SCROLL) || value == 0 in hidpp_event()
3457 || hidpp->input == NULL || counter->wheel_multiplier == 0) in hidpp_event()
3460 hidpp_scroll_counter_handle_scroll(hidpp->input, counter, value); in hidpp_event()
3468 struct power_supply_desc *desc = &hidpp->battery.desc; in hidpp_initialize_battery()
3475 if (hidpp->battery.ps) in hidpp_initialize_battery()
3478 hidpp->battery.feature_index = 0xff; in hidpp_initialize_battery()
3479 hidpp->battery.solar_feature_index = 0xff; in hidpp_initialize_battery()
3480 hidpp->battery.voltage_feature_index = 0xff; in hidpp_initialize_battery()
3482 if (hidpp->protocol_major >= 2) { in hidpp_initialize_battery()
3483 if (hidpp->quirks & HIDPP_QUIRK_CLASS_K750) in hidpp_initialize_battery()
3493 hidpp->capabilities |= HIDPP_CAPABILITY_HIDPP20_BATTERY; in hidpp_initialize_battery()
3499 return -ENOENT; in hidpp_initialize_battery()
3500 hidpp->capabilities |= HIDPP_CAPABILITY_BATTERY_MILEAGE; in hidpp_initialize_battery()
3502 hidpp->capabilities |= HIDPP_CAPABILITY_BATTERY_LEVEL_STATUS; in hidpp_initialize_battery()
3504 hidpp->capabilities |= HIDPP_CAPABILITY_HIDPP10_BATTERY; in hidpp_initialize_battery()
3507 battery_props = devm_kmemdup(&hidpp->hid_dev->dev, in hidpp_initialize_battery()
3512 return -ENOMEM; in hidpp_initialize_battery()
3514 num_battery_props = ARRAY_SIZE(hidpp_battery_props) - 3; in hidpp_initialize_battery()
3516 if (hidpp->capabilities & HIDPP_CAPABILITY_BATTERY_MILEAGE) in hidpp_initialize_battery()
3520 if (hidpp->capabilities & HIDPP_CAPABILITY_BATTERY_LEVEL_STATUS) in hidpp_initialize_battery()
3524 if (hidpp->capabilities & HIDPP_CAPABILITY_BATTERY_VOLTAGE) in hidpp_initialize_battery()
3528 battery = &hidpp->battery; in hidpp_initialize_battery()
3530 n = atomic_inc_return(&battery_no) - 1; in hidpp_initialize_battery()
3531 desc->properties = battery_props; in hidpp_initialize_battery()
3532 desc->num_properties = num_battery_props; in hidpp_initialize_battery()
3533 desc->get_property = hidpp_battery_get_property; in hidpp_initialize_battery()
3534 sprintf(battery->name, "hidpp_battery_%ld", n); in hidpp_initialize_battery()
3535 desc->name = battery->name; in hidpp_initialize_battery()
3536 desc->type = POWER_SUPPLY_TYPE_BATTERY; in hidpp_initialize_battery()
3537 desc->use_for_apm = 0; in hidpp_initialize_battery()
3539 battery->ps = devm_power_supply_register(&hidpp->hid_dev->dev, in hidpp_initialize_battery()
3540 &battery->desc, in hidpp_initialize_battery()
3542 if (IS_ERR(battery->ps)) in hidpp_initialize_battery()
3543 return PTR_ERR(battery->ps); in hidpp_initialize_battery()
3545 power_supply_powers(battery->ps, &hidpp->hid_dev->dev); in hidpp_initialize_battery()
3555 if (hidpp->protocol_major < 2) in hidpp_overwrite_name()
3564 snprintf(hdev->name, sizeof(hdev->name), "%s", name); in hidpp_overwrite_name()
3586 struct input_dev *input_dev = devm_input_allocate_device(&hdev->dev); in hidpp_allocate_input()
3593 input_dev->open = hidpp_input_open; in hidpp_allocate_input()
3594 input_dev->close = hidpp_input_close; in hidpp_allocate_input()
3596 input_dev->name = hidpp->name; in hidpp_allocate_input()
3597 input_dev->phys = hdev->phys; in hidpp_allocate_input()
3598 input_dev->uniq = hdev->uniq; in hidpp_allocate_input()
3599 input_dev->id.bustype = hdev->bus; in hidpp_allocate_input()
3600 input_dev->id.vendor = hdev->vendor; in hidpp_allocate_input()
3601 input_dev->id.product = hdev->product; in hidpp_allocate_input()
3602 input_dev->id.version = hdev->version; in hidpp_allocate_input()
3603 input_dev->dev.parent = &hdev->dev; in hidpp_allocate_input()
3610 struct hid_device *hdev = hidpp->hid_dev; in hidpp_connect_event()
3612 bool connected = atomic_read(&hidpp->connected); in hidpp_connect_event()
3617 if (hidpp->battery.ps) { in hidpp_connect_event()
3618 hidpp->battery.online = false; in hidpp_connect_event()
3619 hidpp->battery.status = POWER_SUPPLY_STATUS_UNKNOWN; in hidpp_connect_event()
3620 hidpp->battery.level = POWER_SUPPLY_CAPACITY_LEVEL_UNKNOWN; in hidpp_connect_event()
3621 power_supply_changed(hidpp->battery.ps); in hidpp_connect_event()
3626 if (hidpp->quirks & HIDPP_QUIRK_CLASS_WTP) { in hidpp_connect_event()
3630 } else if (hidpp->quirks & HIDPP_QUIRK_CLASS_M560) { in hidpp_connect_event()
3634 } else if (hidpp->quirks & HIDPP_QUIRK_CLASS_K400) { in hidpp_connect_event()
3640 if (hidpp->quirks & HIDPP_QUIRK_HIDPP_WHEELS) { in hidpp_connect_event()
3646 if (hidpp->quirks & HIDPP_QUIRK_HIDPP_EXTRA_MOUSE_BTNS) { in hidpp_connect_event()
3652 if (hidpp->quirks & HIDPP_QUIRK_HIDPP_CONSUMER_VENDOR_KEYS) { in hidpp_connect_event()
3660 if (!hidpp->protocol_major) { in hidpp_connect_event()
3668 if (hidpp->protocol_major >= 2) { in hidpp_connect_event()
3672 hidpp->wireless_feature_index = feature_index; in hidpp_connect_event()
3675 if (hidpp->name == hdev->name && hidpp->protocol_major >= 2) { in hidpp_connect_event()
3678 devm_name = devm_kasprintf(&hdev->dev, GFP_KERNEL, in hidpp_connect_event()
3684 hidpp->name = devm_name; in hidpp_connect_event()
3691 if (hidpp->capabilities & HIDPP_CAPABILITY_HIDPP10_BATTERY) { in hidpp_connect_event()
3693 if (hidpp->capabilities & HIDPP_CAPABILITY_BATTERY_MILEAGE) in hidpp_connect_event()
3697 } else if (hidpp->capabilities & HIDPP_CAPABILITY_HIDPP20_BATTERY) { in hidpp_connect_event()
3698 if (hidpp->capabilities & HIDPP_CAPABILITY_BATTERY_VOLTAGE) in hidpp_connect_event()
3703 if (hidpp->battery.ps) in hidpp_connect_event()
3704 power_supply_changed(hidpp->battery.ps); in hidpp_connect_event()
3706 if (hidpp->quirks & HIDPP_QUIRK_HI_RES_SCROLL) in hidpp_connect_event()
3709 if (!(hidpp->quirks & HIDPP_QUIRK_DELAYED_INIT) || hidpp->delayed_input) in hidpp_connect_event()
3725 hidpp->delayed_input = input; in hidpp_connect_event()
3744 re = &(hdev->report_enum[HID_OUTPUT_REPORT]); in hidpp_get_report_length()
3745 report = re->report_id_hash[id]; in hidpp_get_report_length()
3749 return report->field[0]->report_count + 1; in hidpp_get_report_length()
3784 hidpp->very_long_report_length = report_length; in hidpp_validate_device()
3800 report_list = &hdev->report_enum[HID_INPUT_REPORT].report_list; in hidpp_application_equals()
3802 return report && report->application == application; in hidpp_application_equals()
3814 hidpp = devm_kzalloc(&hdev->dev, sizeof(*hidpp), GFP_KERNEL); in hidpp_probe()
3816 return -ENOMEM; in hidpp_probe()
3818 hidpp->hid_dev = hdev; in hidpp_probe()
3819 hidpp->name = hdev->name; in hidpp_probe()
3820 hidpp->quirks = id->driver_data; in hidpp_probe()
3832 hidpp->supported_reports = hidpp_validate_device(hdev); in hidpp_probe()
3834 if (!hidpp->supported_reports) { in hidpp_probe()
3836 devm_kfree(&hdev->dev, hidpp); in hidpp_probe()
3840 if (id->group == HID_GROUP_LOGITECH_DJ_DEVICE) in hidpp_probe()
3841 hidpp->quirks |= HIDPP_QUIRK_UNIFYING; in hidpp_probe()
3843 if (id->group == HID_GROUP_LOGITECH_27MHZ_DEVICE && in hidpp_probe()
3845 hidpp->quirks |= HIDPP_QUIRK_HIDPP_WHEELS | in hidpp_probe()
3848 if (id->group == HID_GROUP_LOGITECH_27MHZ_DEVICE && in hidpp_probe()
3850 hidpp->quirks |= HIDPP_QUIRK_HIDPP_CONSUMER_VENDOR_KEYS; in hidpp_probe()
3852 if (hidpp->quirks & HIDPP_QUIRK_CLASS_WTP) { in hidpp_probe()
3856 } else if (hidpp->quirks & HIDPP_QUIRK_CLASS_K400) { in hidpp_probe()
3862 INIT_WORK(&hidpp->work, delayed_work_cb); in hidpp_probe()
3863 mutex_init(&hidpp->send_mutex); in hidpp_probe()
3864 init_waitqueue_head(&hidpp->wait); in hidpp_probe()
3867 ret = sysfs_create_group(&hdev->dev.kobj, &ps_attribute_group); in hidpp_probe()
3870 hdev->name); in hidpp_probe()
3874 * hid subdrivers (hid-input, hidraw). This allows retrieving the dev's in hidpp_probe()
3875 * name and serial number and store these in hdev->name and hdev->uniq, in hidpp_probe()
3876 * before the hid-input and hidraw drivers expose these to userspace. in hidpp_probe()
3886 dev_err(&hdev->dev, "%s:hid_hw_open returned error:%d\n", in hidpp_probe()
3894 if (hidpp->quirks & HIDPP_QUIRK_UNIFYING) in hidpp_probe()
3896 else if (hid_is_usb(hidpp->hid_dev)) in hidpp_probe()
3900 atomic_set(&hidpp->connected, connected); in hidpp_probe()
3901 if (!(hidpp->quirks & HIDPP_QUIRK_UNIFYING)) { in hidpp_probe()
3903 ret = -ENODEV; in hidpp_probe()
3911 if (connected && (hidpp->quirks & HIDPP_QUIRK_CLASS_WTP)) { in hidpp_probe()
3915 } else if (connected && (hidpp->quirks & HIDPP_QUIRK_CLASS_G920)) { in hidpp_probe()
3921 schedule_work(&hidpp->work); in hidpp_probe()
3922 flush_work(&hidpp->work); in hidpp_probe()
3924 if (hidpp->quirks & HIDPP_QUIRK_DELAYED_INIT) in hidpp_probe()
3934 if (hidpp->quirks & HIDPP_QUIRK_CLASS_G920) { in hidpp_probe()
3937 hid_warn(hidpp->hid_dev, in hidpp_probe()
3943 * This relies on logi_dj_ll_close() being a no-op so that DJ connection in hidpp_probe()
3954 sysfs_remove_group(&hdev->dev.kobj, &ps_attribute_group); in hidpp_probe()
3955 cancel_work_sync(&hidpp->work); in hidpp_probe()
3956 mutex_destroy(&hidpp->send_mutex); in hidpp_probe()
3967 sysfs_remove_group(&hdev->dev.kobj, &ps_attribute_group); in hidpp_remove()
3970 cancel_work_sync(&hidpp->work); in hidpp_remove()
3971 mutex_destroy(&hidpp->send_mutex); in hidpp_remove()
4036 { /* Keyboard MX5000 (Bluetooth-receiver in HID proxy mode) */
4039 { /* Dinovo Edge (Bluetooth-receiver in HID proxy mode) */
4042 { /* Keyboard MX5500 (Bluetooth-receiver in HID proxy mode) */
4048 { /* Keyboard LX501 (Y-RR53) */
4051 { /* Keyboard MX3000 (Y-RAM74) */
4054 { /* Keyboard MX3200 (Y-RAV80) */
4107 { HID_ANY_ID - 1, HID_ANY_ID - 1, HID_ANY_ID - 1}
4111 .name = "logitech-hidpp-device",