Input: ALPS - renumber protocol numbers
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 14 Jan 2015 04:53:22 +0000 (20:53 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Sun, 15 Feb 2015 23:44:16 +0000 (15:44 -0800)
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>
drivers/input/mouse/alps.c
drivers/input/mouse/alps.h

index f205b8be2ce4ecd2395c75dc8fc990513f3fff48..92a886b0eca49d81cf1caa6a23af4e6923a6dd9b 100644 (file)
@@ -2526,7 +2526,7 @@ int alps_detect(struct psmouse *psmouse, bool set_properties)
                psmouse->vendor = "ALPS";
                psmouse->name = dummy.flags & ALPS_DUALPOINT ?
                                "DualPoint TouchPad" : "GlidePoint";
-               psmouse->model = dummy.proto_version << 8;
+               psmouse->model = dummy.proto_version;
        }
        return 0;
 }
index 66240b47819a9569c975cedd1d5443b2b59f6b86..94645bfa2a0d0045b5a314b052f022be8c54668f 100644 (file)
 
 #include <linux/input/mt.h>
 
-#define ALPS_PROTO_V1  1
-#define ALPS_PROTO_V2  2
-#define ALPS_PROTO_V3  3
-#define ALPS_PROTO_V4  4
-#define ALPS_PROTO_V5  5
-#define ALPS_PROTO_V6  6
-#define ALPS_PROTO_V7  7       /* t3btl t4s */
+#define ALPS_PROTO_V1          0x100
+#define ALPS_PROTO_V2          0x200
+#define ALPS_PROTO_V3          0x300
+#define ALPS_PROTO_V4          0x400
+#define ALPS_PROTO_V5          0x500
+#define ALPS_PROTO_V6          0x600
+#define ALPS_PROTO_V7          0x700   /* t3btl t4s */
 
 #define MAX_TOUCHES    2
 
@@ -64,11 +64,11 @@ enum V7_PACKET_ID {
  * lists a number of such touchpads.
  */
 struct alps_model_info {
-       unsigned char signature[3];
-       unsigned char command_mode_resp;
-       unsigned char proto_version;
-       unsigned char byte0, mask0;
-       int flags;
+       u8 signature[3];
+       u8 command_mode_resp;
+       u16 proto_version;
+       u8 byte0, mask0;
+       unsigned int flags;
 };
 
 /**
@@ -166,9 +166,9 @@ struct alps_data {
        /* these are autodetected when the device is identified */
        const struct alps_nibble_commands *nibble_commands;
        int addr_command;
-       unsigned char proto_version;
-       unsigned char byte0, mask0;
-       unsigned char fw_ver[3];
+       u16 proto_version;
+       u8 byte0, mask0;
+       u8 fw_ver[3];
        int flags;
        int x_max;
        int y_max;