|
|
b39e77f |
From: Andreas Fleig <andreasfleig@gmail.com>
|
|
|
b39e77f |
Date: Thu, 23 Apr 2015 10:25:58 +0200
|
|
|
b39e77f |
Subject: [PATCH] HID: lenovo: set INPUT_PROP_POINTING_STICK
|
|
|
b39e77f |
|
|
|
b39e77f |
Set flags INPUT_PROP_POINTER and INPUT_PROP_POINTING_STICK for the trackpoint
|
|
|
b39e77f |
integrated in Lenovo USB and Bluetooth keyboards. Libinput checks these flags
|
|
|
b39e77f |
to enable features such as middle-button-scrolling by default.
|
|
|
b39e77f |
|
|
|
b39e77f |
Signed-off-by: Andreas Fleig <andreasfleig@gmail.com>
|
|
|
b39e77f |
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
|
|
|
b39e77f |
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
|
|
|
b39e77f |
---
|
|
|
b39e77f |
drivers/hid/hid-lenovo.c | 19 +++++++++++++++++++
|
|
|
b39e77f |
1 file changed, 19 insertions(+)
|
|
|
b39e77f |
|
|
|
b39e77f |
diff --git a/drivers/hid/hid-lenovo.c b/drivers/hid/hid-lenovo.c
|
|
|
b39e77f |
index c4c3f0952521..78608d646007 100644
|
|
|
b39e77f |
--- a/drivers/hid/hid-lenovo.c
|
|
|
b39e77f |
+++ b/drivers/hid/hid-lenovo.c
|
|
|
b39e77f |
@@ -762,6 +762,24 @@ static void lenovo_remove(struct hid_device *hdev)
|
|
|
b39e77f |
hid_hw_stop(hdev);
|
|
|
b39e77f |
}
|
|
|
b39e77f |
|
|
|
b39e77f |
+static void lenovo_input_configured(struct hid_device *hdev,
|
|
|
b39e77f |
+ struct hid_input *hi)
|
|
|
b39e77f |
+{
|
|
|
b39e77f |
+ switch (hdev->product) {
|
|
|
b39e77f |
+ case USB_DEVICE_ID_LENOVO_TPKBD:
|
|
|
b39e77f |
+ case USB_DEVICE_ID_LENOVO_CUSBKBD:
|
|
|
b39e77f |
+ case USB_DEVICE_ID_LENOVO_CBTKBD:
|
|
|
b39e77f |
+ if (test_bit(EV_REL, hi->input->evbit)) {
|
|
|
b39e77f |
+ /* set only for trackpoint device */
|
|
|
b39e77f |
+ __set_bit(INPUT_PROP_POINTER, hi->input->propbit);
|
|
|
b39e77f |
+ __set_bit(INPUT_PROP_POINTING_STICK,
|
|
|
b39e77f |
+ hi->input->propbit);
|
|
|
b39e77f |
+ }
|
|
|
b39e77f |
+ break;
|
|
|
b39e77f |
+ }
|
|
|
b39e77f |
+}
|
|
|
b39e77f |
+
|
|
|
b39e77f |
+
|
|
|
b39e77f |
static const struct hid_device_id lenovo_devices[] = {
|
|
|
b39e77f |
{ HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_TPKBD) },
|
|
|
b39e77f |
{ HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_CUSBKBD) },
|
|
|
b39e77f |
@@ -774,6 +792,7 @@ MODULE_DEVICE_TABLE(hid, lenovo_devices);
|
|
|
b39e77f |
static struct hid_driver lenovo_driver = {
|
|
|
b39e77f |
.name = "lenovo",
|
|
|
b39e77f |
.id_table = lenovo_devices,
|
|
|
b39e77f |
+ .input_configured = lenovo_input_configured,
|
|
|
b39e77f |
.input_mapping = lenovo_input_mapping,
|
|
|
b39e77f |
.probe = lenovo_probe,
|
|
|
b39e77f |
.remove = lenovo_remove,
|