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