Input: alps - use single touch data when v3 mt data contains only one finger

For v3 protocol devices, use the more accurate single touch data when the
mt data contains only one finger. Note the mt data reporting a finger count
of 1 should never happen, but better safe then sorry.

This brings the v3 bitmap handling in line with what the v4 code does,
allowing to factor out the common bits into a helper function.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
This commit is contained in:
Hans de Goede 2014-07-25 22:46:53 -07:00 committed by Dmitry Torokhov
parent cdf333efdc
commit c38a448a23

View File

@ -669,7 +669,7 @@ static void alps_process_touchpad_packet_v3_v5(struct psmouse *psmouse)
* If we don't have MT data or the bitmaps were empty, we have * If we don't have MT data or the bitmaps were empty, we have
* to rely on ST data. * to rely on ST data.
*/ */
if (!fingers) { if (fingers < 2) {
f->mt[0].x = f->st.x; f->mt[0].x = f->st.x;
f->mt[0].y = f->st.y; f->mt[0].y = f->st.y;
fingers = f->pressure > 0 ? 1 : 0; fingers = f->pressure > 0 ? 1 : 0;