[PATCH] Input: set INPUT_PROP_POINTING_STICK in hid-lenovo

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <andreasfleig@xxxxxxxxx>
Cc: Peter Hutterer <peter.hutterer@xxxxxxxxx>

diff --git a/drivers/hid/hid-lenovo.c b/drivers/hid/hid-lenovo.c
index c4c3f09..4cb7235 100644
--- a/drivers/hid/hid-lenovo.c
+++ b/drivers/hid/hid-lenovo.c
@@ -762,6 +762,16 @@ 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)
+{
+	if (*hi->input->ledbit == 0) {
+		/* set only for trackpoint device, identify by missing LEDs */
+		__set_bit(INPUT_PROP_POINTER, hi->input->propbit);
+		__set_bit(INPUT_PROP_POINTING_STICK, hi->input->propbit);
+	}
+}
+
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 +784,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,



--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux