Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d92189eb authored by Andreas Fleig's avatar Andreas Fleig Committed by Jiri Kosina
Browse files

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: default avatarAndreas Fleig <andreasfleig@gmail.com>
Reviewed-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 8de29a35
Loading
Loading
Loading
Loading
+19 −0
Original line number Original line Diff line number Diff line
@@ -762,6 +762,24 @@ static void lenovo_remove(struct hid_device *hdev)
	hid_hw_stop(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[] = {
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_TPKBD) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_CUSBKBD) },
	{ 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 = {
static struct hid_driver lenovo_driver = {
	.name = "lenovo",
	.name = "lenovo",
	.id_table = lenovo_devices,
	.id_table = lenovo_devices,
	.input_configured = lenovo_input_configured,
	.input_mapping = lenovo_input_mapping,
	.input_mapping = lenovo_input_mapping,
	.probe = lenovo_probe,
	.probe = lenovo_probe,
	.remove = lenovo_remove,
	.remove = lenovo_remove,