All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4] Input: set INPUT_PROP_POINTING_STICK in hid-lenovo
@ 2015-04-14 10:09 Andreas Fleig
  2015-04-23  8:28 ` Jiri Kosina
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Fleig @ 2015-04-14 10:09 UTC (permalink / raw)
  To: linux-input; +Cc: Jiri Kosina

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>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: Jiri Kosina <jkosina@suse.cz>

diff --git a/drivers/hid/hid-lenovo.c b/drivers/hid/hid-lenovo.c
index c4c3f09..59f21a0 100644
--- a/drivers/hid/hid-lenovo.c
+++ b/drivers/hid/hid-lenovo.c
@@ -762,6 +762,23 @@ 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 +791,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,




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v4] Input: set INPUT_PROP_POINTING_STICK in hid-lenovo
  2015-04-14 10:09 [PATCH v4] Input: set INPUT_PROP_POINTING_STICK in hid-lenovo Andreas Fleig
@ 2015-04-23  8:28 ` Jiri Kosina
  2015-04-23  8:48   ` Andreas Fleig
  0 siblings, 1 reply; 3+ messages in thread
From: Jiri Kosina @ 2015-04-23  8:28 UTC (permalink / raw)
  To: Andreas Fleig; +Cc: linux-input

On Tue, 14 Apr 2015, Andreas Fleig wrote:

> 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>
> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
> Cc: Jiri Kosina <jkosina@suse.cz>

Andreas,

your patch has been severely damaged by your mail client. I have fixed 
everything by hand for now and applied the patch to for-4.2/lenovo branch, 
but please fix your workflow for your future submissions.

Thanks,

-- 
Jiri Kosina
SUSE Labs

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v4] Input: set INPUT_PROP_POINTING_STICK in hid-lenovo
  2015-04-23  8:28 ` Jiri Kosina
@ 2015-04-23  8:48   ` Andreas Fleig
  0 siblings, 0 replies; 3+ messages in thread
From: Andreas Fleig @ 2015-04-23  8:48 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: linux-input

On Thu, Apr 23, 2015 at 10:28 , Jiri Kosina <jkosina@suse.cz> wrote:
> your patch has been severely damaged by your mail client. I have fixed
> everything by hand for now and applied the patch to for-4.2/lenovo 
> branch,
> but please fix your workflow for your future submissions.
Thanks, I didn't notice the rewrapped lines. I should fix geary now ;-)

Andreas


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-04-23  8:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-14 10:09 [PATCH v4] Input: set INPUT_PROP_POINTING_STICK in hid-lenovo Andreas Fleig
2015-04-23  8:28 ` Jiri Kosina
2015-04-23  8:48   ` Andreas Fleig

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.