xref: /haiku/src/add-ons/kernel/bus_managers/ps2/ps2_elantech.h (revision 4a55cc230cf7566cadcbb23b1928eefff8aea9a2)
1 /*
2  * Copyright 2013, Haiku, Inc.
3  * Distributed under the terms of the MIT License.
4  *
5  * The elantech_model_info struct and all the hardware specs are taken from the
6  * linux driver, thanks a lot!
7  *
8  * Authors:
9  *		Jérôme Duval <korli@users.berlios.de>
10  */
11 #ifndef _PS2_ELANTECH_H
12 #define _PS2_ELANTECH_H
13 
14 
15 #include <KernelExport.h>
16 
17 #include "packet_buffer.h"
18 #include "ps2_dev.h"
19 
20 
21 typedef struct {
22 			ps2_dev*			dev;
23 
24 			sem_id				sem;
25 	struct	packet_buffer*		ring_buffer;
26 			size_t				packet_index;
27 
28 			uint32				version;
29 			uint32				fwVersion;
30 
31 			uint32				x;
32 			uint32				y;
33 			uint32				fingers;
34 
35 
36 			uint8				buffer[PS2_PACKET_ELANTECH];
37 			uint8				capabilities[3];
38 
39 			uint8				previousZ;
40 
41 			uint8				mode;
42 			bool				crcEnabled;
43 
44 	status_t (*send_command)(ps2_dev* dev, uint8 cmd, uint8 *in, int in_count);
45 } elantech_cookie;
46 
47 
48 status_t probe_elantech(ps2_dev *dev);
49 
50 status_t elantech_open(const char *name, uint32 flags, void **_cookie);
51 status_t elantech_close(void *_cookie);
52 status_t elantech_freecookie(void *_cookie);
53 status_t elantech_ioctl(void *_cookie, uint32 op, void *buffer, size_t length);
54 
55 int32 elantech_handle_int(ps2_dev *dev);
56 void elantech_disconnect(ps2_dev *dev);
57 
58 extern device_hooks gElantechDeviceHooks;
59 
60 
61 #endif /* _PS2_ELANTECH_H */
62