Skip to content

Commit d7c13d3

Browse files
committed
Input: ALPS - renumber protocol numbers
In order to accommodate new protocol number for Rushmore touchpads let's shift protocol numbers by 8 bits (i.e. 1 -> 0x100) - this way we keep protocol version reported in input device id the same as it was, but add some holes in numbering. Tested-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent de3748f commit d7c13d3

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

drivers/input/mouse/alps.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2526,7 +2526,7 @@ int alps_detect(struct psmouse *psmouse, bool set_properties)
25262526
psmouse->vendor = "ALPS";
25272527
psmouse->name = dummy.flags & ALPS_DUALPOINT ?
25282528
"DualPoint TouchPad" : "GlidePoint";
2529-
psmouse->model = dummy.proto_version << 8;
2529+
psmouse->model = dummy.proto_version;
25302530
}
25312531
return 0;
25322532
}

drivers/input/mouse/alps.h

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414

1515
#include <linux/input/mt.h>
1616

17-
#define ALPS_PROTO_V1 1
18-
#define ALPS_PROTO_V2 2
19-
#define ALPS_PROTO_V3 3
20-
#define ALPS_PROTO_V4 4
21-
#define ALPS_PROTO_V5 5
22-
#define ALPS_PROTO_V6 6
23-
#define ALPS_PROTO_V7 7 /* t3btl t4s */
17+
#define ALPS_PROTO_V1 0x100
18+
#define ALPS_PROTO_V2 0x200
19+
#define ALPS_PROTO_V3 0x300
20+
#define ALPS_PROTO_V4 0x400
21+
#define ALPS_PROTO_V5 0x500
22+
#define ALPS_PROTO_V6 0x600
23+
#define ALPS_PROTO_V7 0x700 /* t3btl t4s */
2424

2525
#define MAX_TOUCHES 2
2626

@@ -64,11 +64,11 @@ enum V7_PACKET_ID {
6464
* lists a number of such touchpads.
6565
*/
6666
struct alps_model_info {
67-
unsigned char signature[3];
68-
unsigned char command_mode_resp;
69-
unsigned char proto_version;
70-
unsigned char byte0, mask0;
71-
int flags;
67+
u8 signature[3];
68+
u8 command_mode_resp;
69+
u16 proto_version;
70+
u8 byte0, mask0;
71+
unsigned int flags;
7272
};
7373

7474
/**
@@ -166,9 +166,9 @@ struct alps_data {
166166
/* these are autodetected when the device is identified */
167167
const struct alps_nibble_commands *nibble_commands;
168168
int addr_command;
169-
unsigned char proto_version;
170-
unsigned char byte0, mask0;
171-
unsigned char fw_ver[3];
169+
u16 proto_version;
170+
u8 byte0, mask0;
171+
u8 fw_ver[3];
172172
int flags;
173173
int x_max;
174174
int y_max;

0 commit comments

Comments
 (0)