xref: /openbmc/linux/drivers/input/mouse/alps.h (revision fa629ef5222193214da9a2b3c94369f79353bec9)
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 
15*fa629ef5SSeth Forshee #define ALPS_PROTO_V1	0
16*fa629ef5SSeth Forshee #define ALPS_PROTO_V2	1
17*fa629ef5SSeth Forshee 
181da177e4SLinus Torvalds struct alps_model_info {
191da177e4SLinus Torvalds         unsigned char signature[3];
20*fa629ef5SSeth Forshee 	unsigned char proto_version;
211da177e4SLinus Torvalds         unsigned char byte0, mask0;
221da177e4SLinus Torvalds         unsigned char flags;
231da177e4SLinus Torvalds };
241da177e4SLinus Torvalds 
251da177e4SLinus Torvalds struct alps_data {
262e5b636bSDmitry Torokhov 	struct input_dev *dev2;		/* Relative device */
271da177e4SLinus Torvalds 	char phys[32];			/* Phys */
28e38de678SHelge Deller 	const struct alps_model_info *i;/* Info */
291da177e4SLinus Torvalds 	int prev_fin;			/* Finger bit from previous packet */
301d9f2626SSebastian Kapfer 	struct timer_list timer;
311da177e4SLinus Torvalds };
321da177e4SLinus Torvalds 
3355e3d922SAndres Salomon #ifdef CONFIG_MOUSE_PS2_ALPS
34b7802c5cSDmitry Torokhov int alps_detect(struct psmouse *psmouse, bool set_properties);
3555e3d922SAndres Salomon int alps_init(struct psmouse *psmouse);
3655e3d922SAndres Salomon #else
37b7802c5cSDmitry Torokhov inline int alps_detect(struct psmouse *psmouse, bool set_properties)
3855e3d922SAndres Salomon {
3955e3d922SAndres Salomon 	return -ENOSYS;
4055e3d922SAndres Salomon }
4155e3d922SAndres Salomon inline int alps_init(struct psmouse *psmouse)
4255e3d922SAndres Salomon {
4355e3d922SAndres Salomon 	return -ENOSYS;
4455e3d922SAndres Salomon }
4555e3d922SAndres Salomon #endif /* CONFIG_MOUSE_PS2_ALPS */
4655e3d922SAndres Salomon 
471da177e4SLinus Torvalds #endif
48