arm64: dts: rockchip: Add ir receiver and leds to Khadas Edge 2
authorMuhammed Efe Cetin <efectn@protonmail.com>
Mon, 19 Feb 2024 22:34:21 +0000 (01:34 +0300)
committerHeiko Stuebner <heiko@sntech.de>
Wed, 10 Apr 2024 07:45:34 +0000 (09:45 +0200)
Khadas Edge 2 exposes IR receiver pins as same as TF card via EXTIO. The
IR receiver is connected to MCU and SoC.

The board also has 2 PWM RGB leds. One is controlled by MCU and the
other is controlled by SoC. This commit adds support for the led
controlled by SoC using pwm-leds.

Signed-off-by: Muhammed Efe Cetin <efectn@protonmail.com>
Link: https://lore.kernel.org/r/335629f57e593e20418a4a55a1e662505640cbde.1708381247.git.efectn@protonmail.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
arch/arm64/boot/dts/rockchip/rk3588s-khadas-edge2.dts

index 1f75ec7..8f012ce 100644 (file)
@@ -4,6 +4,7 @@
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/pinctrl/rockchip.h>
+#include <dt-bindings/leds/common.h>
 #include "rk3588s.dtsi"
 
 / {
                stdout-path = "serial2:1500000n8";
        };
 
+       ir-receiver {
+               compatible = "gpio-ir-receiver";
+               gpios = <&gpio1 RK_PA7 GPIO_ACTIVE_LOW>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&ir_receiver_pin>;
+       };
+
+       leds {
+               compatible = "pwm-leds";
+
+               red_led: led-0 {
+                       label = "red_led";
+                       color = <LED_COLOR_ID_RED>;
+                       default-state = "off";
+                       function = LED_FUNCTION_INDICATOR;
+                       linux,default-trigger = "none";
+                       max-brightness = <255>;
+                       pwms = <&pwm11 0 25000 0>;
+               };
+
+               green_led: led-1 {
+                       label = "green_led";
+                       color = <LED_COLOR_ID_GREEN>;
+                       default-state = "on";
+                       function = LED_FUNCTION_POWER;
+                       linux,default-trigger = "default-on";
+                       max-brightness = <255>;
+                       pwms = <&pwm14 0 25000 0>;
+               };
+
+               blue_led: led-2 {
+                       label = "blue_led";
+                       color = <LED_COLOR_ID_BLUE>;
+                       default-state = "off";
+                       function = LED_FUNCTION_INDICATOR;
+                       linux,default-trigger = "none";
+                       max-brightness = <255>;
+                       pwms = <&pwm15 0 25000 0>;
+               };
+       };
+
        vcc3v3_pcie_wl: vcc3v3-pcie-wl-regulator {
                compatible = "regulator-fixed";
                enable-active-high;
                        rockchip,pins = <1 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>;
                };
        };
+
+       ir-receiver {
+               ir_receiver_pin: ir-receiver-pin {
+                       rockchip,pins = <1  RK_PA7  RK_FUNC_GPIO  &pcfg_pull_none>;
+               };
+       };
 };
 
 &pcie2x1l2 {
        status = "okay";
 };
 
+&pwm11 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pwm11m1_pins>;
+       status = "okay";
+};
+
+&pwm14 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pwm14m1_pins>;
+       status = "okay";
+};
+
+&pwm15 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pwm15m1_pins>;
+       status = "okay";
+};
+
 &sdhci {
        bus-width = <8>;
        no-sdio;