aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse/alps.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/mouse/alps.h')
-rw-r--r--drivers/input/mouse/alps.h78
1 files changed, 77 insertions, 1 deletions
diff --git a/drivers/input/mouse/alps.h b/drivers/input/mouse/alps.h
index 02513c0502fc..6dfdccc3a7c6 100644
--- a/drivers/input/mouse/alps.h
+++ b/drivers/input/mouse/alps.h
@@ -22,14 +22,90 @@
22#define ALPS_PROTO_V5 0x500 22#define ALPS_PROTO_V5 0x500
23#define ALPS_PROTO_V6 0x600 23#define ALPS_PROTO_V6 0x600
24#define ALPS_PROTO_V7 0x700 /* t3btl t4s */ 24#define ALPS_PROTO_V7 0x700 /* t3btl t4s */
25#define ALPS_PROTO_V8 0x800 /* SS4btl SS4s */
25 26
26#define MAX_TOUCHES 2 27#define MAX_TOUCHES 4
27 28
28#define DOLPHIN_COUNT_PER_ELECTRODE 64 29#define DOLPHIN_COUNT_PER_ELECTRODE 64
29#define DOLPHIN_PROFILE_XOFFSET 8 /* x-electrode offset */ 30#define DOLPHIN_PROFILE_XOFFSET 8 /* x-electrode offset */
30#define DOLPHIN_PROFILE_YOFFSET 1 /* y-electrode offset */ 31#define DOLPHIN_PROFILE_YOFFSET 1 /* y-electrode offset */
31 32
32/* 33/*
34 * enum SS4_PACKET_ID - defines the packet type for V8
35 * SS4_PACKET_ID_IDLE: There's no finger and no button activity.
36 * SS4_PACKET_ID_ONE: There's one finger on touchpad
37 * or there's button activities.
38 * SS4_PACKET_ID_TWO: There's two or more fingers on touchpad
39 * SS4_PACKET_ID_MULTI: There's three or more fingers on touchpad
40*/
41enum SS4_PACKET_ID {
42 SS4_PACKET_ID_IDLE = 0,
43 SS4_PACKET_ID_ONE,
44 SS4_PACKET_ID_TWO,
45 SS4_PACKET_ID_MULTI,
46};
47
48#define SS4_COUNT_PER_ELECTRODE 256
49#define SS4_NUMSENSOR_XOFFSET 7
50#define SS4_NUMSENSOR_YOFFSET 7
51#define SS4_MIN_PITCH_MM 50
52
53#define SS4_MASK_NORMAL_BUTTONS 0x07
54
55#define SS4_1F_X_V2(_b) ((_b[0] & 0x0007) | \
56 ((_b[1] << 3) & 0x0078) | \
57 ((_b[1] << 2) & 0x0380) | \
58 ((_b[2] << 5) & 0x1C00) \
59 )
60
61#define SS4_1F_Y_V2(_b) (((_b[2]) & 0x000F) | \
62 ((_b[3] >> 2) & 0x0030) | \
63 ((_b[4] << 6) & 0x03C0) | \
64 ((_b[4] << 5) & 0x0C00) \
65 )
66
67#define SS4_1F_Z_V2(_b) (((_b[5]) & 0x0F) | \
68 ((_b[5] >> 1) & 0x70) | \
69 ((_b[4]) & 0x80) \
70 )
71
72#define SS4_1F_LFB_V2(_b) (((_b[2] >> 4) & 0x01) == 0x01)
73
74#define SS4_MF_LF_V2(_b, _i) ((_b[1 + (_i) * 3] & 0x0004) == 0x0004)
75
76#define SS4_BTN_V2(_b) ((_b[0] >> 5) & SS4_MASK_NORMAL_BUTTONS)
77
78#define SS4_STD_MF_X_V2(_b, _i) (((_b[0 + (_i) * 3] << 5) & 0x00E0) | \
79 ((_b[1 + _i * 3] << 5) & 0x1F00) \
80 )
81
82#define SS4_STD_MF_Y_V2(_b, _i) (((_b[1 + (_i) * 3] << 3) & 0x0010) | \
83 ((_b[2 + (_i) * 3] << 5) & 0x01E0) | \
84 ((_b[2 + (_i) * 3] << 4) & 0x0E00) \
85 )
86
87#define SS4_BTL_MF_X_V2(_b, _i) (SS4_STD_MF_X_V2(_b, _i) | \
88 ((_b[0 + (_i) * 3] >> 3) & 0x0010) \
89 )
90
91#define SS4_BTL_MF_Y_V2(_b, _i) (SS4_STD_MF_Y_V2(_b, _i) | \
92 ((_b[0 + (_i) * 3] >> 3) & 0x0008) \
93 )
94
95#define SS4_MF_Z_V2(_b, _i) (((_b[1 + (_i) * 3]) & 0x0001) | \
96 ((_b[1 + (_i) * 3] >> 1) & 0x0002) \
97 )
98
99#define SS4_IS_MF_CONTINUE(_b) ((_b[2] & 0x10) == 0x10)
100#define SS4_IS_5F_DETECTED(_b) ((_b[2] & 0x10) == 0x10)
101
102
103#define SS4_MFPACKET_NO_AX 8160 /* X-Coordinate value */
104#define SS4_MFPACKET_NO_AY 4080 /* Y-Coordinate value */
105#define SS4_MFPACKET_NO_AX_BL 8176 /* Buttonless X-Coordinate value */
106#define SS4_MFPACKET_NO_AY_BL 4088 /* Buttonless Y-Coordinate value */
107
108/*
33 * enum V7_PACKET_ID - defines the packet type for V7 109 * enum V7_PACKET_ID - defines the packet type for V7
34 * V7_PACKET_ID_IDLE: There's no finger and no button activity. 110 * V7_PACKET_ID_IDLE: There's no finger and no button activity.
35 * V7_PACKET_ID_TWO: There's one or two non-resting fingers on touchpad 111 * V7_PACKET_ID_TWO: There's one or two non-resting fingers on touchpad