diff options
Diffstat (limited to 'drivers/input')
| -rw-r--r-- | drivers/input/mouse/alps.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index bfa62a63942f..b48c6fb317ed 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c | |||
| @@ -933,6 +933,7 @@ static int alps_decode_packet_v7(struct alps_fields *f, | |||
| 933 | unsigned char *p, | 933 | unsigned char *p, |
| 934 | struct psmouse *psmouse) | 934 | struct psmouse *psmouse) |
| 935 | { | 935 | { |
| 936 | struct alps_data *priv = psmouse->private; | ||
| 936 | unsigned char pkt_id; | 937 | unsigned char pkt_id; |
| 937 | 938 | ||
| 938 | pkt_id = alps_get_packet_id_v7(p); | 939 | pkt_id = alps_get_packet_id_v7(p); |
| @@ -963,15 +964,22 @@ static int alps_decode_packet_v7(struct alps_fields *f, | |||
| 963 | 964 | ||
| 964 | alps_get_finger_coordinate_v7(f->mt, p, pkt_id); | 965 | alps_get_finger_coordinate_v7(f->mt, p, pkt_id); |
| 965 | 966 | ||
| 966 | f->left = (p[0] & 0x80) >> 7; | ||
| 967 | f->right = (p[0] & 0x20) >> 5; | ||
| 968 | f->middle = (p[0] & 0x10) >> 4; | ||
| 969 | |||
| 970 | if (pkt_id == V7_PACKET_ID_TWO) | 967 | if (pkt_id == V7_PACKET_ID_TWO) |
| 971 | f->fingers = alps_get_mt_count(f->mt); | 968 | f->fingers = alps_get_mt_count(f->mt); |
| 972 | else /* pkt_id == V7_PACKET_ID_MULTI */ | 969 | else /* pkt_id == V7_PACKET_ID_MULTI */ |
| 973 | f->fingers = 3 + (p[5] & 0x03); | 970 | f->fingers = 3 + (p[5] & 0x03); |
| 974 | 971 | ||
| 972 | f->left = (p[0] & 0x80) >> 7; | ||
| 973 | if (priv->flags & ALPS_BUTTONPAD) { | ||
| 974 | if (p[0] & 0x20) | ||
| 975 | f->fingers++; | ||
| 976 | if (p[0] & 0x10) | ||
| 977 | f->fingers++; | ||
| 978 | } else { | ||
| 979 | f->right = (p[0] & 0x20) >> 5; | ||
| 980 | f->middle = (p[0] & 0x10) >> 4; | ||
| 981 | } | ||
| 982 | |||
| 975 | /* Sometimes a single touch is reported in mt[1] rather then mt[0] */ | 983 | /* Sometimes a single touch is reported in mt[1] rather then mt[0] */ |
| 976 | if (f->fingers == 1 && f->mt[0].x == 0 && f->mt[0].y == 0) { | 984 | if (f->fingers == 1 && f->mt[0].x == 0 && f->mt[0].y == 0) { |
| 977 | f->mt[0].x = f->mt[1].x; | 985 | f->mt[0].x = f->mt[1].x; |
