From 4db54ce3d97cd6b487a1fed1618bc979711f4ca6 Mon Sep 17 00:00:00 2001 From: Ken Date: Wed, 6 Dec 2023 13:31:32 +0800 Subject: [PATCH] ipq50xx: CIG-WF-186W - LEDs are not configurable Signed-off-by: Ken --- .../boot/dts/qcom/qcom-ipq5018-cig-wf186h.dts | 2 +- .../boot/dts/qcom/qcom-ipq5018-cig-wf186w.dts | 2 +- .../boot/dts/qcom/qcom-ipq5018-cig-wf186h.dts | 57 ++++++++++++++++--- .../boot/dts/qcom/qcom-ipq5018-cig-wf186w.dts | 57 ++++++++++++++++--- 4 files changed, 100 insertions(+), 18 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 7a7ead613..a5751eb40 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 @@ -700,7 +700,7 @@ bias-pull-down; }; led_pwr_r { - pins = "gpio46"; + pins = "gpio45"; function = "gpio"; drive-strength = <8>; bias-pull-down; 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 522a7bcb1..96b7b80de 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 @@ -700,7 +700,7 @@ bias-pull-down; }; led_pwr_r { - pins = "gpio46"; + pins = "gpio45"; function = "gpio"; drive-strength = <8>; bias-pull-down; diff --git a/feeds/ipq807x_v5.4/ipq50xx/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-cig-wf186h.dts b/feeds/ipq807x_v5.4/ipq50xx/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-cig-wf186h.dts index 0db49f3f5..9c9c973d3 100755 --- a/feeds/ipq807x_v5.4/ipq50xx/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-cig-wf186h.dts +++ b/feeds/ipq807x_v5.4/ipq50xx/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-cig-wf186h.dts @@ -31,6 +31,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 { @@ -568,15 +572,31 @@ }; &soc { - 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"; - }; -}; + leds { + compatible = "gpio-leds"; + pinctrl-0 = <&leds_pins>; + pinctrl-names = "default"; + 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"; + }; + }; +}; &tlmm { pinctrl-0 = <&blsp0_uart_pins &phy_led_pins>; @@ -680,6 +700,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 = "gpio45"; + function = "gpio"; + drive-strength = <8>; + bias-pull-down; + }; + }; + audio_pins: audio_pinmux { mux_1 { pins = "gpio24"; diff --git a/feeds/ipq807x_v5.4/ipq50xx/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-cig-wf186w.dts b/feeds/ipq807x_v5.4/ipq50xx/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-cig-wf186w.dts index 15605c0ea..eef0a79d1 100755 --- a/feeds/ipq807x_v5.4/ipq50xx/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-cig-wf186w.dts +++ b/feeds/ipq807x_v5.4/ipq50xx/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-cig-wf186w.dts @@ -31,6 +31,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 { @@ -568,15 +572,31 @@ }; &soc { - 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"; - }; -}; + leds { + compatible = "gpio-leds"; + pinctrl-0 = <&leds_pins>; + pinctrl-names = "default"; + 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"; + }; + }; +}; &tlmm { pinctrl-0 = <&blsp0_uart_pins &phy_led_pins>; @@ -680,6 +700,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 = "gpio45"; + function = "gpio"; + drive-strength = <8>; + bias-pull-down; + }; + }; + audio_pins: audio_pinmux { mux_1 { pins = "gpio24";