linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: "Pali Rohár" <pali.rohar@gmail.com>,
	linux-input@vger.kernel.org,
	"Hans de Goede" <hdegoede@redhat.com>
Subject: [PATCH 2/2] alps: Report alps v2 Dualpoint Stick events via the right evdev node
Date: Wed,  1 Apr 2015 17:44:06 +0200	[thread overview]
Message-ID: <1427903046-26692-3-git-send-email-hdegoede@redhat.com> (raw)
In-Reply-To: <1427903046-26692-1-git-send-email-hdegoede@redhat.com>

On V2 devices the DualPoint Stick reports bare packets, these should be
reported via the "AlpsPS/2 ALPS DualPoint Stick" dev2 evdev node, which also
has the INPUT_PROP_POINTING_STICK propbit set.

Note that since there is no way to distuingish these packets from an external
ps/2 mouse (in sofar as these laptops have an external ps/2 port) this means
that we will be reporting ps/2 mouse events via this evdev node too, as we've
been doing in kernel 3.19 and older.

This has been tested on a Dell Latitude D620 and a Dell Latitude E6400,
which both have a V2 touchpad + a DualPoint Stick which reports bare packets.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/input/mouse/alps.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
index f2c5545..80b6eca 100644
--- a/drivers/input/mouse/alps.c
+++ b/drivers/input/mouse/alps.c
@@ -1161,7 +1161,12 @@ static void alps_report_bare_ps2_packet(struct psmouse *psmouse,
 	struct alps_data *priv = psmouse->private;
 	struct input_dev *dev;
 
-	if (unlikely(IS_ERR_OR_NULL(priv->dev3))) {
+	/* Figure out which device to use to report the bare packet */
+	if (priv->proto_version == ALPS_PROTO_V2 &&
+	    (priv->flags & ALPS_DUALPOINT)) {
+		/* On V2 devices the DualPoint Stick reports bare packets */
+		dev = priv->dev2;
+	} else if (unlikely(IS_ERR_OR_NULL(priv->dev3))) {
 		/* Register dev3 mouse if we received PS/2 packet first time */
 		if (!IS_ERR(priv->dev3))
 			psmouse_queue_work(psmouse, &priv->dev3_register_work,
-- 
2.3.4


  parent reply	other threads:[~2015-04-01 15:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-01 15:44 [PATCH FIX for 4.0 0/2] alps: Report alps v2 Dualpoint Stick events via the right event node Hans de Goede
2015-04-01 15:44 ` [PATCH 1/2] alps: Report bare packets coming from alps_handle_interleaved_ps2 via dev3 Hans de Goede
2015-04-01 15:44 ` Hans de Goede [this message]
2015-04-01 16:11 ` [PATCH FIX for 4.0 0/2] alps: Report alps v2 Dualpoint Stick events via the right event node Pali Rohár
2015-04-01 16:14   ` Hans de Goede
2015-04-01 16:39     ` Pali Rohár

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=1427903046-26692-3-git-send-email-hdegoede@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=pali.rohar@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).