summaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse/alps.h
diff options
context:
space:
mode:
authorKevin Cernekee <cernekee@gmail.com>2013-02-13 22:22:08 -0800
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2013-02-14 09:18:01 -0800
commit24af5cb95f1b93c6c72a73113494ace4bcbee5a2 (patch)
tree4fbce336278f640e92f98b58ddb216bad0161cfe /drivers/input/mouse/alps.h
parentb5d6b851eab7f346ea5e69f46247b363b32b3670 (diff)
Input: ALPS - use function pointers for different protocol handlers
In anticipation of adding more ALPS protocols and more per-device quirks, use function pointers instead of switch statements to call functions that differ from one device to the next. 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.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/input/mouse/alps.h b/drivers/input/mouse/alps.h
index a81b3183045..0934f8bf7d7 100644
--- a/drivers/input/mouse/alps.h
+++ b/drivers/input/mouse/alps.h
@@ -72,6 +72,9 @@ struct alps_nibble_commands {
* mask0, should match byte0.
* @mask0: The mask used to check the first byte of the report.
* @flags: Additional device capabilities (passthrough port, trackstick, etc.).
+ * @hw_init: Protocol-specific hardware init function.
+ * @process_packet: Protocol-specific function to process a report packet.
+ * @set_abs_params: Protocol-specific function to configure the input_dev.
* @prev_fin: Finger bit from previous packet.
* @multi_packet: Multi-packet data in progress.
* @multi_data: Saved multi-packet data.
@@ -94,6 +97,10 @@ struct alps_data {
unsigned char byte0, mask0;
unsigned char flags;
+ int (*hw_init)(struct psmouse *psmouse);
+ void (*process_packet)(struct psmouse *psmouse);
+ void (*set_abs_params)(struct alps_data *priv, struct input_dev *dev1);
+
int prev_fin;
int multi_packet;
unsigned char multi_data[6];