Skip to content

Commit fb2dd7a

Browse files
committed
Input: ALPS - make Rushmore a separate protocol
Even though Rushmore is very close to V3 protocol it is sufficiently different to warrant it's own protocol name. Tested-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent d7c13d3 commit fb2dd7a

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

drivers/input/mouse/alps.c

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ static const struct alps_nibble_commands alps_v6_nibble_commands[] = {
9999
#define ALPS_FOUR_BUTTONS 0x40 /* 4 direction button present */
100100
#define ALPS_PS2_INTERLEAVED 0x80 /* 3-byte PS/2 packet interleaved with
101101
6-byte ALPS packet */
102-
#define ALPS_IS_RUSHMORE 0x100 /* device is a rushmore */
103102
#define ALPS_BUTTONPAD 0x200 /* device is a clickpad */
104103

105104
static const struct alps_model_info alps_model_data[] = {
@@ -412,7 +411,7 @@ static int alps_process_bitmap(struct alps_data *priv,
412411
(2 * (priv->y_bits - 1));
413412

414413
/* y-bitmap order is reversed, except on rushmore */
415-
if (!(priv->flags & ALPS_IS_RUSHMORE)) {
414+
if (priv->proto_version != ALPS_PROTO_V3_RUSHMORE) {
416415
fields->mt[0].y = priv->y_max - fields->mt[0].y;
417416
fields->mt[1].y = priv->y_max - fields->mt[1].y;
418417
}
@@ -648,7 +647,8 @@ static void alps_process_touchpad_packet_v3_v5(struct psmouse *psmouse)
648647
*/
649648
if (f->is_mp) {
650649
fingers = f->fingers;
651-
if (priv->proto_version == ALPS_PROTO_V3) {
650+
if (priv->proto_version == ALPS_PROTO_V3 ||
651+
priv->proto_version == ALPS_PROTO_V3_RUSHMORE) {
652652
if (alps_process_bitmap(priv, f) == 0)
653653
fingers = 0; /* Use st data */
654654

@@ -1275,7 +1275,7 @@ static psmouse_ret_t alps_process_byte(struct psmouse *psmouse)
12751275
psmouse->pktcnt - 1,
12761276
psmouse->packet[psmouse->pktcnt - 1]);
12771277

1278-
if (priv->proto_version == ALPS_PROTO_V3 &&
1278+
if (priv->proto_version == ALPS_PROTO_V3_RUSHMORE &&
12791279
psmouse->pktcnt == psmouse->pktsize) {
12801280
/*
12811281
* Some Dell boxes, such as Latitude E6440 or E7440
@@ -2182,6 +2182,7 @@ static void alps_set_defaults(struct alps_data *priv)
21822182
priv->x_max = 1023;
21832183
priv->y_max = 767;
21842184
break;
2185+
21852186
case ALPS_PROTO_V3:
21862187
priv->hw_init = alps_hw_init_v3;
21872188
priv->process_packet = alps_process_packet_v3;
@@ -2190,6 +2191,18 @@ static void alps_set_defaults(struct alps_data *priv)
21902191
priv->nibble_commands = alps_v3_nibble_commands;
21912192
priv->addr_command = PSMOUSE_CMD_RESET_WRAP;
21922193
break;
2194+
2195+
case ALPS_PROTO_V3_RUSHMORE:
2196+
priv->hw_init = alps_hw_init_rushmore_v3;
2197+
priv->process_packet = alps_process_packet_v3;
2198+
priv->set_abs_params = alps_set_abs_params_mt;
2199+
priv->decode_fields = alps_decode_rushmore;
2200+
priv->nibble_commands = alps_v3_nibble_commands;
2201+
priv->addr_command = PSMOUSE_CMD_RESET_WRAP;
2202+
priv->x_bits = 16;
2203+
priv->y_bits = 12;
2204+
break;
2205+
21932206
case ALPS_PROTO_V4:
21942207
priv->hw_init = alps_hw_init_v4;
21952208
priv->process_packet = alps_process_packet_v4;
@@ -2313,15 +2326,9 @@ static int alps_identify(struct psmouse *psmouse, struct alps_data *priv)
23132326

23142327
return 0;
23152328
} else if (ec[0] == 0x88 && ec[1] == 0x08) {
2316-
priv->proto_version = ALPS_PROTO_V3;
2329+
priv->proto_version = ALPS_PROTO_V3_RUSHMORE;
23172330
alps_set_defaults(priv);
23182331

2319-
priv->hw_init = alps_hw_init_rushmore_v3;
2320-
priv->decode_fields = alps_decode_rushmore;
2321-
priv->x_bits = 16;
2322-
priv->y_bits = 12;
2323-
priv->flags |= ALPS_IS_RUSHMORE;
2324-
23252332
/* hack to make addr_command, nibble_command available */
23262333
psmouse->private = priv;
23272334

drivers/input/mouse/alps.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#define ALPS_PROTO_V1 0x100
1818
#define ALPS_PROTO_V2 0x200
1919
#define ALPS_PROTO_V3 0x300
20+
#define ALPS_PROTO_V3_RUSHMORE 0x310
2021
#define ALPS_PROTO_V4 0x400
2122
#define ALPS_PROTO_V5 0x500
2223
#define ALPS_PROTO_V6 0x600

0 commit comments

Comments
 (0)