From 874fc3386f265abc853a44362a43f100578070c8 Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Thu, 20 Aug 2015 13:13:27 -0400 Subject: [PATCH] driver-unifying: remove the hidpp 1.0 commands and behavior The M705 talks HID++ 1.0 but the actual button toggle is not persistent. So there is no real need to support this in libratbag for now. This will allow to properly address the other devices. Signed-off-by: Benjamin Tissoires --- src/driver-logitech-unifying.c | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/src/driver-logitech-unifying.c b/src/driver-logitech-unifying.c index 8de58400..988d33f8 100644 --- a/src/driver-logitech-unifying.c +++ b/src/driver-logitech-unifying.c @@ -37,13 +37,13 @@ #include #include -#include "hidpp10.h" #include "libratbag-private.h" #include "libratbag-hidraw.h" struct unifying_data { - struct hidpp10_device *dev; + unsigned proto_major; + unsigned proto_minor; }; static void @@ -54,20 +54,6 @@ unifying_read_button(struct ratbag_button *button) static int unifying_write_button(struct ratbag_button *button) { - struct ratbag_device *device = button->device; - struct unifying_data *data = ratbag_get_drv_data(device); - struct hidpp10_device *dev = data->dev; - - /* FIXME: this only toggles button 6 */ - - /* M705 with FW RR 17.01 - build 0017 */ - if (dev->fw_major == 0x17 && - dev->fw_minor == 0x01 && - dev->build == 0x0015) - hidpp10_toggle_individual_feature(device, - dev, - FEATURE_BIT_R0_SPECIAL_BUTTON_FUNCTION, - -1); return -1; } @@ -105,7 +91,6 @@ unifying_probe(struct ratbag_device *device, const struct ratbag_id id) { int rc; struct unifying_data *drv_data; - struct hidpp10_device dev; rc = ratbag_open_hidraw(device); if (rc) { @@ -120,15 +105,8 @@ unifying_probe(struct ratbag_device *device, const struct ratbag_id id) if (!drv_data) return -ENODEV; - rc = hidpp10_get_device_from_wpid(device, - id.id.product, - &dev); - if (rc) { - log_error(device->ratbag, - "Failed to get HID++1.0 device for %s\n", - device->name); - goto err; - } + drv_data->proto_major = 1; + drv_data->proto_minor = 0; ratbag_set_drv_data(device, drv_data);