xref: /openbmc/linux/drivers/input/mouse/alps.h (revision 25bded7cd60fa460e520e9f819bd06f4c5cb53f0)
11da177e4SLinus Torvalds /*
21da177e4SLinus Torvalds  * ALPS touchpad PS/2 mouse driver
31da177e4SLinus Torvalds  *
41da177e4SLinus Torvalds  * Copyright (c) 2003 Peter Osterlund <petero2@telia.com>
51da177e4SLinus Torvalds  * Copyright (c) 2005 Vojtech Pavlik <vojtech@suse.cz>
61da177e4SLinus Torvalds  *
71da177e4SLinus Torvalds  * This program is free software; you can redistribute it and/or modify it
81da177e4SLinus Torvalds  * under the terms of the GNU General Public License version 2 as published by
91da177e4SLinus Torvalds  * the Free Software Foundation.
101da177e4SLinus Torvalds  */
111da177e4SLinus Torvalds 
121da177e4SLinus Torvalds #ifndef _ALPS_H
131da177e4SLinus Torvalds #define _ALPS_H
141da177e4SLinus Torvalds 
15fa629ef5SSeth Forshee #define ALPS_PROTO_V1	0
16fa629ef5SSeth Forshee #define ALPS_PROTO_V2	1
17*25bded7cSSeth Forshee #define ALPS_PROTO_V3	2
18*25bded7cSSeth Forshee #define ALPS_PROTO_V4	3
19fa629ef5SSeth Forshee 
201da177e4SLinus Torvalds struct alps_model_info {
211da177e4SLinus Torvalds         unsigned char signature[3];
22*25bded7cSSeth Forshee 	unsigned char command_mode_resp; /* v3/v4 only */
23fa629ef5SSeth Forshee 	unsigned char proto_version;
241da177e4SLinus Torvalds         unsigned char byte0, mask0;
251da177e4SLinus Torvalds         unsigned char flags;
261da177e4SLinus Torvalds };
271da177e4SLinus Torvalds 
28*25bded7cSSeth Forshee struct alps_nibble_commands {
29*25bded7cSSeth Forshee 	int command;
30*25bded7cSSeth Forshee 	unsigned char data;
31*25bded7cSSeth Forshee };
32*25bded7cSSeth Forshee 
331da177e4SLinus Torvalds struct alps_data {
342e5b636bSDmitry Torokhov 	struct input_dev *dev2;		/* Relative device */
351da177e4SLinus Torvalds 	char phys[32];			/* Phys */
36e38de678SHelge Deller 	const struct alps_model_info *i;/* Info */
37*25bded7cSSeth Forshee 	const struct alps_nibble_commands *nibble_commands;
38*25bded7cSSeth Forshee 	int addr_command;		/* Command to set register address */
391da177e4SLinus Torvalds 	int prev_fin;			/* Finger bit from previous packet */
40*25bded7cSSeth Forshee 	int multi_packet;		/* Multi-packet data in progress */
41*25bded7cSSeth Forshee 	u8 quirks;
421d9f2626SSebastian Kapfer 	struct timer_list timer;
431da177e4SLinus Torvalds };
441da177e4SLinus Torvalds 
45*25bded7cSSeth Forshee #define ALPS_QUIRK_TRACKSTICK_BUTTONS	1 /* trakcstick buttons in trackstick packet */
46*25bded7cSSeth Forshee 
4755e3d922SAndres Salomon #ifdef CONFIG_MOUSE_PS2_ALPS
48b7802c5cSDmitry Torokhov int alps_detect(struct psmouse *psmouse, bool set_properties);
4955e3d922SAndres Salomon int alps_init(struct psmouse *psmouse);
5055e3d922SAndres Salomon #else
51b7802c5cSDmitry Torokhov inline int alps_detect(struct psmouse *psmouse, bool set_properties)
5255e3d922SAndres Salomon {
5355e3d922SAndres Salomon 	return -ENOSYS;
5455e3d922SAndres Salomon }
5555e3d922SAndres Salomon inline int alps_init(struct psmouse *psmouse)
5655e3d922SAndres Salomon {
5755e3d922SAndres Salomon 	return -ENOSYS;
5855e3d922SAndres Salomon }
5955e3d922SAndres Salomon #endif /* CONFIG_MOUSE_PS2_ALPS */
6055e3d922SAndres Salomon 
611da177e4SLinus Torvalds #endif
62