synapticsvar.h revision 1.2.4.2 1 1.2.4.2 skrll /* $NetBSD: synapticsvar.h,v 1.2.4.2 2005/01/17 19:31:52 skrll Exp $ */
2 1.2.4.2 skrll
3 1.2.4.2 skrll /*
4 1.2.4.2 skrll * Copyright (c) 2005, Steve C. Woodford
5 1.2.4.2 skrll * Copyright (c) 2004, Ales Krenek
6 1.2.4.2 skrll * Copyright (c) 2004, Kentaro A. Kurahone
7 1.2.4.2 skrll * All rights reserved.
8 1.2.4.2 skrll *
9 1.2.4.2 skrll * Redistribution and use in source and binary forms, with or without
10 1.2.4.2 skrll * modification, are permitted provided that the following conditions
11 1.2.4.2 skrll * are met:
12 1.2.4.2 skrll *
13 1.2.4.2 skrll * * Redistributions of source code must retain the above copyright
14 1.2.4.2 skrll * notice, this list of conditions and the following disclaimer.
15 1.2.4.2 skrll * * Redistributions in binary form must reproduce the above
16 1.2.4.2 skrll * copyright notice, this list of conditions and the following
17 1.2.4.2 skrll * disclaimer in the documentation and/or other materials provided
18 1.2.4.2 skrll * with the distribution.
19 1.2.4.2 skrll * * Neither the name of the Kentaro A. Kurahone nor the names of its
20 1.2.4.2 skrll * contributors may be used to endorse or promote products derived
21 1.2.4.2 skrll * from this software without specific prior written permission.
22 1.2.4.2 skrll *
23 1.2.4.2 skrll * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 1.2.4.2 skrll * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 1.2.4.2 skrll * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 1.2.4.2 skrll * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27 1.2.4.2 skrll * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 1.2.4.2 skrll * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 1.2.4.2 skrll * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 1.2.4.2 skrll * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 1.2.4.2 skrll * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 1.2.4.2 skrll * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 1.2.4.2 skrll * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 1.2.4.2 skrll * POSSIBILITY OF SUCH DAMAGE.
35 1.2.4.2 skrll *
36 1.2.4.2 skrll */
37 1.2.4.2 skrll
38 1.2.4.2 skrll #ifndef _DEV_PCKBCPORT_SYNAPTICSVAR_H_
39 1.2.4.2 skrll #define _DEV_PCKBCPORT_SYNAPTICSVAR_H_
40 1.2.4.2 skrll
41 1.2.4.2 skrll struct synaptics_softc {
42 1.2.4.2 skrll struct proc *syn_thread;
43 1.2.4.2 skrll int caps;
44 1.2.4.2 skrll
45 1.2.4.2 skrll int flags;
46 1.2.4.2 skrll #define SYN_FLAG_HAS_MIDDLE_BUTTON (1 << 0)
47 1.2.4.2 skrll #define SYN_FLAG_HAS_BUTTONS_4_5 (1 << 1)
48 1.2.4.2 skrll #define SYN_FLAG_HAS_UP_DOWN_BUTTONS (1 << 2)
49 1.2.4.2 skrll #define SYN_FLAG_HAS_PASSTHROUGH (1 << 3) /* Not yet supported */
50 1.2.4.2 skrll #define SYN_FLAG_HAS_PALM_DETECT (1 << 4)
51 1.2.4.2 skrll #define SYN_FLAG_HAS_MULTI_FINGER (1 << 5)
52 1.2.4.2 skrll
53 1.2.4.2 skrll u_int total_packets; /* Total number of packets received */
54 1.2.4.2 skrll #define SYN_TIME(sc,c) (((sc)->total_packets >= (c)) ? \
55 1.2.4.2 skrll ((sc)->total_packets - (c)) : \
56 1.2.4.2 skrll ((c) - (sc)->total_packets))
57 1.2.4.2 skrll
58 1.2.4.2 skrll int up_down;
59 1.2.4.2 skrll int prev_fingers;
60 1.2.4.2 skrll
61 1.2.4.2 skrll int gesture_start_x, gesture_start_y;
62 1.2.4.2 skrll u_int gesture_start_packet;
63 1.2.4.2 skrll u_int gesture_tap_packet;
64 1.2.4.2 skrll
65 1.2.4.2 skrll int gesture_buttons;
66 1.2.4.2 skrll int gesture_type;
67 1.2.4.2 skrll #define SYN_GESTURE_SINGLE 0x01
68 1.2.4.2 skrll #define SYN_GESTURE_DOUBLE 0x02
69 1.2.4.2 skrll #define SYN_GESTURE_DRAG 0x04
70 1.2.4.2 skrll #define SYN_IS_SINGLE_TAP(t) ((t) & SYN_GESTURE_SINGLE)
71 1.2.4.2 skrll #define SYN_IS_DOUBLE_TAP(t) ((t) & SYN_GESTURE_DOUBLE)
72 1.2.4.2 skrll #define SYN_IS_DRAG(t) ((t) & SYN_GESTURE_DRAG)
73 1.2.4.2 skrll
74 1.2.4.2 skrll #define SYN_HIST_SIZE 4
75 1.2.4.2 skrll int rem_x, rem_y;
76 1.2.4.2 skrll u_int movement_history;
77 1.2.4.2 skrll int history_x[SYN_HIST_SIZE], history_y[SYN_HIST_SIZE];
78 1.2.4.2 skrll };
79 1.2.4.2 skrll
80 1.2.4.2 skrll int pms_synaptics_probe_init(void *vsc);
81 1.2.4.2 skrll void pms_synaptics_enable(void *vsc);
82 1.2.4.2 skrll void pms_synaptics_resume(void *vsc);
83 1.2.4.2 skrll
84 1.2.4.2 skrll #endif
85