All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Fleig <andreasfleig@gmail.com>
To: "linux-input@vger.kernel.org" <linux-input@vger.kernel.org>
Subject: [PATCH v2] Input: set INPUT_PROP_POINTING_STICK in hid-lenovo
Date: Wed, 08 Apr 2015 11:36:07 +0200	[thread overview]
Message-ID: <1428485767.14997.1@smtp.gmail.com> (raw)

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@gmail.com>

diff --git a/drivers/hid/hid-lenovo.c b/drivers/hid/hid-lenovo.c
index c4c3f09..c4da65d 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 (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);
+	}
+}
+
 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,




             reply	other threads:[~2015-04-08  9:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-08  9:36 Andreas Fleig [this message]
2015-04-13 17:23 ` [PATCH v2] Input: set INPUT_PROP_POINTING_STICK in hid-lenovo Benjamin Tissoires
2015-04-14  9:40   ` Andreas Fleig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1428485767.14997.1@smtp.gmail.com \
    --to=andreasfleig@gmail.com \
    --cc=linux-input@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.