| Main index | Section 4 | Options |
Alternatively, to load the driver as a module at boot time, place the following line in loader.conf(5):
gpiokeys_load="YES"
On an FDT(4) based system the DTS part for a gpiokeys device usually looks like:
/ {
...
gpio_keys {
compatible = "gpio-keys";
btn1 {
label = "button1";
linux,code = <KEY_1>;
gpios = <&gpio 0 3 GPIO_ACTIVE_LOW>
};
btn2 {
label = "button2";
linux,code = <KEY_2>;
gpios = <&gpio 0 4 GPIO_ACTIVE_LOW>
};
};
};
For more details about the gpios property, please consult /usr/src/sys/dts/bindings-gpio.txt.
The gpiokeys driver supports two properties for specifying a key code.
The property freebsd,code specifies a FreeBSD native scancode compatible with kbdmap(5) keyboard maps.
The property linux,code specifies an evdev scancode. That scancode is internally translated to a native scancode. Note that not all evdev scancodes have corresponding native scancodes. If a scancode cannot be translated, then a diagnostic message is printed and the input is ignored.
The property label is a descriptive name of a button. It is used for diagnostic messages only. This property is optional. If not set, the node name is used in its place.
The property autorepeat determines whether autorepeat is enabled for a button.
The property debounce-interval defines debouncing interval time in milliseconds. If not specified the interval defaults to 5.
| GPIOKEYS (4) | August 5, 2020 |
| Main index | Section 4 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
| “ | "I liken starting one's computing career with Unix, say as an undergraduate, to being born in East Africa. It is intolerably hot, your body is covered with lice and flies, you are malnourished and you suffer from numerous curable diseases. But, as far as young East Africans can tell, this is simply the natural condition and they live within it. By the time they find out differently, it is too late. They already think that the writing of shell scripts is a natural act." | ” |
| — Ken Pier, Xerox PARC | ||