Input: alps - allow up to 2 invalid packets without resetting device
authorPali Rohár <pali.rohar@gmail.com>
Sat, 8 Nov 2014 20:58:57 +0000 (12:58 -0800)
committerZefan Li <lizefan@huawei.com>
Mon, 2 Feb 2015 09:05:19 +0000 (17:05 +0800)
commite3412bce0c655b3896c0142b58ccddb6ae91bc01
treed179b82fad905b438a0f9a6db81aacfce584c0c7
parent11246b668d42617a626de9b4ffdd611c5e7d79dd
Input: alps - allow up to 2 invalid packets without resetting device

commit 9d720b34c0a432639252f63012e18b0507f5b432 upstream.

On some Dell Latitude laptops ALPS device or Dell EC send one invalid byte
in 6 bytes ALPS packet. In this case psmouse driver enter out of sync
state. It looks like that all other bytes in packets are valid and also
device working properly. So there is no need to do full device reset, just
need to wait for byte which match condition for first byte (start of
packet). Because ALPS packets are bigger (6 or 8 bytes) default limit is
small.

This patch increase number of invalid bytes to size of 2 ALPS packets which
psmouse driver can drop before do full reset.

Resetting ALPS devices take some time and when doing reset on some Dell
laptops touchpad, trackstick and also keyboard do not respond. So it is
better to do it only if really necessary.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Tested-by: Pali Rohár <pali.rohar@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Zefan Li <lizefan@huawei.com>
drivers/input/mouse/alps.c