aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPali Rohár <pali.rohar@gmail.com>2018-03-26 18:31:58 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2018-03-26 20:03:05 -0400
commit4621c9660459cd256e395e129bce6cd0f79a8ca3 (patch)
treef0c105b42fc4d726bfb97a70ef63acb5ba9d8865
parent68ef4836cd3ca283b89843d6ad603ce258ba087d (diff)
Input: alps - report pressure of v3 and v7 trackstick
ALPS v3 and v7 packet formats reports trackstick pressure. This information is already parsed in unused "z" variable. ALPS SS4 S2 devices already reports trackstick pressure as ABS_PRESSURE attribute, therefore reports pressure in the same way also for v3 and v7. This patch also updates parsing v3 pressure information, it is also stored in 7 bits. Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r--drivers/input/mouse/alps.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
index f9c7f2452264..f0b1060a7fee 100644
--- a/drivers/input/mouse/alps.c
+++ b/drivers/input/mouse/alps.c
@@ -139,11 +139,11 @@ static const struct alps_model_info alps_model_data[] = {
139}; 139};
140 140
141static const struct alps_protocol_info alps_v3_protocol_data = { 141static const struct alps_protocol_info alps_v3_protocol_data = {
142 ALPS_PROTO_V3, 0x8f, 0x8f, ALPS_DUALPOINT 142 ALPS_PROTO_V3, 0x8f, 0x8f, ALPS_DUALPOINT | ALPS_DUALPOINT_WITH_PRESSURE
143}; 143};
144 144
145static const struct alps_protocol_info alps_v3_rushmore_data = { 145static const struct alps_protocol_info alps_v3_rushmore_data = {
146 ALPS_PROTO_V3_RUSHMORE, 0x8f, 0x8f, ALPS_DUALPOINT 146 ALPS_PROTO_V3_RUSHMORE, 0x8f, 0x8f, ALPS_DUALPOINT | ALPS_DUALPOINT_WITH_PRESSURE
147}; 147};
148 148
149static const struct alps_protocol_info alps_v4_protocol_data = { 149static const struct alps_protocol_info alps_v4_protocol_data = {
@@ -155,7 +155,7 @@ static const struct alps_protocol_info alps_v5_protocol_data = {
155}; 155};
156 156
157static const struct alps_protocol_info alps_v7_protocol_data = { 157static const struct alps_protocol_info alps_v7_protocol_data = {
158 ALPS_PROTO_V7, 0x48, 0x48, ALPS_DUALPOINT 158 ALPS_PROTO_V7, 0x48, 0x48, ALPS_DUALPOINT | ALPS_DUALPOINT_WITH_PRESSURE
159}; 159};
160 160
161static const struct alps_protocol_info alps_v8_protocol_data = { 161static const struct alps_protocol_info alps_v8_protocol_data = {
@@ -583,7 +583,7 @@ static void alps_process_trackstick_packet_v3(struct psmouse *psmouse)
583 583
584 x = (s8)(((packet[0] & 0x20) << 2) | (packet[1] & 0x7f)); 584 x = (s8)(((packet[0] & 0x20) << 2) | (packet[1] & 0x7f));
585 y = (s8)(((packet[0] & 0x10) << 3) | (packet[2] & 0x7f)); 585 y = (s8)(((packet[0] & 0x10) << 3) | (packet[2] & 0x7f));
586 z = (packet[4] & 0x7c) >> 2; 586 z = packet[4] & 0x7c;
587 587
588 /* 588 /*
589 * The x and y values tend to be quite large, and when used 589 * The x and y values tend to be quite large, and when used
@@ -595,6 +595,7 @@ static void alps_process_trackstick_packet_v3(struct psmouse *psmouse)
595 595
596 input_report_rel(dev, REL_X, x); 596 input_report_rel(dev, REL_X, x);
597 input_report_rel(dev, REL_Y, -y); 597 input_report_rel(dev, REL_Y, -y);
598 input_report_abs(dev, ABS_PRESSURE, z);
598 599
599 /* 600 /*
600 * Most ALPS models report the trackstick buttons in the touchpad 601 * Most ALPS models report the trackstick buttons in the touchpad
@@ -1107,6 +1108,7 @@ static void alps_process_trackstick_packet_v7(struct psmouse *psmouse)
1107 1108
1108 input_report_rel(dev2, REL_X, (char)x); 1109 input_report_rel(dev2, REL_X, (char)x);
1109 input_report_rel(dev2, REL_Y, -((char)y)); 1110 input_report_rel(dev2, REL_Y, -((char)y));
1111 input_report_abs(dev2, ABS_PRESSURE, z);
1110 1112
1111 psmouse_report_standard_buttons(dev2, packet[1]); 1113 psmouse_report_standard_buttons(dev2, packet[1]);
1112 1114