From: Emil Renner Berthing <emil.renner.berthing@canonical.com> To: linux-kernel@vger.kernel.org Cc: Pavel Machek <pavel@ucw.cz>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Vincent Pelletier <plr.vincent@gmail.com>, Bin Meng <bin.meng@windriver.com>, Aurelien Jarno <aurelien@aurel32.net>, Ron Economos <w6rz@comcast.net>, Qiu Wenbo <qiuwenbo@kylinos.com.cn>, Geert Uytterhoeven <geert@linux-m68k.org>, Stephen L Arnold <nerdboy@gentoo.org>, Jianlong Huang <jianlong.huang@starfivetech.com>, Mark Kettenis <kettenis@openbsd.org>, Sven Schwermer <sven.schwermer@disruptive-technologies.com>, Andy Shevchenko <andy.shevchenko@gmail.com>, David Abdurachmanov <davidlt@rivosinc.com>, linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH v1 4/4] riscv: dts: sifive unmatched: Add PWM controlled LEDs Date: Tue, 5 Jul 2022 23:01:43 +0200 [thread overview] Message-ID: <20220705210143.315151-5-emil.renner.berthing@canonical.com> (raw) In-Reply-To: <20220705210143.315151-1-emil.renner.berthing@canonical.com> This adds the two PWM controlled LEDs to the HiFive Unmatched device tree. D12 is just a regular green diode, but D2 is an RGB diode with 3 PWM inputs controlling the three different colours. Signed-off-by: Emil Renner Berthing <emil.renner.berthing@canonical.com> --- .../boot/dts/sifive/hifive-unmatched-a00.dts | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts b/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts index c4ed9efdff03..beaefe74755a 100644 --- a/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts +++ b/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts @@ -4,6 +4,8 @@ #include "fu740-c000.dtsi" #include <dt-bindings/gpio/gpio.h> #include <dt-bindings/interrupt-controller/irq.h> +#include <dt-bindings/leds/common.h> +#include <dt-bindings/pwm/pwm.h> /* Clock frequency (in Hz) of the PCB crystal for rtcclk */ #define RTCCLK_FREQ 1000000 @@ -44,6 +46,46 @@ gpio-poweroff { compatible = "gpio-poweroff"; gpios = <&gpio 2 GPIO_ACTIVE_LOW>; }; + + led-controller-1 { + compatible = "pwm-leds"; + + led-d12 { + pwms = <&pwm0 0 7812500 PWM_POLARITY_INVERTED>; + active-low; + color = <LED_COLOR_ID_GREEN>; + max-brightness = <255>; + label = "d12"; + }; + }; + + led-controller-2 { + compatible = "pwm-leds-multicolor"; + + multi-led { + color = <LED_COLOR_ID_RGB>; + max-brightness = <255>; + label = "d2"; + + led-red { + pwms = <&pwm0 2 7812500 PWM_POLARITY_INVERTED>; + active-low; + color = <LED_COLOR_ID_RED>; + }; + + led-green { + pwms = <&pwm0 1 7812500 PWM_POLARITY_INVERTED>; + active-low; + color = <LED_COLOR_ID_GREEN>; + }; + + led-blue { + pwms = <&pwm0 3 7812500 PWM_POLARITY_INVERTED>; + active-low; + color = <LED_COLOR_ID_BLUE>; + }; + }; + }; }; &uart0 { -- 2.37.0
WARNING: multiple messages have this Message-ID (diff)
From: Emil Renner Berthing <emil.renner.berthing@canonical.com> To: linux-kernel@vger.kernel.org Cc: Pavel Machek <pavel@ucw.cz>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Vincent Pelletier <plr.vincent@gmail.com>, Bin Meng <bin.meng@windriver.com>, Aurelien Jarno <aurelien@aurel32.net>, Ron Economos <w6rz@comcast.net>, Qiu Wenbo <qiuwenbo@kylinos.com.cn>, Geert Uytterhoeven <geert@linux-m68k.org>, Stephen L Arnold <nerdboy@gentoo.org>, Jianlong Huang <jianlong.huang@starfivetech.com>, Mark Kettenis <kettenis@openbsd.org>, Sven Schwermer <sven.schwermer@disruptive-technologies.com>, Andy Shevchenko <andy.shevchenko@gmail.com>, David Abdurachmanov <davidlt@rivosinc.com>, linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH v1 4/4] riscv: dts: sifive unmatched: Add PWM controlled LEDs Date: Tue, 5 Jul 2022 23:01:43 +0200 [thread overview] Message-ID: <20220705210143.315151-5-emil.renner.berthing@canonical.com> (raw) In-Reply-To: <20220705210143.315151-1-emil.renner.berthing@canonical.com> This adds the two PWM controlled LEDs to the HiFive Unmatched device tree. D12 is just a regular green diode, but D2 is an RGB diode with 3 PWM inputs controlling the three different colours. Signed-off-by: Emil Renner Berthing <emil.renner.berthing@canonical.com> --- .../boot/dts/sifive/hifive-unmatched-a00.dts | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts b/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts index c4ed9efdff03..beaefe74755a 100644 --- a/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts +++ b/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts @@ -4,6 +4,8 @@ #include "fu740-c000.dtsi" #include <dt-bindings/gpio/gpio.h> #include <dt-bindings/interrupt-controller/irq.h> +#include <dt-bindings/leds/common.h> +#include <dt-bindings/pwm/pwm.h> /* Clock frequency (in Hz) of the PCB crystal for rtcclk */ #define RTCCLK_FREQ 1000000 @@ -44,6 +46,46 @@ gpio-poweroff { compatible = "gpio-poweroff"; gpios = <&gpio 2 GPIO_ACTIVE_LOW>; }; + + led-controller-1 { + compatible = "pwm-leds"; + + led-d12 { + pwms = <&pwm0 0 7812500 PWM_POLARITY_INVERTED>; + active-low; + color = <LED_COLOR_ID_GREEN>; + max-brightness = <255>; + label = "d12"; + }; + }; + + led-controller-2 { + compatible = "pwm-leds-multicolor"; + + multi-led { + color = <LED_COLOR_ID_RGB>; + max-brightness = <255>; + label = "d2"; + + led-red { + pwms = <&pwm0 2 7812500 PWM_POLARITY_INVERTED>; + active-low; + color = <LED_COLOR_ID_RED>; + }; + + led-green { + pwms = <&pwm0 1 7812500 PWM_POLARITY_INVERTED>; + active-low; + color = <LED_COLOR_ID_GREEN>; + }; + + led-blue { + pwms = <&pwm0 3 7812500 PWM_POLARITY_INVERTED>; + active-low; + color = <LED_COLOR_ID_BLUE>; + }; + }; + }; }; &uart0 { -- 2.37.0 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2022-07-05 21:02 UTC|newest] Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-07-05 21:01 [PATCH v1 0/4] Add HiFive Unmatched LEDs Emil Renner Berthing 2022-07-05 21:01 ` Emil Renner Berthing 2022-07-05 21:01 ` [PATCH v1 1/4] leds: pwm-multicolor: Don't show -EPROBE_DEFER as errors Emil Renner Berthing 2022-07-05 21:01 ` Emil Renner Berthing 2022-07-06 7:30 ` Geert Uytterhoeven 2022-07-06 7:30 ` Geert Uytterhoeven 2022-07-05 21:01 ` [PATCH v1 2/4] dt-bindings: leds: pwm-multicolor: Add active-low property Emil Renner Berthing 2022-07-05 21:01 ` Emil Renner Berthing 2022-07-06 7:33 ` Geert Uytterhoeven 2022-07-06 7:33 ` Geert Uytterhoeven 2022-07-06 16:13 ` Rob Herring 2022-07-06 16:13 ` Rob Herring 2022-07-05 21:01 ` [PATCH v1 3/4] leds: pwm-multicolor: Support active-low LEDs Emil Renner Berthing 2022-07-05 21:01 ` Emil Renner Berthing 2022-07-06 7:43 ` Geert Uytterhoeven 2022-07-06 7:43 ` Geert Uytterhoeven 2022-07-05 21:01 ` Emil Renner Berthing [this message] 2022-07-05 21:01 ` [PATCH v1 4/4] riscv: dts: sifive unmatched: Add PWM controlled LEDs Emil Renner Berthing 2022-07-06 7:56 ` Geert Uytterhoeven 2022-07-06 7:56 ` Geert Uytterhoeven 2022-07-08 9:21 ` Ron Economos 2022-07-08 9:21 ` Ron Economos 2022-07-17 10:57 ` Pavel Machek 2022-07-17 10:57 ` Pavel Machek 2022-07-17 14:05 ` Emil Renner Berthing 2022-07-17 14:05 ` Emil Renner Berthing 2022-07-17 11:02 ` [PATCH v1 0/4] Add HiFive Unmatched LEDs Pavel Machek 2022-07-17 11:02 ` Pavel Machek 2022-08-11 21:06 ` Palmer Dabbelt 2022-08-11 21:06 ` Palmer Dabbelt
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220705210143.315151-5-emil.renner.berthing@canonical.com \ --to=emil.renner.berthing@canonical.com \ --cc=andy.shevchenko@gmail.com \ --cc=aurelien@aurel32.net \ --cc=bin.meng@windriver.com \ --cc=davidlt@rivosinc.com \ --cc=devicetree@vger.kernel.org \ --cc=geert@linux-m68k.org \ --cc=jianlong.huang@starfivetech.com \ --cc=kettenis@openbsd.org \ --cc=krzysztof.kozlowski+dt@linaro.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-leds@vger.kernel.org \ --cc=linux-riscv@lists.infradead.org \ --cc=nerdboy@gentoo.org \ --cc=palmer@dabbelt.com \ --cc=paul.walmsley@sifive.com \ --cc=pavel@ucw.cz \ --cc=plr.vincent@gmail.com \ --cc=qiuwenbo@kylinos.com.cn \ --cc=robh+dt@kernel.org \ --cc=sven.schwermer@disruptive-technologies.com \ --cc=w6rz@comcast.net \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.