Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
[firefly-linux-kernel-4.4.55.git] / drivers / hid / hid-logitech-hidpp.c
index e77658cd037ca858270f8c238becbf93b7f22e8a..b3cf6fd4be96473ba62ebbbf92d1522c024a509e 100644 (file)
@@ -28,6 +28,11 @@ MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Benjamin Tissoires <benjamin.tissoires@gmail.com>");
 MODULE_AUTHOR("Nestor Lopez Casado <nlopezcasad@logitech.com>");
 
+static bool disable_raw_mode;
+module_param(disable_raw_mode, bool, 0644);
+MODULE_PARM_DESC(disable_raw_mode,
+       "Disable Raw mode reporting for touchpads and keep firmware gestures.");
+
 #define REPORT_ID_HIDPP_SHORT                  0x10
 #define REPORT_ID_HIDPP_LONG                   0x11
 
@@ -1188,6 +1193,11 @@ static int hidpp_probe(struct hid_device *hdev, const struct hid_device_id *id)
 
        hidpp->quirks = id->driver_data;
 
+       if (disable_raw_mode) {
+               hidpp->quirks &= ~HIDPP_QUIRK_CLASS_WTP;
+               hidpp->quirks &= ~HIDPP_QUIRK_DELAYED_INIT;
+       }
+
        if (hidpp->quirks & HIDPP_QUIRK_CLASS_WTP) {
                ret = wtp_allocate(hdev, id);
                if (ret)
@@ -1210,6 +1220,7 @@ static int hidpp_probe(struct hid_device *hdev, const struct hid_device_id *id)
        connected = hidpp_is_connected(hidpp);
        if (id->group != HID_GROUP_LOGITECH_DJ_DEVICE) {
                if (!connected) {
+                       ret = -ENODEV;
                        hid_err(hdev, "Device not connected");
                        hid_device_io_stop(hdev);
                        goto hid_parse_fail;