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 <touchpad_settings.h>
18
19#include "movement_maker.h"
20#include "packet_buffer.h"
21#include "ps2_dev.h"
22
23
24typedef struct {
25			ps2_dev*			dev;
26
27			sem_id				sem;
28	struct	packet_buffer*		ring_buffer;
29			size_t				packet_index;
30
31			TouchpadMovement	movementMaker;
32
33			touchpad_settings	settings;
34			uint32				version;
35			uint32				fwVersion;
36
37			uint32				x;
38			uint32				y;
39			uint32				fingers;
40
41
42			uint8				buffer[PS2_PACKET_ELANTECH];
43			uint8				capabilities[3];
44
45			uint8				previousZ;
46
47			uint8				mode;
48			bool				crcEnabled;
49
50
51	status_t (*send_command)(ps2_dev* dev, uint8 cmd, uint8 *in, int in_count);
52} elantech_cookie;
53
54
55status_t probe_elantech(ps2_dev *dev);
56
57status_t elantech_open(const char *name, uint32 flags, void **_cookie);
58status_t elantech_close(void *_cookie);
59status_t elantech_freecookie(void *_cookie);
60status_t elantech_ioctl(void *_cookie, uint32 op, void *buffer, size_t length);
61
62int32 elantech_handle_int(ps2_dev *dev);
63void elantech_disconnect(ps2_dev *dev);
64
65extern device_hooks gElantechDeviceHooks;
66
67
68#endif /* _PS2_ELANTECH_H */
69