1 /* 2 * Copyright 2011, Haiku, Inc. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Clemens Zeidler (haiku@Clemens-Zeidler.de) 7 */ 8 #ifndef ALPS_H 9 #define ALPS_H 10 11 #include <KernelExport.h> 12 13 #include <touchpad_settings.h> 14 15 #include "movement_maker.h" 16 #include "packet_buffer.h" 17 #include "ps2_dev.h" 18 19 20 typedef struct { 21 ps2_dev* dev; 22 23 sem_id sem; 24 struct packet_buffer* ring_buffer; 25 size_t packet_index; 26 uint8 buffer[PS2_PACKET_ALPS]; 27 uint8 mode; 28 29 uint8 previousZ; 30 TouchpadMovement movementMaker; 31 32 touchpad_settings settings; 33 } alps_cookie; 34 35 36 status_t probe_alps(ps2_dev *dev); 37 38 status_t alps_open(const char *name, uint32 flags, void **_cookie); 39 status_t alps_close(void *_cookie); 40 status_t alps_freecookie(void *_cookie); 41 status_t alps_ioctl(void *_cookie, uint32 op, void *buffer, size_t length); 42 43 int32 alps_handle_int(ps2_dev *dev); 44 void alps_disconnect(ps2_dev *dev); 45 46 extern device_hooks gALPSDeviceHooks; 47 48 49 #endif /* ALPS_H */ 50