Thomas Gleixner | d2912cb | 2019-06-04 10:11:33 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | /* |
| 3 | * ALPS touchpad PS/2 mouse driver |
| 4 | * |
| 5 | * Copyright (c) 2003 Peter Osterlund <petero2@telia.com> |
| 6 | * Copyright (c) 2005 Vojtech Pavlik <vojtech@suse.cz> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #ifndef _ALPS_H |
| 10 | #define _ALPS_H |
| 11 | |
Hans de Goede | 02d0425 | 2014-07-25 22:43:35 -0700 | [diff] [blame] | 12 | #include <linux/input/mt.h> |
| 13 | |
Dmitry Torokhov | d7c13d3 | 2015-01-13 20:53:22 -0800 | [diff] [blame] | 14 | #define ALPS_PROTO_V1 0x100 |
| 15 | #define ALPS_PROTO_V2 0x200 |
| 16 | #define ALPS_PROTO_V3 0x300 |
Dmitry Torokhov | fb2dd7a | 2015-01-14 10:39:52 -0800 | [diff] [blame] | 17 | #define ALPS_PROTO_V3_RUSHMORE 0x310 |
Dmitry Torokhov | d7c13d3 | 2015-01-13 20:53:22 -0800 | [diff] [blame] | 18 | #define ALPS_PROTO_V4 0x400 |
| 19 | #define ALPS_PROTO_V5 0x500 |
| 20 | #define ALPS_PROTO_V6 0x600 |
| 21 | #define ALPS_PROTO_V7 0x700 /* t3btl t4s */ |
Masaki Ota | 3db5b9f | 2015-03-27 20:57:52 -0700 | [diff] [blame] | 22 | #define ALPS_PROTO_V8 0x800 /* SS4btl SS4s */ |
Pali Rohár | c981523 | 2017-03-07 09:42:46 -0800 | [diff] [blame] | 23 | #define ALPS_PROTO_V9 0x900 /* ss3btl */ |
Seth Forshee | fa629ef | 2011-11-07 19:53:24 -0800 | [diff] [blame] | 24 | |
Masaki Ota | 3db5b9f | 2015-03-27 20:57:52 -0700 | [diff] [blame] | 25 | #define MAX_TOUCHES 4 |
Hans de Goede | 02d0425 | 2014-07-25 22:43:35 -0700 | [diff] [blame] | 26 | |
Yunkang Tang | ee65d4b | 2013-12-26 14:54:19 -0800 | [diff] [blame] | 27 | #define DOLPHIN_COUNT_PER_ELECTRODE 64 |
| 28 | #define DOLPHIN_PROFILE_XOFFSET 8 /* x-electrode offset */ |
| 29 | #define DOLPHIN_PROFILE_YOFFSET 1 /* y-electrode offset */ |
| 30 | |
Yunkang Tang | 3808843 | 2014-07-26 13:51:41 -0700 | [diff] [blame] | 31 | /* |
Masaki Ota | 3db5b9f | 2015-03-27 20:57:52 -0700 | [diff] [blame] | 32 | * enum SS4_PACKET_ID - defines the packet type for V8 |
| 33 | * SS4_PACKET_ID_IDLE: There's no finger and no button activity. |
| 34 | * SS4_PACKET_ID_ONE: There's one finger on touchpad |
| 35 | * or there's button activities. |
| 36 | * SS4_PACKET_ID_TWO: There's two or more fingers on touchpad |
| 37 | * SS4_PACKET_ID_MULTI: There's three or more fingers on touchpad |
Ben Gamari | 4777ac2 | 2016-10-04 11:33:25 -0700 | [diff] [blame] | 38 | * SS4_PACKET_ID_STICK: A stick pointer packet |
Masaki Ota | 3db5b9f | 2015-03-27 20:57:52 -0700 | [diff] [blame] | 39 | */ |
| 40 | enum SS4_PACKET_ID { |
| 41 | SS4_PACKET_ID_IDLE = 0, |
| 42 | SS4_PACKET_ID_ONE, |
| 43 | SS4_PACKET_ID_TWO, |
| 44 | SS4_PACKET_ID_MULTI, |
Ben Gamari | 4777ac2 | 2016-10-04 11:33:25 -0700 | [diff] [blame] | 45 | SS4_PACKET_ID_STICK, |
Masaki Ota | 3db5b9f | 2015-03-27 20:57:52 -0700 | [diff] [blame] | 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 | |
Masaki Ota | e734839 | 2017-03-17 14:10:57 -0700 | [diff] [blame] | 55 | #define SS4PLUS_COUNT_PER_ELECTRODE 128 |
| 56 | #define SS4PLUS_NUMSENSOR_XOFFSET 16 |
| 57 | #define SS4PLUS_NUMSENSOR_YOFFSET 5 |
| 58 | #define SS4PLUS_MIN_PITCH_MM 37 |
| 59 | |
| 60 | #define IS_SS4PLUS_DEV(_b) (((_b[0]) == 0x73) && \ |
| 61 | ((_b[1]) == 0x03) && \ |
| 62 | ((_b[2]) == 0x28) \ |
| 63 | ) |
| 64 | |
Paul Donohue | 23fce36 | 2016-11-28 20:16:21 -0800 | [diff] [blame] | 65 | #define SS4_IS_IDLE_V2(_b) (((_b[0]) == 0x18) && \ |
| 66 | ((_b[1]) == 0x10) && \ |
| 67 | ((_b[2]) == 0x00) && \ |
| 68 | ((_b[3] & 0x88) == 0x08) && \ |
| 69 | ((_b[4]) == 0x10) && \ |
| 70 | ((_b[5]) == 0x00) \ |
| 71 | ) |
| 72 | |
| 73 | #define SS4_1F_X_V2(_b) (((_b[0]) & 0x0007) | \ |
Masaki Ota | 3db5b9f | 2015-03-27 20:57:52 -0700 | [diff] [blame] | 74 | ((_b[1] << 3) & 0x0078) | \ |
| 75 | ((_b[1] << 2) & 0x0380) | \ |
| 76 | ((_b[2] << 5) & 0x1C00) \ |
| 77 | ) |
| 78 | |
| 79 | #define SS4_1F_Y_V2(_b) (((_b[2]) & 0x000F) | \ |
| 80 | ((_b[3] >> 2) & 0x0030) | \ |
| 81 | ((_b[4] << 6) & 0x03C0) | \ |
| 82 | ((_b[4] << 5) & 0x0C00) \ |
| 83 | ) |
| 84 | |
| 85 | #define SS4_1F_Z_V2(_b) (((_b[5]) & 0x0F) | \ |
| 86 | ((_b[5] >> 1) & 0x70) | \ |
| 87 | ((_b[4]) & 0x80) \ |
| 88 | ) |
| 89 | |
| 90 | #define SS4_1F_LFB_V2(_b) (((_b[2] >> 4) & 0x01) == 0x01) |
| 91 | |
| 92 | #define SS4_MF_LF_V2(_b, _i) ((_b[1 + (_i) * 3] & 0x0004) == 0x0004) |
| 93 | |
| 94 | #define SS4_BTN_V2(_b) ((_b[0] >> 5) & SS4_MASK_NORMAL_BUTTONS) |
| 95 | |
| 96 | #define SS4_STD_MF_X_V2(_b, _i) (((_b[0 + (_i) * 3] << 5) & 0x00E0) | \ |
| 97 | ((_b[1 + _i * 3] << 5) & 0x1F00) \ |
| 98 | ) |
| 99 | |
Masaki Ota | 4a64658 | 2017-08-24 15:44:36 -0700 | [diff] [blame] | 100 | #define SS4_PLUS_STD_MF_X_V2(_b, _i) (((_b[0 + (_i) * 3] << 4) & 0x0070) | \ |
| 101 | ((_b[1 + (_i) * 3] << 4) & 0x0F80) \ |
| 102 | ) |
| 103 | |
Masaki Ota | 3db5b9f | 2015-03-27 20:57:52 -0700 | [diff] [blame] | 104 | #define SS4_STD_MF_Y_V2(_b, _i) (((_b[1 + (_i) * 3] << 3) & 0x0010) | \ |
| 105 | ((_b[2 + (_i) * 3] << 5) & 0x01E0) | \ |
| 106 | ((_b[2 + (_i) * 3] << 4) & 0x0E00) \ |
| 107 | ) |
| 108 | |
| 109 | #define SS4_BTL_MF_X_V2(_b, _i) (SS4_STD_MF_X_V2(_b, _i) | \ |
| 110 | ((_b[0 + (_i) * 3] >> 3) & 0x0010) \ |
| 111 | ) |
| 112 | |
Masaki Ota | 4a64658 | 2017-08-24 15:44:36 -0700 | [diff] [blame] | 113 | #define SS4_PLUS_BTL_MF_X_V2(_b, _i) (SS4_PLUS_STD_MF_X_V2(_b, _i) | \ |
| 114 | ((_b[0 + (_i) * 3] >> 4) & 0x0008) \ |
| 115 | ) |
| 116 | |
Masaki Ota | 3db5b9f | 2015-03-27 20:57:52 -0700 | [diff] [blame] | 117 | #define SS4_BTL_MF_Y_V2(_b, _i) (SS4_STD_MF_Y_V2(_b, _i) | \ |
| 118 | ((_b[0 + (_i) * 3] >> 3) & 0x0008) \ |
| 119 | ) |
| 120 | |
| 121 | #define SS4_MF_Z_V2(_b, _i) (((_b[1 + (_i) * 3]) & 0x0001) | \ |
| 122 | ((_b[1 + (_i) * 3] >> 1) & 0x0002) \ |
| 123 | ) |
| 124 | |
| 125 | #define SS4_IS_MF_CONTINUE(_b) ((_b[2] & 0x10) == 0x10) |
| 126 | #define SS4_IS_5F_DETECTED(_b) ((_b[2] & 0x10) == 0x10) |
| 127 | |
Paul Donohue | 23fce36 | 2016-11-28 20:16:21 -0800 | [diff] [blame] | 128 | #define SS4_TS_X_V2(_b) (s8)( \ |
| 129 | ((_b[0] & 0x01) << 7) | \ |
| 130 | (_b[1] & 0x7F) \ |
| 131 | ) |
| 132 | |
Paul Donohue | 47e3a5e | 2017-01-03 10:39:28 -0800 | [diff] [blame] | 133 | #define SS4_TS_Y_V2(_b) -(s8)( \ |
Paul Donohue | 23fce36 | 2016-11-28 20:16:21 -0800 | [diff] [blame] | 134 | ((_b[3] & 0x01) << 7) | \ |
| 135 | (_b[2] & 0x7F) \ |
| 136 | ) |
| 137 | |
| 138 | #define SS4_TS_Z_V2(_b) (s8)(_b[4] & 0x7F) |
| 139 | |
Masaki Ota | 3db5b9f | 2015-03-27 20:57:52 -0700 | [diff] [blame] | 140 | |
Nir Perry | 4d94e77 | 2018-01-11 23:43:26 -0800 | [diff] [blame] | 141 | #define SS4_MFPACKET_NO_AX 8160 /* X-Coordinate value */ |
| 142 | #define SS4_MFPACKET_NO_AY 4080 /* Y-Coordinate value */ |
| 143 | #define SS4_MFPACKET_NO_AX_BL 8176 /* Buttonless X-Coord value */ |
| 144 | #define SS4_MFPACKET_NO_AY_BL 4088 /* Buttonless Y-Coord value */ |
| 145 | #define SS4_PLUS_MFPACKET_NO_AX 4080 /* SS4 PLUS, X */ |
| 146 | #define SS4_PLUS_MFPACKET_NO_AX_BL 4088 /* Buttonless SS4 PLUS, X */ |
Masaki Ota | 3db5b9f | 2015-03-27 20:57:52 -0700 | [diff] [blame] | 147 | |
| 148 | /* |
Yunkang Tang | 3808843 | 2014-07-26 13:51:41 -0700 | [diff] [blame] | 149 | * enum V7_PACKET_ID - defines the packet type for V7 |
| 150 | * V7_PACKET_ID_IDLE: There's no finger and no button activity. |
| 151 | * V7_PACKET_ID_TWO: There's one or two non-resting fingers on touchpad |
| 152 | * or there's button activities. |
| 153 | * V7_PACKET_ID_MULTI: There are at least three non-resting fingers. |
| 154 | * V7_PACKET_ID_NEW: The finger position in slot is not continues from |
| 155 | * previous packet. |
| 156 | */ |
| 157 | enum V7_PACKET_ID { |
| 158 | V7_PACKET_ID_IDLE, |
| 159 | V7_PACKET_ID_TWO, |
| 160 | V7_PACKET_ID_MULTI, |
| 161 | V7_PACKET_ID_NEW, |
| 162 | V7_PACKET_ID_UNKNOWN, |
| 163 | }; |
| 164 | |
Kevin Cernekee | 88a8034 | 2013-02-13 20:55:19 -0800 | [diff] [blame] | 165 | /** |
Dmitry Torokhov | 8326bb5 | 2015-01-13 21:08:00 -0800 | [diff] [blame] | 166 | * struct alps_protocol_info - information about protocol used by a device |
| 167 | * @version: Indicates V1/V2/V3/... |
| 168 | * @byte0: Helps figure out whether a position report packet matches the |
| 169 | * known format for this model. The first byte of the report, ANDed with |
| 170 | * mask0, should match byte0. |
| 171 | * @mask0: The mask used to check the first byte of the report. |
| 172 | * @flags: Additional device capabilities (passthrough port, trackstick, etc.). |
| 173 | */ |
| 174 | struct alps_protocol_info { |
| 175 | u16 version; |
| 176 | u8 byte0, mask0; |
| 177 | unsigned int flags; |
| 178 | }; |
| 179 | |
| 180 | /** |
Kevin Cernekee | 88a8034 | 2013-02-13 20:55:19 -0800 | [diff] [blame] | 181 | * struct alps_model_info - touchpad ID table |
| 182 | * @signature: E7 response string to match. |
Marcos Paulo de Souza | 7343d11 | 2016-12-12 10:59:56 -0800 | [diff] [blame] | 183 | * @protocol_info: information about protocol used by the device. |
Kevin Cernekee | 88a8034 | 2013-02-13 20:55:19 -0800 | [diff] [blame] | 184 | * |
| 185 | * Many (but not all) ALPS touchpads can be identified by looking at the |
| 186 | * values returned in the "E7 report" and/or the "EC report." This table |
| 187 | * lists a number of such touchpads. |
| 188 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 189 | struct alps_model_info { |
Dmitry Torokhov | d7c13d3 | 2015-01-13 20:53:22 -0800 | [diff] [blame] | 190 | u8 signature[3]; |
Dmitry Torokhov | 8326bb5 | 2015-01-13 21:08:00 -0800 | [diff] [blame] | 191 | struct alps_protocol_info protocol_info; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 192 | }; |
| 193 | |
Kevin Cernekee | 88a8034 | 2013-02-13 20:55:19 -0800 | [diff] [blame] | 194 | /** |
| 195 | * struct alps_nibble_commands - encodings for register accesses |
| 196 | * @command: PS/2 command used for the nibble |
| 197 | * @data: Data supplied as an argument to the PS/2 command, if applicable |
| 198 | * |
| 199 | * The ALPS protocol uses magic sequences to transmit binary data to the |
| 200 | * touchpad, as it is generally not OK to send arbitrary bytes out the |
| 201 | * PS/2 port. Each of the sequences in this table sends one nibble of the |
| 202 | * register address or (write) data. Different versions of the ALPS protocol |
| 203 | * use slightly different encodings. |
| 204 | */ |
Seth Forshee | 25bded7 | 2011-11-07 19:53:36 -0800 | [diff] [blame] | 205 | struct alps_nibble_commands { |
| 206 | int command; |
| 207 | unsigned char data; |
| 208 | }; |
| 209 | |
Hans de Goede | 036e6c7 | 2014-07-25 22:38:51 -0700 | [diff] [blame] | 210 | struct alps_bitmap_point { |
| 211 | int start_bit; |
| 212 | int num_bits; |
| 213 | }; |
| 214 | |
Kevin Cernekee | 88a8034 | 2013-02-13 20:55:19 -0800 | [diff] [blame] | 215 | /** |
Kevin Cernekee | f85e500 | 2013-02-13 22:26:11 -0800 | [diff] [blame] | 216 | * struct alps_fields - decoded version of the report packet |
| 217 | * @x_map: Bitmap of active X positions for MT. |
| 218 | * @y_map: Bitmap of active Y positions for MT. |
| 219 | * @fingers: Number of fingers for MT. |
Hans de Goede | 02d0425 | 2014-07-25 22:43:35 -0700 | [diff] [blame] | 220 | * @pressure: Pressure. |
| 221 | * @st: position for ST. |
| 222 | * @mt: position for MT. |
Kevin Cernekee | f85e500 | 2013-02-13 22:26:11 -0800 | [diff] [blame] | 223 | * @first_mp: Packet is the first of a multi-packet report. |
| 224 | * @is_mp: Packet is part of a multi-packet report. |
| 225 | * @left: Left touchpad button is active. |
| 226 | * @right: Right touchpad button is active. |
| 227 | * @middle: Middle touchpad button is active. |
| 228 | * @ts_left: Left trackstick button is active. |
| 229 | * @ts_right: Right trackstick button is active. |
| 230 | * @ts_middle: Middle trackstick button is active. |
| 231 | */ |
| 232 | struct alps_fields { |
| 233 | unsigned int x_map; |
| 234 | unsigned int y_map; |
| 235 | unsigned int fingers; |
Hans de Goede | 02d0425 | 2014-07-25 22:43:35 -0700 | [diff] [blame] | 236 | |
| 237 | int pressure; |
| 238 | struct input_mt_pos st; |
| 239 | struct input_mt_pos mt[MAX_TOUCHES]; |
| 240 | |
Kevin Cernekee | f85e500 | 2013-02-13 22:26:11 -0800 | [diff] [blame] | 241 | unsigned int first_mp:1; |
| 242 | unsigned int is_mp:1; |
| 243 | |
| 244 | unsigned int left:1; |
| 245 | unsigned int right:1; |
| 246 | unsigned int middle:1; |
| 247 | |
| 248 | unsigned int ts_left:1; |
| 249 | unsigned int ts_right:1; |
| 250 | unsigned int ts_middle:1; |
| 251 | }; |
| 252 | |
| 253 | /** |
Kevin Cernekee | 88a8034 | 2013-02-13 20:55:19 -0800 | [diff] [blame] | 254 | * struct alps_data - private data structure for the ALPS driver |
Pali Rohár | 04aae28 | 2015-01-14 13:18:30 -0800 | [diff] [blame] | 255 | * @psmouse: Pointer to parent psmouse device |
| 256 | * @dev2: Trackstick device (can be NULL). |
| 257 | * @dev3: Generic PS/2 mouse (can be NULL, delayed registering). |
| 258 | * @phys2: Physical path for the trackstick device. |
| 259 | * @phys3: Physical path for the generic PS/2 mouse. |
| 260 | * @dev3_register_work: Delayed work for registering PS/2 mouse. |
Kevin Cernekee | 88a8034 | 2013-02-13 20:55:19 -0800 | [diff] [blame] | 261 | * @nibble_commands: Command mapping used for touchpad register accesses. |
| 262 | * @addr_command: Command used to tell the touchpad that a register address |
| 263 | * follows. |
Kevin Cernekee | 99df65e | 2013-02-13 20:56:33 -0800 | [diff] [blame] | 264 | * @proto_version: Indicates V1/V2/V3/... |
| 265 | * @byte0: Helps figure out whether a position report packet matches the |
| 266 | * known format for this model. The first byte of the report, ANDed with |
| 267 | * mask0, should match byte0. |
| 268 | * @mask0: The mask used to check the first byte of the report. |
Hans de Goede | c0cd17f | 2014-07-25 22:49:14 -0700 | [diff] [blame] | 269 | * @fw_ver: cached copy of firmware version (EC report) |
Kevin Cernekee | 99df65e | 2013-02-13 20:56:33 -0800 | [diff] [blame] | 270 | * @flags: Additional device capabilities (passthrough port, trackstick, etc.). |
Kevin Cernekee | 7a9f73e | 2013-02-13 22:24:55 -0800 | [diff] [blame] | 271 | * @x_max: Largest possible X position value. |
| 272 | * @y_max: Largest possible Y position value. |
| 273 | * @x_bits: Number of X bits in the MT bitmap. |
| 274 | * @y_bits: Number of Y bits in the MT bitmap. |
Kevin Cernekee | 24af5cb | 2013-02-13 22:22:08 -0800 | [diff] [blame] | 275 | * @hw_init: Protocol-specific hardware init function. |
| 276 | * @process_packet: Protocol-specific function to process a report packet. |
Kevin Cernekee | f85e500 | 2013-02-13 22:26:11 -0800 | [diff] [blame] | 277 | * @decode_fields: Protocol-specific function to read packet bitfields. |
Kevin Cernekee | 24af5cb | 2013-02-13 22:22:08 -0800 | [diff] [blame] | 278 | * @set_abs_params: Protocol-specific function to configure the input_dev. |
Kevin Cernekee | 88a8034 | 2013-02-13 20:55:19 -0800 | [diff] [blame] | 279 | * @prev_fin: Finger bit from previous packet. |
| 280 | * @multi_packet: Multi-packet data in progress. |
| 281 | * @multi_data: Saved multi-packet data. |
Hans de Goede | 02d0425 | 2014-07-25 22:43:35 -0700 | [diff] [blame] | 282 | * @f: Decoded packet data fields. |
Kevin Cernekee | 88a8034 | 2013-02-13 20:55:19 -0800 | [diff] [blame] | 283 | * @quirks: Bitmap of ALPS_QUIRK_*. |
| 284 | * @timer: Timer for flushing out the final report packet in the stream. |
| 285 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 286 | struct alps_data { |
Pali Rohár | 04aae28 | 2015-01-14 13:18:30 -0800 | [diff] [blame] | 287 | struct psmouse *psmouse; |
Kevin Cernekee | 88a8034 | 2013-02-13 20:55:19 -0800 | [diff] [blame] | 288 | struct input_dev *dev2; |
Pali Rohár | 04aae28 | 2015-01-14 13:18:30 -0800 | [diff] [blame] | 289 | struct input_dev *dev3; |
| 290 | char phys2[32]; |
| 291 | char phys3[32]; |
| 292 | struct delayed_work dev3_register_work; |
Kevin Cernekee | 99df65e | 2013-02-13 20:56:33 -0800 | [diff] [blame] | 293 | |
| 294 | /* these are autodetected when the device is identified */ |
Seth Forshee | 25bded7 | 2011-11-07 19:53:36 -0800 | [diff] [blame] | 295 | const struct alps_nibble_commands *nibble_commands; |
Kevin Cernekee | 88a8034 | 2013-02-13 20:55:19 -0800 | [diff] [blame] | 296 | int addr_command; |
Dmitry Torokhov | d7c13d3 | 2015-01-13 20:53:22 -0800 | [diff] [blame] | 297 | u16 proto_version; |
| 298 | u8 byte0, mask0; |
Masaki Ota | e734839 | 2017-03-17 14:10:57 -0700 | [diff] [blame] | 299 | u8 dev_id[3]; |
Dmitry Torokhov | d7c13d3 | 2015-01-13 20:53:22 -0800 | [diff] [blame] | 300 | u8 fw_ver[3]; |
Hans de Goede | 40e8f53 | 2014-07-25 22:37:15 -0700 | [diff] [blame] | 301 | int flags; |
Kevin Cernekee | 7a9f73e | 2013-02-13 22:24:55 -0800 | [diff] [blame] | 302 | int x_max; |
| 303 | int y_max; |
| 304 | int x_bits; |
| 305 | int y_bits; |
Hans de Goede | f3f33c6 | 2014-07-29 11:22:07 -0700 | [diff] [blame] | 306 | unsigned int x_res; |
| 307 | unsigned int y_res; |
Kevin Cernekee | 99df65e | 2013-02-13 20:56:33 -0800 | [diff] [blame] | 308 | |
Kevin Cernekee | 24af5cb | 2013-02-13 22:22:08 -0800 | [diff] [blame] | 309 | int (*hw_init)(struct psmouse *psmouse); |
| 310 | void (*process_packet)(struct psmouse *psmouse); |
Hans de Goede | 38c11eaa | 2014-07-25 22:48:44 -0700 | [diff] [blame] | 311 | int (*decode_fields)(struct alps_fields *f, unsigned char *p, |
Yunkang Tang | ee65d4b | 2013-12-26 14:54:19 -0800 | [diff] [blame] | 312 | struct psmouse *psmouse); |
Kevin Cernekee | 24af5cb | 2013-02-13 22:22:08 -0800 | [diff] [blame] | 313 | void (*set_abs_params)(struct alps_data *priv, struct input_dev *dev1); |
| 314 | |
Kevin Cernekee | 88a8034 | 2013-02-13 20:55:19 -0800 | [diff] [blame] | 315 | int prev_fin; |
| 316 | int multi_packet; |
Hans de Goede | 4dd2657 | 2015-05-20 14:41:10 -0700 | [diff] [blame] | 317 | int second_touch; |
Kevin Cernekee | 88a8034 | 2013-02-13 20:55:19 -0800 | [diff] [blame] | 318 | unsigned char multi_data[6]; |
Hans de Goede | 02d0425 | 2014-07-25 22:43:35 -0700 | [diff] [blame] | 319 | struct alps_fields f; |
Seth Forshee | 25bded7 | 2011-11-07 19:53:36 -0800 | [diff] [blame] | 320 | u8 quirks; |
Sebastian Kapfer | 1d9f262 | 2009-12-15 08:39:50 -0800 | [diff] [blame] | 321 | struct timer_list timer; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 322 | }; |
| 323 | |
Seth Forshee | 25bded7 | 2011-11-07 19:53:36 -0800 | [diff] [blame] | 324 | #define ALPS_QUIRK_TRACKSTICK_BUTTONS 1 /* trakcstick buttons in trackstick packet */ |
| 325 | |
Dmitry Torokhov | b7802c5 | 2009-09-09 19:13:20 -0700 | [diff] [blame] | 326 | int alps_detect(struct psmouse *psmouse, bool set_properties); |
Andres Salomon | 55e3d92 | 2007-03-10 01:39:54 -0500 | [diff] [blame] | 327 | int alps_init(struct psmouse *psmouse); |
Andres Salomon | 55e3d92 | 2007-03-10 01:39:54 -0500 | [diff] [blame] | 328 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 329 | #endif |