xref: /freebsd/share/man/man4/cyapa.4 (revision f53355131f65d64e7643d734dbcd4fb2a5de20ed)
1.\" Copyright (c) 2015 Michael Gmelin <freebsd@grem.de>
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\"
13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.Dd December 18, 2018
26.Dt CYAPA 4
27.Os
28.Sh NAME
29.Nm cyapa
30.Nd Cypress APA trackpad with I2C interface driver
31.Sh SYNOPSIS
32To compile this driver into the kernel, place the following lines into
33the kernel configuration file:
34.Bd -ragged -offset indent
35.Cd "device cyapa"
36.Cd "device ig4"
37.Cd "device iicbus"
38.Ed
39.Pp
40Alternatively, to load the driver as a module at boot time, place the following line in
41.Xr loader.conf 5 :
42.Bd -literal -offset indent
43cyapa_load="YES"
44ig4_load="YES"
45.Ed
46.Pp
47On many Chromebook models this driver can be automatically configured with the
48help of the
49.Xr chromebook_platform 4
50driver.
51Alternatively, the
52.Nm
53driver can be manually configured in
54.Pa /boot/device.hints :
55.Cd hint.cyapa.0.at="iicbus0"
56.Cd hint.cyapa.0.addr="0xCE"
57.Cd hint.cyapa.1.at="iicbus1"
58.Cd hint.cyapa.1.addr="0xCE"
59.Sh DESCRIPTION
60The
61.Nm
62driver provides support for the Cypress APA trackpad.
63It emulates the IntelliMouse PS/2 protocol.
64It supports basic mouse ioctls, so that
65.Xr moused 8
66is supported properly.
67.Ss Trackpad layout
68.Bd -literal
69                   2/3               1/3
70          +--------------------+------------+
71          |                    |   Middle   |
72          |                    |   Button   |
73          |       Left         |            |
74          |      Button        +------------+
75          |                    |   Right    |
76          |                    |   Button   |
77          +--------------------+............|
78          |     Thumb/Button Area           | 15%
79          +---------------------------------+
80.Ed
81.Ss Trackpad features
82.Bl -tag -width 8n
83.It Va Two finger scrolling
84Use two fingers for Z axis scrolling.
85.It Va Button down/second finger
86While one finger clicks and holds down the touchpad, the second finger can be
87used to move the mouse cursor.
88This can be useful for drawing or selecting text.
89.It Va Thumb/Button area
90The lower 15% of the trackpad will not affect the mouse cursor position.
91This allows for high precision clicking, by controlling the cursor with the
92index finger and pushing/holding the pad down with the thumb.
93.It Va Trackpad button
94Push physical button.
95The left two thirds of the pad issues a LEFT button event.
96The upper right corner issues a MIDDLE button event.
97The lower right corner issues a RIGHT button.
98Optionally, tap to click can be enabled (see below).
99.El
100.Pp
101On a system using
102.Xr device.hints 5 ,
103these values are configurable for
104.Nm :
105.Bl -tag -width "hint.cyapa.%d.addr"
106.It Va hint.cyapa.%d.at
107target
108.Xr iicbus 4 .
109.It Va hint.cyapa.%d.addr
110.Nm
111i2c address on the
112.Xr iicbus 4 .
113.El
114.Sh SYSCTL VARIABLES
115These
116.Xr sysctl 8
117variables are available:
118.Bl -tag -width 8n
119.It Va debug.cyapa_idle_freq
120Scan frequency in idle mode, the default is 1.
121.It Va debug.cyapa_slow_freq
122Scan frequency in slow mode, the default is 20.
123.It Va debug.cyapa_norm_freq
124Scan frequency in normal mode, the default is 100.
125.It Va debug.cyapa_minpressure
126Minimum pressure to detect a finger, the default is 12.
127.It Va debug.cyapa_enable_tapclick
128Controls tap to click.
129Possible values:
130.Bl -tag -width 8n
131.It 0
132Tap to click is disabled.
133This is the default value.
134.It 1
135Tap to click always generates a left mouse button event.
136.It 2
137Tap to click generates left mouse button event if the left 2/3rds of the pad
138are tapped and a right mouse button event otherwise.
139.It 3
140Tap to click generates mouse button events as if the physical button was
141pressed (see
142.Sx DESCRIPTION
143above).
144.El
145.It Va debug.cyapa_tapclick_min_ticks
146Minimum tap duration in ticks to create a click, the default is 1.
147.It Va debug.cyapa_tapclick_max_ticks
148Maximum tap duration in ticks to create a click, the default is 8.
149.It Va debug.cyapa_move_min_ticks
150Minimum ticks before cursor movement occurs, the default is 4.
151.It Va debug.cyapa_scroll_wait_ticks
152Ticks to wait before starting to scroll, the default is 0.
153.It Va debug.cyapa_scroll_stick_ticks
154Ticks while preventing cursor movement on single finger after scroll,
155the default is 15.
156.It Va debug.cyapa_thumbarea_percent
157Size of bottom thumb area in percent, the default is 15.
158.It Va debug.cyapa_debug
159Setting this to a non-zero value enables debug output to console and syslog,
160the default is 0.
161.It Va debug.cyapa_reset
162Setting this to a non-zero value reinitializes the device.
163The sysctl resets to zero immediately.
164.El
165.Sh FILES
166.Nm
167creates
168.Pa /dev/cyapa0 ,
169which presents the mouse as an
170.Ar IntelliMouse PS/2
171device.
172It supports
173.Xr moused 8
174levels 0 through 2, level 1 is used by default.
175.Sh EXAMPLES
176To use
177.Nm
178with
179.Xr moused 8 ,
180add the following lines to the
181.Xr rc.conf 5
182file:
183.Pp
184.Dl moused_enable="YES"
185.Dl moused_port="/dev/cyapa0"
186.Pp
187If vertical scrolling is not desired, add
188.Pp
189.Dl moused_flags="-l0"
190.Pp
191to
192.Xr rc.conf 5 .
193.Pp
194Enable tap to click for the left and the right mouse button and
195disable the thumb area by adding these lines to the
196.Xr sysctl.conf 5
197file:
198.Pp
199.Dl debug.cyapa_thumbarea_percent=0
200.Dl debug.cyapa_enable_tapclick=2
201.Sh SEE ALSO
202.Xr chromebook_platform 4 ,
203.Xr ig4 4 ,
204.Xr iicbus 4 ,
205.Xr sysmouse 4 ,
206.Xr moused 8
207.Sh AUTHORS
208.An -nosplit
209The original
210.Nm
211driver was written for
212.Dx
213by
214.An Matthew Dillon .
215.Pp
216It has been ported, modified, and enhanced for
217.Fx
218by
219.An Michael Gmelin Aq Mt freebsd@grem.de .
220.Pp
221This manual page was written by
222.An Michael Gmelin Aq Mt freebsd@grem.de .
223.Sh BUGS
224The
225.Nm
226driver detects the device from the I2C address.
227This might have unforeseen consequences if the initialization sequence
228is sent to an unknown device at that address.
229