diff options
author | Seth Forshee <seth.forshee@canonical.com> | 2011-11-07 22:53:24 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-11-08 01:22:10 -0500 |
commit | fa629ef5222193214da9a2b3c94369f79353bec9 (patch) | |
tree | 07221f6fa39181d1bfb8bf51ff4cb86c8e36a6d3 /drivers | |
parent | d4b347b29b4d14647c7394f7167bf6785dc98e50 (diff) |
Input: ALPS - add protocol version field in alps_model_info
In preparation for adding support for more ALPS protocol versions,
add a field for the protocol version to the model info instead of
using a field in the flags. OLDPROTO and !OLDPROTO are now called
version 1 and version 2, repsectively.
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/input/mouse/alps.c | 47 | ||||
-rw-r--r-- | drivers/input/mouse/alps.h | 4 |
2 files changed, 27 insertions, 24 deletions
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index 19d09431addd..77b776d99377 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c | |||
@@ -23,7 +23,6 @@ | |||
23 | #include "psmouse.h" | 23 | #include "psmouse.h" |
24 | #include "alps.h" | 24 | #include "alps.h" |
25 | 25 | ||
26 | #define ALPS_OLDPROTO 0x01 /* old style input */ | ||
27 | #define ALPS_DUALPOINT 0x02 /* touchpad has trackstick */ | 26 | #define ALPS_DUALPOINT 0x02 /* touchpad has trackstick */ |
28 | #define ALPS_PASS 0x04 /* device has a pass-through port */ | 27 | #define ALPS_PASS 0x04 /* device has a pass-through port */ |
29 | 28 | ||
@@ -35,30 +34,30 @@ | |||
35 | 6-byte ALPS packet */ | 34 | 6-byte ALPS packet */ |
36 | 35 | ||
37 | static const struct alps_model_info alps_model_data[] = { | 36 | static const struct alps_model_info alps_model_data[] = { |
38 | { { 0x32, 0x02, 0x14 }, 0xf8, 0xf8, ALPS_PASS | ALPS_DUALPOINT }, /* Toshiba Salellite Pro M10 */ | 37 | { { 0x32, 0x02, 0x14 }, ALPS_PROTO_V2, 0xf8, 0xf8, ALPS_PASS | ALPS_DUALPOINT }, /* Toshiba Salellite Pro M10 */ |
39 | { { 0x33, 0x02, 0x0a }, 0x88, 0xf8, ALPS_OLDPROTO }, /* UMAX-530T */ | 38 | { { 0x33, 0x02, 0x0a }, ALPS_PROTO_V1, 0x88, 0xf8, 0 }, /* UMAX-530T */ |
40 | { { 0x53, 0x02, 0x0a }, 0xf8, 0xf8, 0 }, | 39 | { { 0x53, 0x02, 0x0a }, ALPS_PROTO_V2, 0xf8, 0xf8, 0 }, |
41 | { { 0x53, 0x02, 0x14 }, 0xf8, 0xf8, 0 }, | 40 | { { 0x53, 0x02, 0x14 }, ALPS_PROTO_V2, 0xf8, 0xf8, 0 }, |
42 | { { 0x60, 0x03, 0xc8 }, 0xf8, 0xf8, 0 }, /* HP ze1115 */ | 41 | { { 0x60, 0x03, 0xc8 }, ALPS_PROTO_V2, 0xf8, 0xf8, 0 }, /* HP ze1115 */ |
43 | { { 0x63, 0x02, 0x0a }, 0xf8, 0xf8, 0 }, | 42 | { { 0x63, 0x02, 0x0a }, ALPS_PROTO_V2, 0xf8, 0xf8, 0 }, |
44 | { { 0x63, 0x02, 0x14 }, 0xf8, 0xf8, 0 }, | 43 | { { 0x63, 0x02, 0x14 }, ALPS_PROTO_V2, 0xf8, 0xf8, 0 }, |
45 | { { 0x63, 0x02, 0x28 }, 0xf8, 0xf8, ALPS_FW_BK_2 }, /* Fujitsu Siemens S6010 */ | 44 | { { 0x63, 0x02, 0x28 }, ALPS_PROTO_V2, 0xf8, 0xf8, ALPS_FW_BK_2 }, /* Fujitsu Siemens S6010 */ |
46 | { { 0x63, 0x02, 0x3c }, 0x8f, 0x8f, ALPS_WHEEL }, /* Toshiba Satellite S2400-103 */ | 45 | { { 0x63, 0x02, 0x3c }, ALPS_PROTO_V2, 0x8f, 0x8f, ALPS_WHEEL }, /* Toshiba Satellite S2400-103 */ |
47 | { { 0x63, 0x02, 0x50 }, 0xef, 0xef, ALPS_FW_BK_1 }, /* NEC Versa L320 */ | 46 | { { 0x63, 0x02, 0x50 }, ALPS_PROTO_V2, 0xef, 0xef, ALPS_FW_BK_1 }, /* NEC Versa L320 */ |
48 | { { 0x63, 0x02, 0x64 }, 0xf8, 0xf8, 0 }, | 47 | { { 0x63, 0x02, 0x64 }, ALPS_PROTO_V2, 0xf8, 0xf8, 0 }, |
49 | { { 0x63, 0x03, 0xc8 }, 0xf8, 0xf8, ALPS_PASS | ALPS_DUALPOINT }, /* Dell Latitude D800 */ | 48 | { { 0x63, 0x03, 0xc8 }, ALPS_PROTO_V2, 0xf8, 0xf8, ALPS_PASS | ALPS_DUALPOINT }, /* Dell Latitude D800 */ |
50 | { { 0x73, 0x00, 0x0a }, 0xf8, 0xf8, ALPS_DUALPOINT }, /* ThinkPad R61 8918-5QG */ | 49 | { { 0x73, 0x00, 0x0a }, ALPS_PROTO_V2, 0xf8, 0xf8, ALPS_DUALPOINT }, /* ThinkPad R61 8918-5QG */ |
51 | { { 0x73, 0x02, 0x0a }, 0xf8, 0xf8, 0 }, | 50 | { { 0x73, 0x02, 0x0a }, ALPS_PROTO_V2, 0xf8, 0xf8, 0 }, |
52 | { { 0x73, 0x02, 0x14 }, 0xf8, 0xf8, ALPS_FW_BK_2 }, /* Ahtec Laptop */ | 51 | { { 0x73, 0x02, 0x14 }, ALPS_PROTO_V2, 0xf8, 0xf8, ALPS_FW_BK_2 }, /* Ahtec Laptop */ |
53 | { { 0x20, 0x02, 0x0e }, 0xf8, 0xf8, ALPS_PASS | ALPS_DUALPOINT }, /* XXX */ | 52 | { { 0x20, 0x02, 0x0e }, ALPS_PROTO_V2, 0xf8, 0xf8, ALPS_PASS | ALPS_DUALPOINT }, /* XXX */ |
54 | { { 0x22, 0x02, 0x0a }, 0xf8, 0xf8, ALPS_PASS | ALPS_DUALPOINT }, | 53 | { { 0x22, 0x02, 0x0a }, ALPS_PROTO_V2, 0xf8, 0xf8, ALPS_PASS | ALPS_DUALPOINT }, |
55 | { { 0x22, 0x02, 0x14 }, 0xff, 0xff, ALPS_PASS | ALPS_DUALPOINT }, /* Dell Latitude D600 */ | 54 | { { 0x22, 0x02, 0x14 }, ALPS_PROTO_V2, 0xff, 0xff, ALPS_PASS | ALPS_DUALPOINT }, /* Dell Latitude D600 */ |
56 | /* Dell Latitude E5500, E6400, E6500, Precision M4400 */ | 55 | /* Dell Latitude E5500, E6400, E6500, Precision M4400 */ |
57 | { { 0x62, 0x02, 0x14 }, 0xcf, 0xcf, | 56 | { { 0x62, 0x02, 0x14 }, ALPS_PROTO_V2, 0xcf, 0xcf, |
58 | ALPS_PASS | ALPS_DUALPOINT | ALPS_PS2_INTERLEAVED }, | 57 | ALPS_PASS | ALPS_DUALPOINT | ALPS_PS2_INTERLEAVED }, |
59 | { { 0x73, 0x02, 0x50 }, 0xcf, 0xcf, ALPS_FOUR_BUTTONS }, /* Dell Vostro 1400 */ | 58 | { { 0x73, 0x02, 0x50 }, ALPS_PROTO_V2, 0xcf, 0xcf, ALPS_FOUR_BUTTONS }, /* Dell Vostro 1400 */ |
60 | { { 0x52, 0x01, 0x14 }, 0xff, 0xff, | 59 | { { 0x52, 0x01, 0x14 }, ALPS_PROTO_V2, 0xff, 0xff, |
61 | ALPS_PASS | ALPS_DUALPOINT | ALPS_PS2_INTERLEAVED }, /* Toshiba Tecra A11-11L */ | 60 | ALPS_PASS | ALPS_DUALPOINT | ALPS_PS2_INTERLEAVED }, /* Toshiba Tecra A11-11L */ |
62 | }; | 61 | }; |
63 | 62 | ||
64 | /* | 63 | /* |
@@ -112,7 +111,7 @@ static void alps_process_packet(struct psmouse *psmouse) | |||
112 | int x, y, z, ges, fin, left, right, middle; | 111 | int x, y, z, ges, fin, left, right, middle; |
113 | int back = 0, forward = 0; | 112 | int back = 0, forward = 0; |
114 | 113 | ||
115 | if (model->flags & ALPS_OLDPROTO) { | 114 | if (model->proto_version == ALPS_PROTO_V1) { |
116 | left = packet[2] & 0x10; | 115 | left = packet[2] & 0x10; |
117 | right = packet[2] & 0x08; | 116 | right = packet[2] & 0x08; |
118 | middle = 0; | 117 | middle = 0; |
diff --git a/drivers/input/mouse/alps.h b/drivers/input/mouse/alps.h index 904ed8b3c8be..4ce9bba6a3cd 100644 --- a/drivers/input/mouse/alps.h +++ b/drivers/input/mouse/alps.h | |||
@@ -12,8 +12,12 @@ | |||
12 | #ifndef _ALPS_H | 12 | #ifndef _ALPS_H |
13 | #define _ALPS_H | 13 | #define _ALPS_H |
14 | 14 | ||
15 | #define ALPS_PROTO_V1 0 | ||
16 | #define ALPS_PROTO_V2 1 | ||
17 | |||
15 | struct alps_model_info { | 18 | struct alps_model_info { |
16 | unsigned char signature[3]; | 19 | unsigned char signature[3]; |
20 | unsigned char proto_version; | ||
17 | unsigned char byte0, mask0; | 21 | unsigned char byte0, mask0; |
18 | unsigned char flags; | 22 | unsigned char flags; |
19 | }; | 23 | }; |