/dts-v1/; /plugin/; #include #include #include #include #include / { fragment@0 { target = <&can0>; __overlay__ { status = "disabled"; assigned-clocks = <&cru CLK_CAN0>; assigned-clock-rates = <200000000>; pinctrl-names = "default"; pinctrl-0 = <&can0m0_pins>; }; }; fragment@1 { 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_xl9535>; interrupt-parent = <&gpio0>; interrupts = ; interrupt-controller; #interrupt-cells = <2>; }; }; }; fragment@2 { 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_gpio7>; interrupt-parent = <&gpio2>; interrupts = ; interrupt-controller; #interrupt-cells = <2>; }; }; }; fragment@3 { 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 = ; interrupt-controller; #interrupt-cells = <2>; }; }; }; fragment@4 { 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@5 { 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=; gpio-hog; gpios = <&xl9535 3 GPIO_ACTIVE_LOW>; interrupt-parent = <&xl9535>; interrupts = <3 IRQ_TYPE_LEVEL_LOW>; }; Key1 { label = "KEY_1"; linux,code=; gpio-hog; gpios = <&xl9535 4 GPIO_ACTIVE_LOW>; interrupt-parent = <&xl9535>; interrupts = <4 IRQ_TYPE_LEVEL_LOW>; }; Key2 { label = "KEY_2"; linux,code=; 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=; 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@6 { 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@6 { target = <&pinctrl>; __overlay__ { xl9535 { pinctrl_xl9535:pinctrl_xl9535 { rockchip,pins = <0 RK_PC0 RK_FUNC_GPIO &pcfg_pull_up>; }; }; 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>; }; }; }; }; };