251 lines
4.9 KiB
Plaintext
251 lines
4.9 KiB
Plaintext
/dts-v1/;
|
|
/plugin/;
|
|
|
|
#include <dt-bindings/gpio/gpio.h>
|
|
#include <dt-bindings/pinctrl/rockchip.h>
|
|
#include <dt-bindings/interrupt-controller/irq.h>
|
|
#include <dt-bindings/input/linux-event-codes.h>
|
|
|
|
/ {
|
|
|
|
fragment@0 {
|
|
target = <&i2c4>;
|
|
|
|
__overlay__ {
|
|
status = "okay";
|
|
#address-cells = <1>;
|
|
#size-cells = <0>;
|
|
pinctrl-names = "default";
|
|
pinctrl-0 = <&i2c4m3_xfer>;
|
|
|
|
xl9535: xl9535@21 {
|
|
compatible = "nxp,pca9535";
|
|
status = "okay";
|
|
reg = <0x21>;
|
|
gpio-controller;
|
|
#gpio-cells = <2>;
|
|
pinctrl-names = "default";
|
|
pinctrl-0 = <&pinctrl_gpio6>;
|
|
interrupt-parent = <&gpio2>;
|
|
interrupts = <RK_PC4 IRQ_TYPE_LEVEL_LOW>;
|
|
interrupt-controller;
|
|
#interrupt-cells = <2>;
|
|
};
|
|
};
|
|
};
|
|
|
|
fragment@1 {
|
|
target = <&i2c5>;
|
|
|
|
__overlay__ {
|
|
status = "okay";
|
|
#address-cells = <1>;
|
|
#size-cells = <0>;
|
|
pinctrl-names = "default";
|
|
pinctrl-0 = <&i2c5m2_xfer>;
|
|
|
|
gpio7: gpio-expander@21 {
|
|
compatible = "nxp,pca9535";
|
|
status = "okay";
|
|
reg = <0x21>;
|
|
gpio-controller;
|
|
#gpio-cells = <2>;
|
|
// pinctrl-names = "default";
|
|
// pinctrl-0 = <&pinctrl_gpio6>;
|
|
// interrupt-parent = <&gpio2>;
|
|
// interrupts = <RK_PC4 IRQ_TYPE_LEVEL_HIGH>;
|
|
// interrupt-controller;
|
|
// #interrupt-cells = <2>;
|
|
};
|
|
};
|
|
};
|
|
|
|
fragment@2 {
|
|
target = <&i2c6>;
|
|
|
|
__overlay__ {
|
|
status = "okay";
|
|
#address-cells = <1>;
|
|
#size-cells = <0>;
|
|
pinctrl-names = "default";
|
|
pinctrl-0 = <&i2c6m0_xfer>;
|
|
|
|
gpio8: gpio-expander@21 {
|
|
compatible = "nxp,pca9535";
|
|
status = "okay";
|
|
reg = <0x21>;
|
|
gpio-controller;
|
|
#gpio-cells = <2>;
|
|
pinctrl-names = "default";
|
|
pinctrl-0 = <&pinctrl_gpio8>;
|
|
interrupt-parent = <&gpio2>;
|
|
interrupts = <RK_PC5 IRQ_TYPE_LEVEL_LOW>;
|
|
interrupt-controller;
|
|
#interrupt-cells = <2>;
|
|
};
|
|
};
|
|
};
|
|
|
|
fragment@3 {
|
|
target-path = "/";
|
|
|
|
__overlay__ {
|
|
leds: leds {
|
|
status = "okay";
|
|
compatible = "gpio-leds";
|
|
|
|
abc_led: abc-led {
|
|
label = "abc_led";
|
|
linux,default-trigger = "heartbeat";
|
|
default-state = "on";
|
|
gpios = <&gpio7 0 GPIO_ACTIVE_HIGH>;
|
|
};
|
|
|
|
def_led: def-led {
|
|
label = "def_led";
|
|
linux,default-trigger = "heartbeat";
|
|
default-state = "on";
|
|
gpios = <&gpio8 2 GPIO_ACTIVE_HIGH>;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
fragment@4 {
|
|
target-path = "/";
|
|
|
|
__overlay__ {
|
|
Keys {
|
|
compatible = "gpio-keys";
|
|
pinctrl-names = "default";
|
|
#address-cells = <1>;
|
|
#size-cells = <0>;
|
|
status = "okay";
|
|
//autorepeat;
|
|
Key0 {
|
|
label = "KEY_0";
|
|
linux,code=<KEY_0>;
|
|
gpio-hog;
|
|
gpios = <&xl9535 3 GPIO_ACTIVE_LOW>;
|
|
interrupt-parent = <&xl9535>;
|
|
interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
|
|
};
|
|
|
|
Key1 {
|
|
label = "KEY_1";
|
|
linux,code=<KEY_1>;
|
|
gpio-hog;
|
|
gpios = <&xl9535 4 GPIO_ACTIVE_LOW>;
|
|
interrupt-parent = <&xl9535>;
|
|
interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
|
|
};
|
|
|
|
Key2 {
|
|
label = "KEY_2";
|
|
linux,code=<KEY_2>;
|
|
gpio-hog;
|
|
gpios = <&xl9535 5 GPIO_ACTIVE_LOW>;
|
|
interrupt-parent = <&xl9535>;
|
|
interrupts = <5 IRQ_TYPE_LEVEL_LOW>;
|
|
};
|
|
};
|
|
|
|
Coder_sw {
|
|
compatible = "gpio-keys";
|
|
status = "okay";
|
|
#address-cells = <1>;
|
|
#size-cells = <0>;
|
|
coder_sw {
|
|
label = "coder_sw";
|
|
linux,code=<KEY_3>;
|
|
debounce-interval = <5>;
|
|
gpios = <&xl9535 7 GPIO_ACTIVE_LOW>;
|
|
interrupt-parent = <&xl9535>;
|
|
interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
|
|
};
|
|
};
|
|
|
|
Coder_A {
|
|
compatible = "gpio-keys";
|
|
status = "okay";
|
|
#address-cells = <1>;
|
|
#size-cells = <0>;
|
|
coder_A {
|
|
label = "coder_A";
|
|
linux,code=<250>;
|
|
debounce-interval = <1>;
|
|
gpios = <&xl9535 12 GPIO_ACTIVE_HIGH>;
|
|
interrupt-parent = <&xl9535>;
|
|
interrupts = <12 IRQ_TYPE_EDGE_RISING>;
|
|
};
|
|
};
|
|
|
|
Coder_B {
|
|
compatible = "gpio-keys";
|
|
status = "okay";
|
|
#address-cells = <1>;
|
|
#size-cells = <0>;
|
|
coder_B {
|
|
label = "coder_B";
|
|
linux,code=<251>;
|
|
debounce-interval = <1>;
|
|
gpios = <&xl9535 13 GPIO_ACTIVE_HIGH>;
|
|
interrupt-parent = <&xl9535>;
|
|
interrupts = <13 IRQ_TYPE_EDGE_RISING>;
|
|
};
|
|
};
|
|
|
|
Coder_C {
|
|
compatible = "gpio-keys";
|
|
status = "okay";
|
|
#address-cells = <1>;
|
|
#size-cells = <0>;
|
|
coder_C {
|
|
label = "coder_C";
|
|
linux,code=<252>;
|
|
debounce-interval = <1>;
|
|
gpios = <&xl9535 14 GPIO_ACTIVE_HIGH>;
|
|
interrupt-parent = <&xl9535>;
|
|
interrupts = <14 IRQ_TYPE_EDGE_RISING>;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
/*
|
|
fragment@5 {
|
|
target-path = "/";
|
|
__overlay__ {
|
|
dht11{
|
|
#address-cells = <1>;
|
|
#size-cells = <1>;
|
|
compatible = "fire,temphum_dht11";
|
|
linux,open-drain;
|
|
dht11_pin = <&gpio8 1 GPIO_ACTIVE_HIGH>;
|
|
status = "okay";
|
|
};
|
|
};
|
|
};
|
|
*/
|
|
|
|
fragment@5 {
|
|
target = <&pinctrl>;
|
|
|
|
__overlay__ {
|
|
gpio7 {
|
|
pinctrl_gpio7:pinctrl_gpio7 {
|
|
rockchip,pins =
|
|
<2 RK_PC4 RK_FUNC_GPIO &pcfg_pull_up>;
|
|
};
|
|
};
|
|
|
|
gpio8 {
|
|
pinctrl_gpio8:pinctrl_gpio8 {
|
|
rockchip,pins =
|
|
<2 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|