2 .\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD
4 .\" Copyright (c) 2020 Andriy Gapon <avg@FreeBSD.org>
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
15 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 .Nd GPIO keys device driver
36 To compile this driver into the kernel,
37 place the following lines in your
38 kernel configuration file:
39 .Bd -ragged -offset indent
45 Alternatively, to load the driver as a
46 module at boot time, place the following line in
48 .Bd -literal -offset indent
54 driver provides a way to represent a set of general purpose inputs as a
57 At the moment the driver supports only
60 The DTS determines what pins are mapped to buttons and what key codes are
61 generated for each virtual button.
64 device can be used from userland to monitor for input changes.
71 device usually looks like:
78 compatible = "gpio-keys";
83 gpios = <&gpio 0 3 GPIO_ACTIVE_LOW>
89 gpios = <&gpio 0 4 GPIO_ACTIVE_LOW>
95 For more details about the
97 property, please consult
98 .Pa /usr/src/sys/dts/bindings-gpio.txt .
102 driver supports two properties for specifying a key code.
108 native scancode compatible with
114 specifies an evdev scancode.
115 That scancode is internally translated to a native scancode.
116 Note that not all evdev scancodes have corresponding native scancodes.
117 If a scancode cannot be translated, then a diagnostic message is printed
118 and the input is ignored.
122 is a descriptive name of a button.
123 It is used for diagnostic messages only.
124 This property is optional.
125 If not set, the node name is used in its place.
129 determines whether autorepeat is enabled for a button.
132 .Va debounce-interval
133 defines debouncing interval time in milliseconds.
134 If not specified the interval defaults to 5.
143 manual page first appeared in
148 driver was written by
149 .An Oleksandr Tymoshenko Aq Mt gonzo@FreeBSD.org .
151 manual page was written by
152 .An Andriy Gapon Aq Mt avg@FreeBSD.org .