From ebfeb3d81a93e5ccf7e66e30e0a5e37fad50d20c Mon Sep 17 00:00:00 2001 From: Josh Boyer Date: Tue, 2 Jun 2015 09:13:59 -0400 Subject: [PATCH] Fix middle button issues on external Lenovo keyboards (rhbz 1225563) --- ...lenovo-set-INPUT_PROP_POINTING_STICK.patch | 52 +++++++++++++++++++ kernel.spec | 9 ++++ 2 files changed, 61 insertions(+) create mode 100644 HID-lenovo-set-INPUT_PROP_POINTING_STICK.patch diff --git a/HID-lenovo-set-INPUT_PROP_POINTING_STICK.patch b/HID-lenovo-set-INPUT_PROP_POINTING_STICK.patch new file mode 100644 index 000000000..76419cc52 --- /dev/null +++ b/HID-lenovo-set-INPUT_PROP_POINTING_STICK.patch @@ -0,0 +1,52 @@ +From: Andreas Fleig +Date: Thu, 23 Apr 2015 10:25:58 +0200 +Subject: [PATCH] HID: lenovo: set INPUT_PROP_POINTING_STICK + +Set flags INPUT_PROP_POINTER and INPUT_PROP_POINTING_STICK for the trackpoint +integrated in Lenovo USB and Bluetooth keyboards. Libinput checks these flags +to enable features such as middle-button-scrolling by default. + +Signed-off-by: Andreas Fleig +Reviewed-by: Benjamin Tissoires +Signed-off-by: Jiri Kosina +--- + drivers/hid/hid-lenovo.c | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + +diff --git a/drivers/hid/hid-lenovo.c b/drivers/hid/hid-lenovo.c +index c4c3f0952521..78608d646007 100644 +--- a/drivers/hid/hid-lenovo.c ++++ b/drivers/hid/hid-lenovo.c +@@ -762,6 +762,24 @@ static void lenovo_remove(struct hid_device *hdev) + hid_hw_stop(hdev); + } + ++static void lenovo_input_configured(struct hid_device *hdev, ++ struct hid_input *hi) ++{ ++ switch (hdev->product) { ++ case USB_DEVICE_ID_LENOVO_TPKBD: ++ case USB_DEVICE_ID_LENOVO_CUSBKBD: ++ case USB_DEVICE_ID_LENOVO_CBTKBD: ++ if (test_bit(EV_REL, hi->input->evbit)) { ++ /* set only for trackpoint device */ ++ __set_bit(INPUT_PROP_POINTER, hi->input->propbit); ++ __set_bit(INPUT_PROP_POINTING_STICK, ++ hi->input->propbit); ++ } ++ break; ++ } ++} ++ ++ + static const struct hid_device_id lenovo_devices[] = { + { HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_TPKBD) }, + { HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_CUSBKBD) }, +@@ -774,6 +792,7 @@ MODULE_DEVICE_TABLE(hid, lenovo_devices); + static struct hid_driver lenovo_driver = { + .name = "lenovo", + .id_table = lenovo_devices, ++ .input_configured = lenovo_input_configured, + .input_mapping = lenovo_input_mapping, + .probe = lenovo_probe, + .remove = lenovo_remove, diff --git a/kernel.spec b/kernel.spec index de7638720..a5aa6b7d0 100644 --- a/kernel.spec +++ b/kernel.spec @@ -609,6 +609,9 @@ Patch26203: v4l-uvcvideo-Fix-incorrect-bandwidth-with-Chicony-de.patch #rhbz 1217249 Patch26214: acpi_video-Add-enable_native_backlight-quirk-for-Mac.patch +#rhbz 1225563 +Patch26215: HID-lenovo-set-INPUT_PROP_POINTING_STICK.patch + # END OF PATCH DEFINITIONS %endif @@ -1336,6 +1339,9 @@ ApplyPatch v4l-uvcvideo-Fix-incorrect-bandwidth-with-Chicony-de.patch #rhbz 1217249 ApplyPatch acpi_video-Add-enable_native_backlight-quirk-for-Mac.patch +#rhbz 1225563 +ApplyPatch HID-lenovo-set-INPUT_PROP_POINTING_STICK.patch + # END OF PATCH APPLICATIONS %endif @@ -2196,6 +2202,9 @@ fi # # %changelog +* Tue Jun 02 2015 Josh Boyer +- Fix middle button issues on external Lenovo keyboards (rhbz 1225563) + * Mon Jun 01 2015 Josh Boyer - 4.1.0-0.rc6.git0.1 - Linux v4.1-rc6