Add a device driver to read events from a Linux evdev device node and inject them back as Zephyr input events. Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
154 lines
3.4 KiB
Text
154 lines
3.4 KiB
Text
/*
|
|
* Copyright 2023 Google LLC
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
/ {
|
|
test {
|
|
#address-cells = <1>;
|
|
#size-cells = <1>;
|
|
|
|
test_gpio: gpio@0 {
|
|
compatible = "vnd,gpio";
|
|
gpio-controller;
|
|
reg = <0x0 0x1000>;
|
|
#gpio-cells = <0x2>;
|
|
status = "okay";
|
|
};
|
|
|
|
gpio-keys {
|
|
compatible = "gpio-keys";
|
|
debounce-interval-ms = <30>;
|
|
button_0 {
|
|
gpios = <&test_gpio 0 0>;
|
|
zephyr,code = <0>;
|
|
};
|
|
};
|
|
|
|
evdev {
|
|
compatible = "zephyr,native-linux-evdev";
|
|
};
|
|
|
|
kbd-matrix-0 {
|
|
compatible = "gpio-kbd-matrix";
|
|
row-gpios = <&test_gpio 0 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>,
|
|
<&test_gpio 1 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
|
|
col-gpios = <&test_gpio 2 GPIO_ACTIVE_LOW>,
|
|
<&test_gpio 3 GPIO_ACTIVE_LOW>,
|
|
<&test_gpio 4 GPIO_ACTIVE_LOW>;
|
|
actual-key-mask = <0x0f 0x0a 0x0b>;
|
|
};
|
|
|
|
kbd-matrix-1 {
|
|
compatible = "gpio-kbd-matrix";
|
|
row-gpios = <&test_gpio 0 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>,
|
|
<&test_gpio 1 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>,
|
|
<&test_gpio 2 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>;
|
|
col-gpios = <&test_gpio 3 GPIO_ACTIVE_HIGH>,
|
|
<&test_gpio 4 GPIO_ACTIVE_HIGH>;
|
|
col-drive-inactive;
|
|
idle-mode = "poll";
|
|
};
|
|
|
|
kbd-matrix-2 {
|
|
compatible = "gpio-kbd-matrix";
|
|
row-gpios = <&test_gpio 0 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>,
|
|
<&test_gpio 1 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>,
|
|
<&test_gpio 2 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>;
|
|
col-gpios = <&test_gpio 3 GPIO_ACTIVE_HIGH>,
|
|
<&test_gpio 4 GPIO_ACTIVE_HIGH>;
|
|
poll-timeout-ms = <0>;
|
|
idle-mode = "scan";
|
|
};
|
|
|
|
qdec-gpio {
|
|
compatible = "gpio-qdec";
|
|
gpios = <&test_gpio 0 0>, <&test_gpio 1 0>;
|
|
steps-per-period = <4>;
|
|
zephyr,axis = <0>;
|
|
sample-time-us = <2000>;
|
|
idle-timeout-ms = <200>;
|
|
};
|
|
|
|
longpress: longpress {
|
|
input = <&longpress>;
|
|
compatible = "zephyr,input-longpress";
|
|
input-codes = <0>;
|
|
short-codes = <0>;
|
|
long-codes = <0>;
|
|
long-delay-ms = <100>;
|
|
};
|
|
|
|
i2c@1 {
|
|
#address-cells = <1>;
|
|
#size-cells = <0>;
|
|
compatible = "vnd,i2c";
|
|
reg = <0x1 0x1000>;
|
|
status = "okay";
|
|
clock-frequency = <100000>;
|
|
|
|
ft5336@0 {
|
|
compatible = "focaltech,ft5336";
|
|
reg = <0x0>;
|
|
int-gpios = <&test_gpio 0 0>;
|
|
};
|
|
|
|
gt911@1 {
|
|
compatible = "goodix,gt911";
|
|
reg = <0x1>;
|
|
irq-gpios = <&test_gpio 0 0>;
|
|
reset-gpios = <&test_gpio 1 0>;
|
|
};
|
|
|
|
cst816s@2 {
|
|
compatible = "hynitron,cst816s";
|
|
reg = <0x2>;
|
|
irq-gpios = <&test_gpio 0 0>;
|
|
rst-gpios = <&test_gpio 1 0>;
|
|
};
|
|
|
|
cap1203@3 {
|
|
compatible = "microchip,cap1203";
|
|
reg = <0x3>;
|
|
int-gpios = <&test_gpio 0 0>;
|
|
input-codes = <0 1 2>;
|
|
};
|
|
|
|
stmpe811@4 {
|
|
compatible = "st,stmpe811";
|
|
reg = <0x4>;
|
|
int-gpios = <&test_gpio 0 0>;
|
|
panel-driver-settling-time-us = <10>;
|
|
touch-detect-delay-us = <10>;
|
|
touch-average-control = <1>;
|
|
tracking-index = <0>;
|
|
};
|
|
};
|
|
|
|
spi@2 {
|
|
#address-cells = <1>;
|
|
#size-cells = <0>;
|
|
compatible = "vnd,spi";
|
|
reg = <0x2 0x1000>;
|
|
status = "okay";
|
|
clock-frequency = <2000000>;
|
|
|
|
/* one entry for every devices */
|
|
cs-gpios = <&test_gpio 0 0>;
|
|
|
|
xpt2046@0 {
|
|
compatible = "xptek,xpt2046";
|
|
spi-max-frequency = <0>;
|
|
reg = <0x0>;
|
|
int-gpios = <&test_gpio 0 0>;
|
|
touchscreen-size-x = <10>;
|
|
touchscreen-size-y = <10>;
|
|
min-x = <0>;
|
|
min-y = <0>;
|
|
max-x = <1>;
|
|
max-y = <1>;
|
|
};
|
|
};
|
|
};
|
|
};
|