xref: /linux/drivers/input/mouse/alps.h (revision d2912cb15bdda8ba4a5dd73396ad62641af2f520)
1*d2912cb1SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
21da177e4SLinus Torvalds /*
31da177e4SLinus Torvalds  * ALPS touchpad PS/2 mouse driver
41da177e4SLinus Torvalds  *
51da177e4SLinus Torvalds  * Copyright (c) 2003 Peter Osterlund <petero2@telia.com>
61da177e4SLinus Torvalds  * Copyright (c) 2005 Vojtech Pavlik <vojtech@suse.cz>
71da177e4SLinus Torvalds  */
81da177e4SLinus Torvalds 
91da177e4SLinus Torvalds #ifndef _ALPS_H
101da177e4SLinus Torvalds #define _ALPS_H
111da177e4SLinus Torvalds 
1202d04254SHans de Goede #include <linux/input/mt.h>
1302d04254SHans de Goede 
14d7c13d34SDmitry Torokhov #define ALPS_PROTO_V1		0x100
15d7c13d34SDmitry Torokhov #define ALPS_PROTO_V2		0x200
16d7c13d34SDmitry Torokhov #define ALPS_PROTO_V3		0x300
17fb2dd7a6SDmitry Torokhov #define ALPS_PROTO_V3_RUSHMORE	0x310
18d7c13d34SDmitry Torokhov #define ALPS_PROTO_V4		0x400
19d7c13d34SDmitry Torokhov #define ALPS_PROTO_V5		0x500
20d7c13d34SDmitry Torokhov #define ALPS_PROTO_V6		0x600
21d7c13d34SDmitry Torokhov #define ALPS_PROTO_V7		0x700	/* t3btl t4s */
223db5b9f7SMasaki Ota #define ALPS_PROTO_V8		0x800	/* SS4btl SS4s */
23c9815232SPali Rohár #define ALPS_PROTO_V9		0x900	/* ss3btl */
24fa629ef5SSeth Forshee 
253db5b9f7SMasaki Ota #define MAX_TOUCHES	4
2602d04254SHans de Goede 
27ee65d4b3SYunkang Tang #define DOLPHIN_COUNT_PER_ELECTRODE	64
28ee65d4b3SYunkang Tang #define DOLPHIN_PROFILE_XOFFSET		8	/* x-electrode offset */
29ee65d4b3SYunkang Tang #define DOLPHIN_PROFILE_YOFFSET		1	/* y-electrode offset */
30ee65d4b3SYunkang Tang 
313808843cSYunkang Tang /*
323db5b9f7SMasaki Ota  * enum SS4_PACKET_ID - defines the packet type for V8
333db5b9f7SMasaki Ota  * SS4_PACKET_ID_IDLE: There's no finger and no button activity.
343db5b9f7SMasaki Ota  * SS4_PACKET_ID_ONE: There's one finger on touchpad
353db5b9f7SMasaki Ota  *  or there's button activities.
363db5b9f7SMasaki Ota  * SS4_PACKET_ID_TWO: There's two or more fingers on touchpad
373db5b9f7SMasaki Ota  * SS4_PACKET_ID_MULTI: There's three or more fingers on touchpad
384777ac22SBen Gamari  * SS4_PACKET_ID_STICK: A stick pointer packet
393db5b9f7SMasaki Ota */
403db5b9f7SMasaki Ota enum SS4_PACKET_ID {
413db5b9f7SMasaki Ota 	SS4_PACKET_ID_IDLE = 0,
423db5b9f7SMasaki Ota 	SS4_PACKET_ID_ONE,
433db5b9f7SMasaki Ota 	SS4_PACKET_ID_TWO,
443db5b9f7SMasaki Ota 	SS4_PACKET_ID_MULTI,
454777ac22SBen Gamari 	SS4_PACKET_ID_STICK,
463db5b9f7SMasaki Ota };
473db5b9f7SMasaki Ota 
483db5b9f7SMasaki Ota #define SS4_COUNT_PER_ELECTRODE		256
493db5b9f7SMasaki Ota #define SS4_NUMSENSOR_XOFFSET		7
503db5b9f7SMasaki Ota #define SS4_NUMSENSOR_YOFFSET		7
513db5b9f7SMasaki Ota #define SS4_MIN_PITCH_MM		50
523db5b9f7SMasaki Ota 
533db5b9f7SMasaki Ota #define SS4_MASK_NORMAL_BUTTONS		0x07
543db5b9f7SMasaki Ota 
55e7348396SMasaki Ota #define SS4PLUS_COUNT_PER_ELECTRODE	128
56e7348396SMasaki Ota #define SS4PLUS_NUMSENSOR_XOFFSET	16
57e7348396SMasaki Ota #define SS4PLUS_NUMSENSOR_YOFFSET	5
58e7348396SMasaki Ota #define SS4PLUS_MIN_PITCH_MM		37
59e7348396SMasaki Ota 
60e7348396SMasaki Ota #define IS_SS4PLUS_DEV(_b)	(((_b[0]) == 0x73) &&	\
61e7348396SMasaki Ota 				 ((_b[1]) == 0x03) &&	\
62e7348396SMasaki Ota 				 ((_b[2]) == 0x28)		\
63e7348396SMasaki Ota 				)
64e7348396SMasaki Ota 
6523fce365SPaul Donohue #define SS4_IS_IDLE_V2(_b)	(((_b[0]) == 0x18) &&		\
6623fce365SPaul Donohue 				 ((_b[1]) == 0x10) &&		\
6723fce365SPaul Donohue 				 ((_b[2]) == 0x00) &&		\
6823fce365SPaul Donohue 				 ((_b[3] & 0x88) == 0x08) &&	\
6923fce365SPaul Donohue 				 ((_b[4]) == 0x10) &&		\
7023fce365SPaul Donohue 				 ((_b[5]) == 0x00)		\
7123fce365SPaul Donohue 				)
7223fce365SPaul Donohue 
7323fce365SPaul Donohue #define SS4_1F_X_V2(_b)		(((_b[0]) & 0x0007) |		\
743db5b9f7SMasaki Ota 				 ((_b[1] << 3) & 0x0078) |	\
753db5b9f7SMasaki Ota 				 ((_b[1] << 2) & 0x0380) |	\
763db5b9f7SMasaki Ota 				 ((_b[2] << 5) & 0x1C00)	\
773db5b9f7SMasaki Ota 				)
783db5b9f7SMasaki Ota 
793db5b9f7SMasaki Ota #define SS4_1F_Y_V2(_b)		(((_b[2]) & 0x000F) |		\
803db5b9f7SMasaki Ota 				 ((_b[3] >> 2) & 0x0030) |	\
813db5b9f7SMasaki Ota 				 ((_b[4] << 6) & 0x03C0) |	\
823db5b9f7SMasaki Ota 				 ((_b[4] << 5) & 0x0C00)	\
833db5b9f7SMasaki Ota 				)
843db5b9f7SMasaki Ota 
853db5b9f7SMasaki Ota #define SS4_1F_Z_V2(_b)		(((_b[5]) & 0x0F) |		\
863db5b9f7SMasaki Ota 				 ((_b[5] >> 1) & 0x70) |	\
873db5b9f7SMasaki Ota 				 ((_b[4]) & 0x80)		\
883db5b9f7SMasaki Ota 				)
893db5b9f7SMasaki Ota 
903db5b9f7SMasaki Ota #define SS4_1F_LFB_V2(_b)	(((_b[2] >> 4) & 0x01) == 0x01)
913db5b9f7SMasaki Ota 
923db5b9f7SMasaki Ota #define SS4_MF_LF_V2(_b, _i)	((_b[1 + (_i) * 3] & 0x0004) == 0x0004)
933db5b9f7SMasaki Ota 
943db5b9f7SMasaki Ota #define SS4_BTN_V2(_b)		((_b[0] >> 5) & SS4_MASK_NORMAL_BUTTONS)
953db5b9f7SMasaki Ota 
963db5b9f7SMasaki Ota #define SS4_STD_MF_X_V2(_b, _i)	(((_b[0 + (_i) * 3] << 5) & 0x00E0) |	\
973db5b9f7SMasaki Ota 				 ((_b[1 + _i * 3]  << 5) & 0x1F00)	\
983db5b9f7SMasaki Ota 				)
993db5b9f7SMasaki Ota 
1004a646580SMasaki Ota #define SS4_PLUS_STD_MF_X_V2(_b, _i) (((_b[0 + (_i) * 3] << 4) & 0x0070) | \
1014a646580SMasaki Ota 				 ((_b[1 + (_i) * 3]  << 4) & 0x0F80)	\
1024a646580SMasaki Ota 				)
1034a646580SMasaki Ota 
1043db5b9f7SMasaki Ota #define SS4_STD_MF_Y_V2(_b, _i)	(((_b[1 + (_i) * 3] << 3) & 0x0010) |	\
1053db5b9f7SMasaki Ota 				 ((_b[2 + (_i) * 3] << 5) & 0x01E0) |	\
1063db5b9f7SMasaki Ota 				 ((_b[2 + (_i) * 3] << 4) & 0x0E00)	\
1073db5b9f7SMasaki Ota 				)
1083db5b9f7SMasaki Ota 
1093db5b9f7SMasaki Ota #define SS4_BTL_MF_X_V2(_b, _i)	(SS4_STD_MF_X_V2(_b, _i) |		\
1103db5b9f7SMasaki Ota 				 ((_b[0 + (_i) * 3] >> 3) & 0x0010)	\
1113db5b9f7SMasaki Ota 				)
1123db5b9f7SMasaki Ota 
1134a646580SMasaki Ota #define SS4_PLUS_BTL_MF_X_V2(_b, _i) (SS4_PLUS_STD_MF_X_V2(_b, _i) |	\
1144a646580SMasaki Ota 				 ((_b[0 + (_i) * 3] >> 4) & 0x0008)	\
1154a646580SMasaki Ota 				)
1164a646580SMasaki Ota 
1173db5b9f7SMasaki Ota #define SS4_BTL_MF_Y_V2(_b, _i)	(SS4_STD_MF_Y_V2(_b, _i) | \
1183db5b9f7SMasaki Ota 				 ((_b[0 + (_i) * 3] >> 3) & 0x0008)	\
1193db5b9f7SMasaki Ota 				)
1203db5b9f7SMasaki Ota 
1213db5b9f7SMasaki Ota #define SS4_MF_Z_V2(_b, _i)	(((_b[1 + (_i) * 3]) & 0x0001) |	\
1223db5b9f7SMasaki Ota 				 ((_b[1 + (_i) * 3] >> 1) & 0x0002)	\
1233db5b9f7SMasaki Ota 				)
1243db5b9f7SMasaki Ota 
1253db5b9f7SMasaki Ota #define SS4_IS_MF_CONTINUE(_b)	((_b[2] & 0x10) == 0x10)
1263db5b9f7SMasaki Ota #define SS4_IS_5F_DETECTED(_b)	((_b[2] & 0x10) == 0x10)
1273db5b9f7SMasaki Ota 
12823fce365SPaul Donohue #define SS4_TS_X_V2(_b)		(s8)(				\
12923fce365SPaul Donohue 				 ((_b[0] & 0x01) << 7) |	\
13023fce365SPaul Donohue 				 (_b[1] & 0x7F)		\
13123fce365SPaul Donohue 				)
13223fce365SPaul Donohue 
13347e3a5edSPaul Donohue #define SS4_TS_Y_V2(_b)		-(s8)(				\
13423fce365SPaul Donohue 				 ((_b[3] & 0x01) << 7) |	\
13523fce365SPaul Donohue 				 (_b[2] & 0x7F)		\
13623fce365SPaul Donohue 				)
13723fce365SPaul Donohue 
13823fce365SPaul Donohue #define SS4_TS_Z_V2(_b)		(s8)(_b[4] & 0x7F)
13923fce365SPaul Donohue 
1403db5b9f7SMasaki Ota 
1413db5b9f7SMasaki Ota #define SS4_MFPACKET_NO_AX		8160	/* X-Coordinate value */
1423db5b9f7SMasaki Ota #define SS4_MFPACKET_NO_AY		4080	/* Y-Coordinate value */
1434d94e776SNir Perry #define SS4_MFPACKET_NO_AX_BL		8176	/* Buttonless X-Coord value */
1444d94e776SNir Perry #define SS4_MFPACKET_NO_AY_BL		4088	/* Buttonless Y-Coord value */
1454d94e776SNir Perry #define SS4_PLUS_MFPACKET_NO_AX		4080	/* SS4 PLUS, X */
1464d94e776SNir Perry #define SS4_PLUS_MFPACKET_NO_AX_BL	4088	/* Buttonless SS4 PLUS, X */
1473db5b9f7SMasaki Ota 
1483db5b9f7SMasaki Ota /*
1493808843cSYunkang Tang  * enum V7_PACKET_ID - defines the packet type for V7
1503808843cSYunkang Tang  * V7_PACKET_ID_IDLE: There's no finger and no button activity.
1513808843cSYunkang Tang  * V7_PACKET_ID_TWO: There's one or two non-resting fingers on touchpad
1523808843cSYunkang Tang  *  or there's button activities.
1533808843cSYunkang Tang  * V7_PACKET_ID_MULTI: There are at least three non-resting fingers.
1543808843cSYunkang Tang  * V7_PACKET_ID_NEW: The finger position in slot is not continues from
1553808843cSYunkang Tang  *  previous packet.
1563808843cSYunkang Tang */
1573808843cSYunkang Tang enum V7_PACKET_ID {
1583808843cSYunkang Tang 	 V7_PACKET_ID_IDLE,
1593808843cSYunkang Tang 	 V7_PACKET_ID_TWO,
1603808843cSYunkang Tang 	 V7_PACKET_ID_MULTI,
1613808843cSYunkang Tang 	 V7_PACKET_ID_NEW,
1623808843cSYunkang Tang 	 V7_PACKET_ID_UNKNOWN,
1633808843cSYunkang Tang };
1643808843cSYunkang Tang 
16588a80348SKevin Cernekee /**
1668326bb57SDmitry Torokhov  * struct alps_protocol_info - information about protocol used by a device
1678326bb57SDmitry Torokhov  * @version: Indicates V1/V2/V3/...
1688326bb57SDmitry Torokhov  * @byte0: Helps figure out whether a position report packet matches the
1698326bb57SDmitry Torokhov  *   known format for this model.  The first byte of the report, ANDed with
1708326bb57SDmitry Torokhov  *   mask0, should match byte0.
1718326bb57SDmitry Torokhov  * @mask0: The mask used to check the first byte of the report.
1728326bb57SDmitry Torokhov  * @flags: Additional device capabilities (passthrough port, trackstick, etc.).
1738326bb57SDmitry Torokhov  */
1748326bb57SDmitry Torokhov struct alps_protocol_info {
1758326bb57SDmitry Torokhov 	u16 version;
1768326bb57SDmitry Torokhov 	u8 byte0, mask0;
1778326bb57SDmitry Torokhov 	unsigned int flags;
1788326bb57SDmitry Torokhov };
1798326bb57SDmitry Torokhov 
1808326bb57SDmitry Torokhov /**
18188a80348SKevin Cernekee  * struct alps_model_info - touchpad ID table
18288a80348SKevin Cernekee  * @signature: E7 response string to match.
1837343d119SMarcos Paulo de Souza  * @protocol_info: information about protocol used by the device.
18488a80348SKevin Cernekee  *
18588a80348SKevin Cernekee  * Many (but not all) ALPS touchpads can be identified by looking at the
18688a80348SKevin Cernekee  * values returned in the "E7 report" and/or the "EC report."  This table
18788a80348SKevin Cernekee  * lists a number of such touchpads.
18888a80348SKevin Cernekee  */
1891da177e4SLinus Torvalds struct alps_model_info {
190d7c13d34SDmitry Torokhov 	u8 signature[3];
1918326bb57SDmitry Torokhov 	struct alps_protocol_info protocol_info;
1921da177e4SLinus Torvalds };
1931da177e4SLinus Torvalds 
19488a80348SKevin Cernekee /**
19588a80348SKevin Cernekee  * struct alps_nibble_commands - encodings for register accesses
19688a80348SKevin Cernekee  * @command: PS/2 command used for the nibble
19788a80348SKevin Cernekee  * @data: Data supplied as an argument to the PS/2 command, if applicable
19888a80348SKevin Cernekee  *
19988a80348SKevin Cernekee  * The ALPS protocol uses magic sequences to transmit binary data to the
20088a80348SKevin Cernekee  * touchpad, as it is generally not OK to send arbitrary bytes out the
20188a80348SKevin Cernekee  * PS/2 port.  Each of the sequences in this table sends one nibble of the
20288a80348SKevin Cernekee  * register address or (write) data.  Different versions of the ALPS protocol
20388a80348SKevin Cernekee  * use slightly different encodings.
20488a80348SKevin Cernekee  */
20525bded7cSSeth Forshee struct alps_nibble_commands {
20625bded7cSSeth Forshee 	int command;
20725bded7cSSeth Forshee 	unsigned char data;
20825bded7cSSeth Forshee };
20925bded7cSSeth Forshee 
210036e6c7bSHans de Goede struct alps_bitmap_point {
211036e6c7bSHans de Goede 	int start_bit;
212036e6c7bSHans de Goede 	int num_bits;
213036e6c7bSHans de Goede };
214036e6c7bSHans de Goede 
21588a80348SKevin Cernekee /**
216f85e5001SKevin Cernekee  * struct alps_fields - decoded version of the report packet
217f85e5001SKevin Cernekee  * @x_map: Bitmap of active X positions for MT.
218f85e5001SKevin Cernekee  * @y_map: Bitmap of active Y positions for MT.
219f85e5001SKevin Cernekee  * @fingers: Number of fingers for MT.
22002d04254SHans de Goede  * @pressure: Pressure.
22102d04254SHans de Goede  * @st: position for ST.
22202d04254SHans de Goede  * @mt: position for MT.
223f85e5001SKevin Cernekee  * @first_mp: Packet is the first of a multi-packet report.
224f85e5001SKevin Cernekee  * @is_mp: Packet is part of a multi-packet report.
225f85e5001SKevin Cernekee  * @left: Left touchpad button is active.
226f85e5001SKevin Cernekee  * @right: Right touchpad button is active.
227f85e5001SKevin Cernekee  * @middle: Middle touchpad button is active.
228f85e5001SKevin Cernekee  * @ts_left: Left trackstick button is active.
229f85e5001SKevin Cernekee  * @ts_right: Right trackstick button is active.
230f85e5001SKevin Cernekee  * @ts_middle: Middle trackstick button is active.
231f85e5001SKevin Cernekee  */
232f85e5001SKevin Cernekee struct alps_fields {
233f85e5001SKevin Cernekee 	unsigned int x_map;
234f85e5001SKevin Cernekee 	unsigned int y_map;
235f85e5001SKevin Cernekee 	unsigned int fingers;
23602d04254SHans de Goede 
23702d04254SHans de Goede 	int pressure;
23802d04254SHans de Goede 	struct input_mt_pos st;
23902d04254SHans de Goede 	struct input_mt_pos mt[MAX_TOUCHES];
24002d04254SHans de Goede 
241f85e5001SKevin Cernekee 	unsigned int first_mp:1;
242f85e5001SKevin Cernekee 	unsigned int is_mp:1;
243f85e5001SKevin Cernekee 
244f85e5001SKevin Cernekee 	unsigned int left:1;
245f85e5001SKevin Cernekee 	unsigned int right:1;
246f85e5001SKevin Cernekee 	unsigned int middle:1;
247f85e5001SKevin Cernekee 
248f85e5001SKevin Cernekee 	unsigned int ts_left:1;
249f85e5001SKevin Cernekee 	unsigned int ts_right:1;
250f85e5001SKevin Cernekee 	unsigned int ts_middle:1;
251f85e5001SKevin Cernekee };
252f85e5001SKevin Cernekee 
253f85e5001SKevin Cernekee /**
25488a80348SKevin Cernekee  * struct alps_data - private data structure for the ALPS driver
25504aae283SPali Rohár  * @psmouse: Pointer to parent psmouse device
25604aae283SPali Rohár  * @dev2: Trackstick device (can be NULL).
25704aae283SPali Rohár  * @dev3: Generic PS/2 mouse (can be NULL, delayed registering).
25804aae283SPali Rohár  * @phys2: Physical path for the trackstick device.
25904aae283SPali Rohár  * @phys3: Physical path for the generic PS/2 mouse.
26004aae283SPali Rohár  * @dev3_register_work: Delayed work for registering PS/2 mouse.
26188a80348SKevin Cernekee  * @nibble_commands: Command mapping used for touchpad register accesses.
26288a80348SKevin Cernekee  * @addr_command: Command used to tell the touchpad that a register address
26388a80348SKevin Cernekee  *   follows.
26499df65e7SKevin Cernekee  * @proto_version: Indicates V1/V2/V3/...
26599df65e7SKevin Cernekee  * @byte0: Helps figure out whether a position report packet matches the
26699df65e7SKevin Cernekee  *   known format for this model.  The first byte of the report, ANDed with
26799df65e7SKevin Cernekee  *   mask0, should match byte0.
26899df65e7SKevin Cernekee  * @mask0: The mask used to check the first byte of the report.
269c0cd17f6SHans de Goede  * @fw_ver: cached copy of firmware version (EC report)
27099df65e7SKevin Cernekee  * @flags: Additional device capabilities (passthrough port, trackstick, etc.).
2717a9f73e7SKevin Cernekee  * @x_max: Largest possible X position value.
2727a9f73e7SKevin Cernekee  * @y_max: Largest possible Y position value.
2737a9f73e7SKevin Cernekee  * @x_bits: Number of X bits in the MT bitmap.
2747a9f73e7SKevin Cernekee  * @y_bits: Number of Y bits in the MT bitmap.
27524af5cb9SKevin Cernekee  * @hw_init: Protocol-specific hardware init function.
27624af5cb9SKevin Cernekee  * @process_packet: Protocol-specific function to process a report packet.
277f85e5001SKevin Cernekee  * @decode_fields: Protocol-specific function to read packet bitfields.
27824af5cb9SKevin Cernekee  * @set_abs_params: Protocol-specific function to configure the input_dev.
27988a80348SKevin Cernekee  * @prev_fin: Finger bit from previous packet.
28088a80348SKevin Cernekee  * @multi_packet: Multi-packet data in progress.
28188a80348SKevin Cernekee  * @multi_data: Saved multi-packet data.
28202d04254SHans de Goede  * @f: Decoded packet data fields.
28388a80348SKevin Cernekee  * @quirks: Bitmap of ALPS_QUIRK_*.
28488a80348SKevin Cernekee  * @timer: Timer for flushing out the final report packet in the stream.
28588a80348SKevin Cernekee  */
2861da177e4SLinus Torvalds struct alps_data {
28704aae283SPali Rohár 	struct psmouse *psmouse;
28888a80348SKevin Cernekee 	struct input_dev *dev2;
28904aae283SPali Rohár 	struct input_dev *dev3;
29004aae283SPali Rohár 	char phys2[32];
29104aae283SPali Rohár 	char phys3[32];
29204aae283SPali Rohár 	struct delayed_work dev3_register_work;
29399df65e7SKevin Cernekee 
29499df65e7SKevin Cernekee 	/* these are autodetected when the device is identified */
29525bded7cSSeth Forshee 	const struct alps_nibble_commands *nibble_commands;
29688a80348SKevin Cernekee 	int addr_command;
297d7c13d34SDmitry Torokhov 	u16 proto_version;
298d7c13d34SDmitry Torokhov 	u8 byte0, mask0;
299e7348396SMasaki Ota 	u8 dev_id[3];
300d7c13d34SDmitry Torokhov 	u8 fw_ver[3];
30140e8f53bSHans de Goede 	int flags;
3027a9f73e7SKevin Cernekee 	int x_max;
3037a9f73e7SKevin Cernekee 	int y_max;
3047a9f73e7SKevin Cernekee 	int x_bits;
3057a9f73e7SKevin Cernekee 	int y_bits;
306f3f33c67SHans de Goede 	unsigned int x_res;
307f3f33c67SHans de Goede 	unsigned int y_res;
30899df65e7SKevin Cernekee 
30924af5cb9SKevin Cernekee 	int (*hw_init)(struct psmouse *psmouse);
31024af5cb9SKevin Cernekee 	void (*process_packet)(struct psmouse *psmouse);
31138c11eaaSHans de Goede 	int (*decode_fields)(struct alps_fields *f, unsigned char *p,
312ee65d4b3SYunkang Tang 			      struct psmouse *psmouse);
31324af5cb9SKevin Cernekee 	void (*set_abs_params)(struct alps_data *priv, struct input_dev *dev1);
31424af5cb9SKevin Cernekee 
31588a80348SKevin Cernekee 	int prev_fin;
31688a80348SKevin Cernekee 	int multi_packet;
3174dd26573SHans de Goede 	int second_touch;
31888a80348SKevin Cernekee 	unsigned char multi_data[6];
31902d04254SHans de Goede 	struct alps_fields f;
32025bded7cSSeth Forshee 	u8 quirks;
3211d9f2626SSebastian Kapfer 	struct timer_list timer;
3221da177e4SLinus Torvalds };
3231da177e4SLinus Torvalds 
32425bded7cSSeth Forshee #define ALPS_QUIRK_TRACKSTICK_BUTTONS	1 /* trakcstick buttons in trackstick packet */
32525bded7cSSeth Forshee 
32655e3d922SAndres Salomon #ifdef CONFIG_MOUSE_PS2_ALPS
327b7802c5cSDmitry Torokhov int alps_detect(struct psmouse *psmouse, bool set_properties);
32855e3d922SAndres Salomon int alps_init(struct psmouse *psmouse);
32955e3d922SAndres Salomon #else
330b7802c5cSDmitry Torokhov inline int alps_detect(struct psmouse *psmouse, bool set_properties)
33155e3d922SAndres Salomon {
33255e3d922SAndres Salomon 	return -ENOSYS;
33355e3d922SAndres Salomon }
33455e3d922SAndres Salomon inline int alps_init(struct psmouse *psmouse)
33555e3d922SAndres Salomon {
33655e3d922SAndres Salomon 	return -ENOSYS;
33755e3d922SAndres Salomon }
33855e3d922SAndres Salomon #endif /* CONFIG_MOUSE_PS2_ALPS */
33955e3d922SAndres Salomon 
3401da177e4SLinus Torvalds #endif
341