Message ID | 20161108151621.GO2927@TopQuark.net (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
On Tuesday 08 November 2016 10:16:21 Paul Donohue wrote: > For consistency and clarity, the input_report_*() functions should > be called by alps_process_packet_ss4_v2() instead of by > alps_decode_ss4_v2(). > > Signed-off-by: Paul Donohue <linux-kernel@PaulSD.com> > > diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c > index b93fe83..12376d2 100644 > --- a/drivers/input/mouse/alps.c > +++ b/drivers/input/mouse/alps.c > @@ -1267,18 +1267,11 @@ static int alps_decode_ss4_v2(struct alps_fields *f, > break; > > case SS4_PACKET_ID_STICK: > - if (!(priv->flags & ALPS_DUALPOINT)) { > - psmouse_warn(psmouse, > - "Rejected trackstick packet from non DualPoint device"); > - } else { > - int x = (s8)(((p[0] & 1) << 7) | (p[1] & 0x7f)); > - int y = (s8)(((p[3] & 1) << 7) | (p[2] & 0x7f)); > - int pressure = (s8)(p[4] & 0x7f); > - > - input_report_rel(priv->dev2, REL_X, x); > - input_report_rel(priv->dev2, REL_Y, -y); > - input_report_abs(priv->dev2, ABS_PRESSURE, pressure); > - } > + f->st.x = (s8)(((p[0] & 1) << 7) | (p[1] & 0x7f)); > + f->st.y = -(s8)(((p[3] & 1) << 7) | (p[2] & 0x7f)); > + f->pressure = (s8)(p[4] & 0x7f); This is not correct. Those fields values are used for single touch events from touchpad -- not from trackstick. Btw, you have access to packet also in process functions, so you can extract x, y and pressure in process function too.
On Wed, Nov 09, 2016 at 01:14:43PM +0100, Pali Rohár wrote: > On Tuesday 08 November 2016 10:16:21 Paul Donohue wrote: > > --- a/drivers/input/mouse/alps.c > > +++ b/drivers/input/mouse/alps.c > > @@ -1267,18 +1267,11 @@ static int alps_decode_ss4_v2(struct alps_fields *f, > > case SS4_PACKET_ID_STICK: > > + f->st.x = (s8)(((p[0] & 1) << 7) | (p[1] & 0x7f)); > > + f->st.y = -(s8)(((p[3] & 1) << 7) | (p[2] & 0x7f)); > > + f->pressure = (s8)(p[4] & 0x7f); > > This is not correct. Those fields values are used for single touch > events from touchpad -- not from trackstick. > > Btw, you have access to packet also in process functions, so you can > extract x, y and pressure in process function too. I was trying to keep all of the decoding logic in alps_decode_ss4_v2(). And since there aren't any fields specifically for the trackstick in alps_fields, I figured the single touch fields would be an appropriate place to stash those coordinates. But if you would prefer to move some of the trackstick decoding logic to alps_process_packet_ss4_v2(), I can do that. -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Thursday 10 November 2016 09:27:39 Paul Donohue wrote: > On Wed, Nov 09, 2016 at 01:14:43PM +0100, Pali Rohár wrote: > > On Tuesday 08 November 2016 10:16:21 Paul Donohue wrote: > > > --- a/drivers/input/mouse/alps.c > > > +++ b/drivers/input/mouse/alps.c > > > @@ -1267,18 +1267,11 @@ static int alps_decode_ss4_v2(struct alps_fields *f, > > > case SS4_PACKET_ID_STICK: > > > + f->st.x = (s8)(((p[0] & 1) << 7) | (p[1] & 0x7f)); > > > + f->st.y = -(s8)(((p[3] & 1) << 7) | (p[2] & 0x7f)); > > > + f->pressure = (s8)(p[4] & 0x7f); > > > > This is not correct. Those fields values are used for single touch > > events from touchpad -- not from trackstick. > > > > Btw, you have access to packet also in process functions, so you can > > extract x, y and pressure in process function too. > > I was trying to keep all of the decoding logic in alps_decode_ss4_v2(). > And since there aren't any fields specifically for the trackstick in > alps_fields, I figured the single touch fields would be an appropriate > place to stash those coordinates. > > But if you would prefer to move some of the trackstick decoding logic to > alps_process_packet_ss4_v2(), I can do that. I see that e.g. alps_process_packet_v1_v2() or alps_process_packet_v6() or alps_process_trackstick_packet_v3() having decode logic... So for me it make sense to have it same also in ss4. But if some other developers prefer something different, let us know! From current code I understand that decode functions are there to fill "struct alps_fields" and process functions to process and send events. I would suggest to read code for other alps protocol versions and have similar behaviour for ss4 as for other protocol versions. At least this produce code which will be consistent...
This series includes a bug fix and assorted cleanup for the Alps SS5 (SS4 v2) code. Changes in v5: * Moved TrackStick decoding logic to alps_process_packet_ss4_v2() to make the code more consistent with other protocol versions (Suggested by Pali Rohár <pali.rohar@gmail.com>) Changes in v4: * Fixed patch formatting issues * Correct casting issues in macros added in v3 Changes in v3: * Added additional code cleanup to make the code easier to understand (Suggested by Pali Rohár <pali.rohar@gmail.com>) Changes in v2: * For consistency with other Alps functions, check packet bytes for packet type rather than adding a flag to alps_fields for packet type. (Suggested by Pali Rohár <pali.rohar@gmail.com>) Paul Donohue (3): Input: ALPS - Fix TrackStick support for SS5 hardware Input: ALPS - Clean up TrackStick handling for SS5 hardware Input: ALPS - Clean up code for SS5 hardware drivers/input/mouse/alps.c | 59 +++++++++++++++++++++++++--------------------- drivers/input/mouse/alps.h | 22 ++++++++++++++++- 2 files changed, 53 insertions(+), 28 deletions(-)
On Thursday 10 November 2016 17:44:43 Paul Donohue wrote: > This series includes a bug fix and assorted cleanup for the Alps SS5 > (SS4 v2) code. > > Changes in v5: > * Moved TrackStick decoding logic to alps_process_packet_ss4_v2() to > make the code more consistent with other protocol versions > (Suggested by Pali Rohár <pali.rohar@gmail.com>) > > Changes in v4: > * Fixed patch formatting issues > * Correct casting issues in macros added in v3 > > Changes in v3: > * Added additional code cleanup to make the code easier to understand > (Suggested by Pali Rohár <pali.rohar@gmail.com>) > > Changes in v2: > * For consistency with other Alps functions, check packet bytes for > packet type rather than adding a flag to alps_fields for packet > type. (Suggested by Pali Rohár <pali.rohar@gmail.com>) > > Paul Donohue (3): > Input: ALPS - Fix TrackStick support for SS5 hardware > Input: ALPS - Clean up TrackStick handling for SS5 hardware > Input: ALPS - Clean up code for SS5 hardware > > drivers/input/mouse/alps.c | 59 > +++++++++++++++++++++++++--------------------- > drivers/input/mouse/alps.h | 22 ++++++++++++++++- > 2 files changed, 53 insertions(+), 28 deletions(-) Whole patch series looks fine. You can add my Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
On Fri, Nov 11, 2016 at 02:59:09PM +0100, Pali Rohár wrote: > On Thursday 10 November 2016 17:44:43 Paul Donohue wrote: > > This series includes a bug fix and assorted cleanup for the Alps SS5 > > (SS4 v2) code. > > > > Changes in v5: > > * Moved TrackStick decoding logic to alps_process_packet_ss4_v2() to > > make the code more consistent with other protocol versions > > (Suggested by Pali Rohár <pali.rohar@gmail.com>) > > > > Changes in v4: > > * Fixed patch formatting issues > > * Correct casting issues in macros added in v3 > > > > Changes in v3: > > * Added additional code cleanup to make the code easier to understand > > (Suggested by Pali Rohár <pali.rohar@gmail.com>) > > > > Changes in v2: > > * For consistency with other Alps functions, check packet bytes for > > packet type rather than adding a flag to alps_fields for packet > > type. (Suggested by Pali Rohár <pali.rohar@gmail.com>) > > > > Paul Donohue (3): > > Input: ALPS - Fix TrackStick support for SS5 hardware > > Input: ALPS - Clean up TrackStick handling for SS5 hardware > > Input: ALPS - Clean up code for SS5 hardware > > > > drivers/input/mouse/alps.c | 59 > > +++++++++++++++++++++++++--------------------- > > drivers/input/mouse/alps.h | 22 ++++++++++++++++- > > 2 files changed, 53 insertions(+), 28 deletions(-) > > Whole patch series looks fine. > You can add my Reviewed-by: Pali Rohár <pali.rohar@gmail.com> FYI: I do not see a dingle email from Paul, only your replies. Thanks.
On Saturday 12 November 2016 01:56:21 Dmitry Torokhov wrote: > On Fri, Nov 11, 2016 at 02:59:09PM +0100, Pali Rohár wrote: > > On Thursday 10 November 2016 17:44:43 Paul Donohue wrote: > > > This series includes a bug fix and assorted cleanup for the Alps > > > SS5 (SS4 v2) code. > > > > > > Changes in v5: > > > * Moved TrackStick decoding logic to alps_process_packet_ss4_v2() > > > to > > > > > > make the code more consistent with other protocol versions > > > (Suggested by Pali Rohár <pali.rohar@gmail.com>) > > > > > > Changes in v4: > > > * Fixed patch formatting issues > > > * Correct casting issues in macros added in v3 > > > > > > Changes in v3: > > > * Added additional code cleanup to make the code easier to > > > understand > > > > > > (Suggested by Pali Rohár <pali.rohar@gmail.com>) > > > > > > Changes in v2: > > > * For consistency with other Alps functions, check packet bytes > > > for > > > > > > packet type rather than adding a flag to alps_fields for packet > > > > > > type. (Suggested by Pali Rohár <pali.rohar@gmail.com>) > > > > > > Paul Donohue (3): > > > Input: ALPS - Fix TrackStick support for SS5 hardware > > > Input: ALPS - Clean up TrackStick handling for SS5 hardware > > > Input: ALPS - Clean up code for SS5 hardware > > > > > > drivers/input/mouse/alps.c | 59 > > > > > > +++++++++++++++++++++++++--------------------- > > > drivers/input/mouse/alps.h | 22 ++++++++++++++++- > > > > > > 2 files changed, 53 insertions(+), 28 deletions(-) > > > > Whole patch series looks fine. > > You can add my Reviewed-by: Pali Rohár <pali.rohar@gmail.com> > > FYI: I do not see a dingle email from Paul, only your replies. Patches were sent to linux-input@vger.kernel.org ML. Maybe some spam filter ate emails? Btw I added you to receivers of my last sent email.
On Sat, Nov 12, 2016 at 02:03:42AM +0100, Pali Rohár wrote: > On Saturday 12 November 2016 01:56:21 Dmitry Torokhov wrote: > > On Fri, Nov 11, 2016 at 02:59:09PM +0100, Pali Rohár wrote: > > > On Thursday 10 November 2016 17:44:43 Paul Donohue wrote: > > > > This series includes a bug fix and assorted cleanup for the Alps > > > > SS5 (SS4 v2) code. > > > > > > > > Changes in v5: > > > > * Moved TrackStick decoding logic to alps_process_packet_ss4_v2() > > > > to > > > > > > > > make the code more consistent with other protocol versions > > > > (Suggested by Pali Rohár <pali.rohar@gmail.com>) > > > > > > > > Changes in v4: > > > > * Fixed patch formatting issues > > > > * Correct casting issues in macros added in v3 > > > > > > > > Changes in v3: > > > > * Added additional code cleanup to make the code easier to > > > > understand > > > > > > > > (Suggested by Pali Rohár <pali.rohar@gmail.com>) > > > > > > > > Changes in v2: > > > > * For consistency with other Alps functions, check packet bytes > > > > for > > > > > > > > packet type rather than adding a flag to alps_fields for packet > > > > > > > > type. (Suggested by Pali Rohár <pali.rohar@gmail.com>) > > > > > > > > Paul Donohue (3): > > > > Input: ALPS - Fix TrackStick support for SS5 hardware > > > > Input: ALPS - Clean up TrackStick handling for SS5 hardware > > > > Input: ALPS - Clean up code for SS5 hardware > > > > > > > > drivers/input/mouse/alps.c | 59 > > > > > > > > +++++++++++++++++++++++++--------------------- > > > > drivers/input/mouse/alps.h | 22 ++++++++++++++++- > > > > > > > > 2 files changed, 53 insertions(+), 28 deletions(-) > > > > > > Whole patch series looks fine. > > > You can add my Reviewed-by: Pali Rohár <pali.rohar@gmail.com> > > > > FYI: I do not see a dingle email from Paul, only your replies. > > Patches were sent to linux-input@vger.kernel.org ML. Maybe some spam > filter ate emails? Btw I added you to receivers of my last sent email. Yes, I looked there as well and did not see anything but you replies. Thanks.
On Saturday 12 November 2016 02:06:40 Dmitry Torokhov wrote: > On Sat, Nov 12, 2016 at 02:03:42AM +0100, Pali Rohár wrote: > > On Saturday 12 November 2016 01:56:21 Dmitry Torokhov wrote: > > > On Fri, Nov 11, 2016 at 02:59:09PM +0100, Pali Rohár wrote: > > > > On Thursday 10 November 2016 17:44:43 Paul Donohue wrote: > > > > > This series includes a bug fix and assorted cleanup for the > > > > > Alps SS5 (SS4 v2) code. > > > > > > > > > > Changes in v5: > > > > > * Moved TrackStick decoding logic to > > > > > alps_process_packet_ss4_v2() to > > > > > > > > > > make the code more consistent with other protocol versions > > > > > (Suggested by Pali Rohár <pali.rohar@gmail.com>) > > > > > > > > > > Changes in v4: > > > > > * Fixed patch formatting issues > > > > > * Correct casting issues in macros added in v3 > > > > > > > > > > Changes in v3: > > > > > * Added additional code cleanup to make the code easier to > > > > > understand > > > > > > > > > > (Suggested by Pali Rohár <pali.rohar@gmail.com>) > > > > > > > > > > Changes in v2: > > > > > * For consistency with other Alps functions, check packet > > > > > bytes for > > > > > > > > > > packet type rather than adding a flag to alps_fields for > > > > > packet > > > > > > > > > > type. (Suggested by Pali Rohár <pali.rohar@gmail.com>) > > > > > > > > > > Paul Donohue (3): > > > > > Input: ALPS - Fix TrackStick support for SS5 hardware > > > > > Input: ALPS - Clean up TrackStick handling for SS5 hardware > > > > > Input: ALPS - Clean up code for SS5 hardware > > > > > > > > > > drivers/input/mouse/alps.c | 59 > > > > > > > > > > +++++++++++++++++++++++++--------------------- > > > > > drivers/input/mouse/alps.h | 22 ++++++++++++++++- > > > > > > > > > > 2 files changed, 53 insertions(+), 28 deletions(-) > > > > > > > > Whole patch series looks fine. > > > > You can add my Reviewed-by: Pali Rohár <pali.rohar@gmail.com> > > > > > > FYI: I do not see a dingle email from Paul, only your replies. > > > > Patches were sent to linux-input@vger.kernel.org ML. Maybe some > > spam filter ate emails? Btw I added you to receivers of my last > > sent email. > > Yes, I looked there as well and did not see anything but you replies. > > Thanks. Do you need to resend patches? Or have you already found them?
On Sat, Nov 12, 2016 at 4:29 AM, Pali Rohár <pali.rohar@gmail.com> wrote: > On Saturday 12 November 2016 02:06:40 Dmitry Torokhov wrote: >> On Sat, Nov 12, 2016 at 02:03:42AM +0100, Pali Rohár wrote: >> > On Saturday 12 November 2016 01:56:21 Dmitry Torokhov wrote: >> > > On Fri, Nov 11, 2016 at 02:59:09PM +0100, Pali Rohár wrote: >> > > > On Thursday 10 November 2016 17:44:43 Paul Donohue wrote: >> > > > > This series includes a bug fix and assorted cleanup for the >> > > > > Alps SS5 (SS4 v2) code. >> > > > > >> > > > > Changes in v5: >> > > > > * Moved TrackStick decoding logic to >> > > > > alps_process_packet_ss4_v2() to >> > > > > >> > > > > make the code more consistent with other protocol versions >> > > > > (Suggested by Pali Rohár <pali.rohar@gmail.com>) >> > > > > >> > > > > Changes in v4: >> > > > > * Fixed patch formatting issues >> > > > > * Correct casting issues in macros added in v3 >> > > > > >> > > > > Changes in v3: >> > > > > * Added additional code cleanup to make the code easier to >> > > > > understand >> > > > > >> > > > > (Suggested by Pali Rohár <pali.rohar@gmail.com>) >> > > > > >> > > > > Changes in v2: >> > > > > * For consistency with other Alps functions, check packet >> > > > > bytes for >> > > > > >> > > > > packet type rather than adding a flag to alps_fields for >> > > > > packet >> > > > > >> > > > > type. (Suggested by Pali Rohár <pali.rohar@gmail.com>) >> > > > > >> > > > > Paul Donohue (3): >> > > > > Input: ALPS - Fix TrackStick support for SS5 hardware >> > > > > Input: ALPS - Clean up TrackStick handling for SS5 hardware >> > > > > Input: ALPS - Clean up code for SS5 hardware >> > > > > >> > > > > drivers/input/mouse/alps.c | 59 >> > > > > >> > > > > +++++++++++++++++++++++++--------------------- >> > > > > drivers/input/mouse/alps.h | 22 ++++++++++++++++- >> > > > > >> > > > > 2 files changed, 53 insertions(+), 28 deletions(-) >> > > > >> > > > Whole patch series looks fine. >> > > > You can add my Reviewed-by: Pali Rohár <pali.rohar@gmail.com> >> > > >> > > FYI: I do not see a dingle email from Paul, only your replies. >> > >> > Patches were sent to linux-input@vger.kernel.org ML. Maybe some >> > spam filter ate emails? Btw I added you to receivers of my last >> > sent email. >> >> Yes, I looked there as well and did not see anything but you replies. >> >> Thanks. > > Do you need to resend patches? Or have you already found them? > Hmm, was the latest v5? I see https://patchwork.kernel.org/patch/9421473/ It looks like Paul is running his own mailserver on what looks like Verizon IP pool, which in this day and age likely makes gmail drop his mails. Thanks.
On Sunday 13 November 2016 07:43:35 Dmitry Torokhov wrote: > On Sat, Nov 12, 2016 at 4:29 AM, Pali Rohár <pali.rohar@gmail.com> > wrote: > > On Saturday 12 November 2016 02:06:40 Dmitry Torokhov wrote: > >> On Sat, Nov 12, 2016 at 02:03:42AM +0100, Pali Rohár wrote: > >> > On Saturday 12 November 2016 01:56:21 Dmitry Torokhov wrote: > >> > > On Fri, Nov 11, 2016 at 02:59:09PM +0100, Pali Rohár wrote: > >> > > > On Thursday 10 November 2016 17:44:43 Paul Donohue wrote: > >> > > > > This series includes a bug fix and assorted cleanup for > >> > > > > the Alps SS5 (SS4 v2) code. > >> > > > > > >> > > > > Changes in v5: > >> > > > > * Moved TrackStick decoding logic to > >> > > > > alps_process_packet_ss4_v2() to > >> > > > > > >> > > > > make the code more consistent with other protocol > >> > > > > versions (Suggested by Pali Rohár > >> > > > > <pali.rohar@gmail.com>) > >> > > > > > >> > > > > Changes in v4: > >> > > > > * Fixed patch formatting issues > >> > > > > * Correct casting issues in macros added in v3 > >> > > > > > >> > > > > Changes in v3: > >> > > > > * Added additional code cleanup to make the code easier to > >> > > > > understand > >> > > > > > >> > > > > (Suggested by Pali Rohár <pali.rohar@gmail.com>) > >> > > > > > >> > > > > Changes in v2: > >> > > > > * For consistency with other Alps functions, check packet > >> > > > > bytes for > >> > > > > > >> > > > > packet type rather than adding a flag to alps_fields for > >> > > > > packet > >> > > > > > >> > > > > type. (Suggested by Pali Rohár <pali.rohar@gmail.com>) > >> > > > > > >> > > > > Paul Donohue (3): > >> > > > > Input: ALPS - Fix TrackStick support for SS5 hardware > >> > > > > Input: ALPS - Clean up TrackStick handling for SS5 > >> > > > > hardware Input: ALPS - Clean up code for SS5 hardware > >> > > > > > >> > > > > drivers/input/mouse/alps.c | 59 > >> > > > > > >> > > > > +++++++++++++++++++++++++--------------------- > >> > > > > drivers/input/mouse/alps.h | 22 ++++++++++++++++- > >> > > > > > >> > > > > 2 files changed, 53 insertions(+), 28 deletions(-) > >> > > > > >> > > > Whole patch series looks fine. > >> > > > You can add my Reviewed-by: Pali Rohár > >> > > > <pali.rohar@gmail.com> > >> > > > >> > > FYI: I do not see a dingle email from Paul, only your replies. > >> > > >> > Patches were sent to linux-input@vger.kernel.org ML. Maybe some > >> > spam filter ate emails? Btw I added you to receivers of my last > >> > sent email. > >> > >> Yes, I looked there as well and did not see anything but you > >> replies. > >> > >> Thanks. > > > > Do you need to resend patches? Or have you already found them? > > Hmm, was the latest v5? I see > https://patchwork.kernel.org/patch/9421473/ Yes, v5 is the last. > It looks like Paul is running his own mailserver on what looks like > Verizon IP pool, which in this day and age likely makes gmail drop > his mails. Hm... looks weird... because at least I received his emails on my gmail account...
On Sun, Nov 13, 2016 at 11:31:21AM +0100, Pali Rohár wrote: > On Sunday 13 November 2016 07:43:35 Dmitry Torokhov wrote: > > >> > > FYI: I do not see a dingle email from Paul, only your replies. > > >> > Patches were sent to linux-input@vger.kernel.org ML. Maybe some > > >> > spam filter ate emails? Btw I added you to receivers of my last > > >> > sent email. > > >> Yes, I looked there as well and did not see anything but you > > >> replies. > > It looks like Paul is running his own mailserver on what looks like > > Verizon IP pool, which in this day and age likely makes gmail drop > > his mails. > Hm... looks weird... because at least I received his emails on my gmail > account... Very weird. Yes, I run my own mail servers ... incoming mail goes to a Verizon IP, but outgoing mail is sent from a US-based web / cloud hosting provider (specifically for this reason - to avoid spam filters). Either way, the mailing list itself is clearly getting my messages (since they show up in the web archive), so spam filtering must be happening after the message has been forwarded by the mailing list. Do the messages show up in your spam folder on gmail? If not, we might have to ask the admins for vger.kernel.org to check their logs so we can figure out where the messages are being lost. -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
This series includes a bug fix and assorted cleanup for the Alps SS5 (SS4 v2) code. Changes in v6: * Added Reviewed-by: Pali Rohár <pali.rohar@gmail.com> * No code changes Changes in v5: * Moved TrackStick decoding logic to alps_process_packet_ss4_v2() to make the code more consistent with other protocol versions (Suggested by Pali Rohár <pali.rohar@gmail.com>) Changes in v4: * Fixed patch formatting issues * Correct casting issues in macros added in v3 Changes in v3: * Added additional code cleanup to make the code easier to understand (Suggested by Pali Rohár <pali.rohar@gmail.com>) Changes in v2: * For consistency with other Alps functions, check packet bytes for packet type rather than adding a flag to alps_fields for packet type. (Suggested by Pali Rohár <pali.rohar@gmail.com>) Paul Donohue (3): Input: ALPS - Fix TrackStick support for SS5 hardware Input: ALPS - Clean up TrackStick handling for SS5 hardware Input: ALPS - Clean up code for SS5 hardware drivers/input/mouse/alps.c | 59 +++++++++++++++++++++++++--------------------- drivers/input/mouse/alps.h | 22 ++++++++++++++++- 2 files changed, 53 insertions(+), 28 deletions(-)
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index b93fe83..12376d2 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c @@ -1267,18 +1267,11 @@ static int alps_decode_ss4_v2(struct alps_fields *f, break; case SS4_PACKET_ID_STICK: - if (!(priv->flags & ALPS_DUALPOINT)) { - psmouse_warn(psmouse, - "Rejected trackstick packet from non DualPoint device"); - } else { - int x = (s8)(((p[0] & 1) << 7) | (p[1] & 0x7f)); - int y = (s8)(((p[3] & 1) << 7) | (p[2] & 0x7f)); - int pressure = (s8)(p[4] & 0x7f); - - input_report_rel(priv->dev2, REL_X, x); - input_report_rel(priv->dev2, REL_Y, -y); - input_report_abs(priv->dev2, ABS_PRESSURE, pressure); - } + f->st.x = (s8)(((p[0] & 1) << 7) | (p[1] & 0x7f)); + f->st.y = -(s8)(((p[3] & 1) << 7) | (p[2] & 0x7f)); + f->pressure = (s8)(p[4] & 0x7f); + f->first_mp = 0; + f->is_mp = 0; break; case SS4_PACKET_ID_IDLE: @@ -1348,12 +1341,21 @@ static void alps_process_packet_ss4_v2(struct psmouse *psmouse) /* Report trackstick */ if (alps_get_pkt_id_ss4_v2(packet) == SS4_PACKET_ID_STICK) { - if (priv->flags & ALPS_DUALPOINT) { - input_report_key(dev2, BTN_LEFT, f->ts_left); - input_report_key(dev2, BTN_RIGHT, f->ts_right); - input_report_key(dev2, BTN_MIDDLE, f->ts_middle); - input_sync(dev2); + if (!(priv->flags & ALPS_DUALPOINT)) { + psmouse_warn(psmouse, + "Rejected trackstick packet from non DualPoint device"); + return; } + + input_report_rel(priv->dev2, REL_X, f->st.x); + input_report_rel(priv->dev2, REL_Y, f->st.y); + input_report_abs(priv->dev2, ABS_PRESSURE, f->pressure); + + input_report_key(dev2, BTN_LEFT, f->ts_left); + input_report_key(dev2, BTN_RIGHT, f->ts_right); + input_report_key(dev2, BTN_MIDDLE, f->ts_middle); + + input_sync(dev2); return; }
For consistency and clarity, the input_report_*() functions should be called by alps_process_packet_ss4_v2() instead of by alps_decode_ss4_v2(). Signed-off-by: Paul Donohue <linux-kernel@PaulSD.com> -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html