diff options
author | Kevin Cernekee <cernekee@gmail.com> | 2013-02-13 23:55:19 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2013-02-14 12:17:38 -0500 |
commit | 88a803482c4165642409bab77424a27939d51500 (patch) | |
tree | 2c58a6dd4d2d9ec51d69de83d2c165472e020487 /drivers/input | |
parent | a112e9fdda1e4a412628650f0988c46daaee9028 (diff) |
Input: ALPS - document the alps.h data structures
Add kernel-doc markup.
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')
-rw-r--r-- | drivers/input/mouse/alps.h | 74 |
1 files changed, 61 insertions, 13 deletions
diff --git a/drivers/input/mouse/alps.h b/drivers/input/mouse/alps.h index ae1ac354c778..67be4e5fa1cd 100644 --- a/drivers/input/mouse/alps.h +++ b/drivers/input/mouse/alps.h | |||
@@ -17,30 +17,78 @@ | |||
17 | #define ALPS_PROTO_V3 2 | 17 | #define ALPS_PROTO_V3 2 |
18 | #define ALPS_PROTO_V4 3 | 18 | #define ALPS_PROTO_V4 3 |
19 | 19 | ||
20 | /** | ||
21 | * struct alps_model_info - touchpad ID table | ||
22 | * @signature: E7 response string to match. | ||
23 | * @command_mode_resp: For V3/V4 touchpads, the final byte of the EC response | ||
24 | * (aka command mode response) identifies the firmware minor version. This | ||
25 | * can be used to distinguish different hardware models which are not | ||
26 | * uniquely identifiable through their E7 responses. | ||
27 | * @proto_version: Indicates V1/V2/V3/... | ||
28 | * @byte0: Helps figure out whether a position report packet matches the | ||
29 | * known format for this model. The first byte of the report, ANDed with | ||
30 | * mask0, should match byte0. | ||
31 | * @mask0: The mask used to check the first byte of the report. | ||
32 | * @flags: Additional device capabilities (passthrough port, trackstick, etc.). | ||
33 | * | ||
34 | * Many (but not all) ALPS touchpads can be identified by looking at the | ||
35 | * values returned in the "E7 report" and/or the "EC report." This table | ||
36 | * lists a number of such touchpads. | ||
37 | */ | ||
20 | struct alps_model_info { | 38 | struct alps_model_info { |
21 | unsigned char signature[3]; | 39 | unsigned char signature[3]; |
22 | unsigned char command_mode_resp; /* v3/v4 only */ | 40 | unsigned char command_mode_resp; |
23 | unsigned char proto_version; | 41 | unsigned char proto_version; |
24 | unsigned char byte0, mask0; | 42 | unsigned char byte0, mask0; |
25 | unsigned char flags; | 43 | unsigned char flags; |
26 | }; | 44 | }; |
27 | 45 | ||
46 | /** | ||
47 | * struct alps_nibble_commands - encodings for register accesses | ||
48 | * @command: PS/2 command used for the nibble | ||
49 | * @data: Data supplied as an argument to the PS/2 command, if applicable | ||
50 | * | ||
51 | * The ALPS protocol uses magic sequences to transmit binary data to the | ||
52 | * touchpad, as it is generally not OK to send arbitrary bytes out the | ||
53 | * PS/2 port. Each of the sequences in this table sends one nibble of the | ||
54 | * register address or (write) data. Different versions of the ALPS protocol | ||
55 | * use slightly different encodings. | ||
56 | */ | ||
28 | struct alps_nibble_commands { | 57 | struct alps_nibble_commands { |
29 | int command; | 58 | int command; |
30 | unsigned char data; | 59 | unsigned char data; |
31 | }; | 60 | }; |
32 | 61 | ||
62 | /** | ||
63 | * struct alps_data - private data structure for the ALPS driver | ||
64 | * @dev2: "Relative" device used to report trackstick or mouse activity. | ||
65 | * @phys: Physical path for the relative device. | ||
66 | * @i: Information on the detected touchpad model. | ||
67 | * @nibble_commands: Command mapping used for touchpad register accesses. | ||
68 | * @addr_command: Command used to tell the touchpad that a register address | ||
69 | * follows. | ||
70 | * @prev_fin: Finger bit from previous packet. | ||
71 | * @multi_packet: Multi-packet data in progress. | ||
72 | * @multi_data: Saved multi-packet data. | ||
73 | * @x1: First X coordinate from last MT report. | ||
74 | * @x2: Second X coordinate from last MT report. | ||
75 | * @y1: First Y coordinate from last MT report. | ||
76 | * @y2: Second Y coordinate from last MT report. | ||
77 | * @fingers: Number of fingers from last MT report. | ||
78 | * @quirks: Bitmap of ALPS_QUIRK_*. | ||
79 | * @timer: Timer for flushing out the final report packet in the stream. | ||
80 | */ | ||
33 | struct alps_data { | 81 | struct alps_data { |
34 | struct input_dev *dev2; /* Relative device */ | 82 | struct input_dev *dev2; |
35 | char phys[32]; /* Phys */ | 83 | char phys[32]; |
36 | const struct alps_model_info *i;/* Info */ | 84 | const struct alps_model_info *i; |
37 | const struct alps_nibble_commands *nibble_commands; | 85 | const struct alps_nibble_commands *nibble_commands; |
38 | int addr_command; /* Command to set register address */ | 86 | int addr_command; |
39 | int prev_fin; /* Finger bit from previous packet */ | 87 | int prev_fin; |
40 | int multi_packet; /* Multi-packet data in progress */ | 88 | int multi_packet; |
41 | unsigned char multi_data[6]; /* Saved multi-packet data */ | 89 | unsigned char multi_data[6]; |
42 | int x1, x2, y1, y2; /* Coordinates from last MT report */ | 90 | int x1, x2, y1, y2; |
43 | int fingers; /* Number of fingers from MT report */ | 91 | int fingers; |
44 | u8 quirks; | 92 | u8 quirks; |
45 | struct timer_list timer; | 93 | struct timer_list timer; |
46 | }; | 94 | }; |