From f7f913ab14872d42f3a44fb896561cef6583cdc9 Mon Sep 17 00:00:00 2001 From: Ken Date: Fri, 10 Nov 2023 14:38:43 +0800 Subject: [PATCH] ipq50xx: CIG-WF-186W - LEDs are not configurable Signed-off-by: Ken --- .../boot/dts/qcom/qcom-ipq5018-cig-wf186h.dts | 54 ++++++++++++++++--- .../boot/dts/qcom/qcom-ipq5018-cig-wf186w.dts | 54 ++++++++++++++++--- 2 files changed, 96 insertions(+), 12 deletions(-) diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-cig-wf186h.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-cig-wf186h.dts index 5fb9e3469..7a7ead613 100644 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-cig-wf186h.dts +++ b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-cig-wf186h.dts @@ -29,6 +29,10 @@ serial1 = &blsp1_uart2; ethernet0 = "/soc/dp1"; ethernet1 = "/soc/dp2"; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; }; chosen { @@ -682,6 +686,27 @@ }; }; + leds_pins: leds_pins { + led_pwr_g { + pins = "gpio0"; + function = "gpio"; + drive-strength = <8>; + bias-pull-down; + }; + led_pwr_b { + pins = "gpio1"; + function = "gpio"; + drive-strength = <8>; + bias-pull-down; + }; + led_pwr_r { + pins = "gpio46"; + function = "gpio"; + drive-strength = <8>; + bias-pull-down; + }; + }; + i2c_pins: i2c_pins { i2c_scl { pins = "gpio25"; @@ -758,14 +783,31 @@ }; &soc { + leds { + compatible = "gpio-leds"; + pinctrl-0 = <&leds_pins>; + pinctrl-names = "default"; - pwm: pwm@0x1941010 { - pinctrl-0 = <&pwm_pins>; - pinctrl-names = "default"; - used-pwm-indices = <1>, <1>, <1>, <1>; - dft-pwm-status = <1>, <0>, <0>, <0>; - status = "ok"; + led3 { + label = "blue:status"; + gpios = <&tlmm 1 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "blue-on"; + default-state = "off"; + }; + led2 { + label = "red:status"; + gpios = <&tlmm 45 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "red-on"; + default-state = "off"; + }; + led_power: led1 { + label = "green:status"; + gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "default-on"; + default-state = "on"; + }; }; + }; &usb3 { diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-cig-wf186w.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-cig-wf186w.dts index f75b71370..522a7bcb1 100755 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-cig-wf186w.dts +++ b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-cig-wf186w.dts @@ -29,6 +29,10 @@ serial1 = &blsp1_uart2; ethernet0 = "/soc/dp1"; ethernet1 = "/soc/dp2"; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; }; chosen { @@ -682,6 +686,27 @@ }; }; + leds_pins: leds_pins { + led_pwr_g { + pins = "gpio0"; + function = "gpio"; + drive-strength = <8>; + bias-pull-down; + }; + led_pwr_b { + pins = "gpio1"; + function = "gpio"; + drive-strength = <8>; + bias-pull-down; + }; + led_pwr_r { + pins = "gpio46"; + function = "gpio"; + drive-strength = <8>; + bias-pull-down; + }; + }; + i2c_pins: i2c_pins { i2c_scl { pins = "gpio25"; @@ -758,14 +783,31 @@ }; &soc { + leds { + compatible = "gpio-leds"; + pinctrl-0 = <&leds_pins>; + pinctrl-names = "default"; - pwm: pwm@0x1941010 { - pinctrl-0 = <&pwm_pins>; - pinctrl-names = "default"; - used-pwm-indices = <1>, <1>, <1>, <1>; - dft-pwm-status = <1>, <0>, <0>, <0>; - status = "ok"; + led3 { + label = "blue:status"; + gpios = <&tlmm 1 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "blue-on"; + default-state = "off"; + }; + led2 { + label = "red:status"; + gpios = <&tlmm 45 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "red-on"; + default-state = "off"; + }; + led_power: led1 { + label = "green:status"; + gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "default-on"; + default-state = "on"; + }; }; + }; &usb3 {