aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse/alps.h
diff options
context:
space:
mode:
authorKevin Cernekee <cernekee@gmail.com>2013-02-14 01:26:11 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2013-02-14 12:18:25 -0500
commitf85e5001cce0298a44e35e2f8acbf9abeadb6c03 (patch)
tree0dc2551cc497f6049e4e397e35fb1d6778c7d721 /drivers/input/mouse/alps.h
parent7a9f73e75cd0dcd320166aa340141893bd1848d1 (diff)
Input: ALPS - make the V3 packet field decoder "pluggable"
A number of different ALPS touchpad protocols can reuse alps_process_touchpad_packet_v3() with small tweaks to the bitfield decoding. Create a new priv->decode_fields() callback that handles the per-model differences. Signed-off-by: Kevin Cernekee <cernekee@gmail.com> Tested-by: Dave Turvene <dturvene@dahetral.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/mouse/alps.h')
-rw-r--r--drivers/input/mouse/alps.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/drivers/input/mouse/alps.h b/drivers/input/mouse/alps.h
index 5e638be33dc9..970480551b6e 100644
--- a/drivers/input/mouse/alps.h
+++ b/drivers/input/mouse/alps.h
@@ -60,6 +60,42 @@ struct alps_nibble_commands {
60}; 60};
61 61
62/** 62/**
63 * struct alps_fields - decoded version of the report packet
64 * @x_map: Bitmap of active X positions for MT.
65 * @y_map: Bitmap of active Y positions for MT.
66 * @fingers: Number of fingers for MT.
67 * @x: X position for ST.
68 * @y: Y position for ST.
69 * @z: Z position for ST.
70 * @first_mp: Packet is the first of a multi-packet report.
71 * @is_mp: Packet is part of a multi-packet report.
72 * @left: Left touchpad button is active.
73 * @right: Right touchpad button is active.
74 * @middle: Middle touchpad button is active.
75 * @ts_left: Left trackstick button is active.
76 * @ts_right: Right trackstick button is active.
77 * @ts_middle: Middle trackstick button is active.
78 */
79struct alps_fields {
80 unsigned int x_map;
81 unsigned int y_map;
82 unsigned int fingers;
83 unsigned int x;
84 unsigned int y;
85 unsigned int z;
86 unsigned int first_mp:1;
87 unsigned int is_mp:1;
88
89 unsigned int left:1;
90 unsigned int right:1;
91 unsigned int middle:1;
92
93 unsigned int ts_left:1;
94 unsigned int ts_right:1;
95 unsigned int ts_middle:1;
96};
97
98/**
63 * struct alps_data - private data structure for the ALPS driver 99 * struct alps_data - private data structure for the ALPS driver
64 * @dev2: "Relative" device used to report trackstick or mouse activity. 100 * @dev2: "Relative" device used to report trackstick or mouse activity.
65 * @phys: Physical path for the relative device. 101 * @phys: Physical path for the relative device.
@@ -78,6 +114,7 @@ struct alps_nibble_commands {
78 * @y_bits: Number of Y bits in the MT bitmap. 114 * @y_bits: Number of Y bits in the MT bitmap.
79 * @hw_init: Protocol-specific hardware init function. 115 * @hw_init: Protocol-specific hardware init function.
80 * @process_packet: Protocol-specific function to process a report packet. 116 * @process_packet: Protocol-specific function to process a report packet.
117 * @decode_fields: Protocol-specific function to read packet bitfields.
81 * @set_abs_params: Protocol-specific function to configure the input_dev. 118 * @set_abs_params: Protocol-specific function to configure the input_dev.
82 * @prev_fin: Finger bit from previous packet. 119 * @prev_fin: Finger bit from previous packet.
83 * @multi_packet: Multi-packet data in progress. 120 * @multi_packet: Multi-packet data in progress.
@@ -107,6 +144,7 @@ struct alps_data {
107 144
108 int (*hw_init)(struct psmouse *psmouse); 145 int (*hw_init)(struct psmouse *psmouse);
109 void (*process_packet)(struct psmouse *psmouse); 146 void (*process_packet)(struct psmouse *psmouse);
147 void (*decode_fields)(struct alps_fields *f, unsigned char *p);
110 void (*set_abs_params)(struct alps_data *priv, struct input_dev *dev1); 148 void (*set_abs_params)(struct alps_data *priv, struct input_dev *dev1);
111 149
112 int prev_fin; 150 int prev_fin;