diff mbox series

[v3,2/4] riscv: dts: starfive: enable heartbeat LED for Milk-V Mars

Message ID 20240627115236.618-2-naoki@milkv.io (mailing list archive)
State Changes Requested, archived
Headers show
Series [v3,1/4] riscv: defconfig: enable "heartbeat" led trigger | expand

Checks

Context Check Description
conchuod/vmtest-fixes-PR success PR summary
conchuod/patch-2-test-1 success .github/scripts/patches/tests/build_rv32_defconfig.sh
conchuod/patch-2-test-2 success .github/scripts/patches/tests/build_rv64_clang_allmodconfig.sh
conchuod/patch-2-test-3 success .github/scripts/patches/tests/build_rv64_gcc_allmodconfig.sh
conchuod/patch-2-test-4 success .github/scripts/patches/tests/build_rv64_nommu_k210_defconfig.sh
conchuod/patch-2-test-5 success .github/scripts/patches/tests/build_rv64_nommu_virt_defconfig.sh
conchuod/patch-2-test-6 success .github/scripts/patches/tests/checkpatch.sh
conchuod/patch-2-test-7 success .github/scripts/patches/tests/dtb_warn_rv64.sh
conchuod/patch-2-test-8 success .github/scripts/patches/tests/header_inline.sh
conchuod/patch-2-test-9 success .github/scripts/patches/tests/kdoc.sh
conchuod/patch-2-test-10 success .github/scripts/patches/tests/module_param.sh
conchuod/patch-2-test-11 success .github/scripts/patches/tests/verify_fixes.sh
conchuod/patch-2-test-12 success .github/scripts/patches/tests/verify_signedoff.sh

Commit Message

FUKAUMI Naoki June 27, 2024, 11:52 a.m. UTC
Milk-V Mars has a green LED to show system load[1]. This patch enables
a green LED as a heartbeat LED.

Signed-off-by: FUKAUMI Naoki <naoki@milkv.io>

[1] https://github.com/milkv-mars/mars-buildroot-sdk/blob/dev/linux/arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dtsi#L79

Changes in v3:
- add default-state = "on" to turn LED on at U-Boot (not enabled yet)
Changes in v2:
- reorder properties in led-0
---
 arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

Comments

Emil Renner Berthing July 1, 2024, 12:28 p.m. UTC | #1
FUKAUMI Naoki wrote:
> Milk-V Mars has a green LED to show system load[1]. This patch enables
> a green LED as a heartbeat LED.
>
> Signed-off-by: FUKAUMI Naoki <naoki@milkv.io>
>
> [1] https://github.com/milkv-mars/mars-buildroot-sdk/blob/dev/linux/arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dtsi#L79
>
> Changes in v3:
> - add default-state = "on" to turn LED on at U-Boot (not enabled yet)
> Changes in v2:
> - reorder properties in led-0
> ---
>  arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>
> diff --git a/arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts b/arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts
> index 5cb9e99e1dac..5cae7a5d2f86 100644
> --- a/arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts
> +++ b/arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts
> @@ -4,11 +4,25 @@
>   */
>
>  /dts-v1/;
> +#include <dt-bindings/gpio/gpio.h>
> +#include <dt-bindings/leds/common.h>
>  #include "jh7110-common.dtsi"
>
>  / {
>  	model = "Milk-V Mars";
>  	compatible = "milkv,mars", "starfive,jh7110";
> +
> +	leds {
> +		compatible = "gpio-leds";
> +
> +		led-0 {
> +			gpios = <&aongpio 3 GPIO_ACTIVE_HIGH>;
> +			color = <LED_COLOR_ID_GREEN>;
> +			default-state = "on";
> +			function = LED_FUNCTION_HEARTBEAT;
> +			linux,default-trigger = "heartbeat";
> +		};
> +	};

Hi Naoki

Thanks for adding the other boards too. As mentioned previously [1] boards
should not add functions to LEDs unless the hardware clearly defines a function
for them, and nothing on these boards mention that it should be a heartbeeat.
As you said on IRC userland can easily add whatever function they want.

Also please add a cover letter when you're sending multiple patches.
Eg. use git format-patch --cover-letter

/Emil

[1]: https://lore.kernel.org/linux-riscv/CAJM55Z_j8gWFyKvsiu-oGDV7Hacr4Amt5FdkHdjKnhZwZgxncA@mail.gmail.com/

>  };
>
>  &gmac0 {
> --
> 2.43.0
>
FUKAUMI Naoki July 2, 2024, 2:01 a.m. UTC | #2
Hi

On 7/1/24 21:28, Emil Renner Berthing wrote:
(snip)
> Hi Naoki
> 
> Thanks for adding the other boards too. As mentioned previously [1] boards
> should not add functions to LEDs unless the hardware clearly defines a function
> for them, and nothing on these boards mention that it should be a heartbeeat.
> As you said on IRC userland can easily add whatever function they want.

on behalf of MilkV Technology, what should we do to add function to LED?

I think even if hardware clearly defines a function, you'll say userland 
can easily do it. any objections?

--
FUKAUMI Naoki
Shenzhen MilkV Technology Co., Ltd.

> 
> Also please add a cover letter when you're sending multiple patches.
> Eg. use git format-patch --cover-letter
> 
> /Emil
> 
> [1]: https://lore.kernel.org/linux-riscv/CAJM55Z_j8gWFyKvsiu-oGDV7Hacr4Amt5FdkHdjKnhZwZgxncA@mail.gmail.com/
> 
>>   };
>>
>>   &gmac0 {
>> --
>> 2.43.0
>>
>
diff mbox series

Patch

diff --git a/arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts b/arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts
index 5cb9e99e1dac..5cae7a5d2f86 100644
--- a/arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts
+++ b/arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts
@@ -4,11 +4,25 @@ 
  */
 
 /dts-v1/;
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/leds/common.h>
 #include "jh7110-common.dtsi"
 
 / {
 	model = "Milk-V Mars";
 	compatible = "milkv,mars", "starfive,jh7110";
+
+	leds {
+		compatible = "gpio-leds";
+
+		led-0 {
+			gpios = <&aongpio 3 GPIO_ACTIVE_HIGH>;
+			color = <LED_COLOR_ID_GREEN>;
+			default-state = "on";
+			function = LED_FUNCTION_HEARTBEAT;
+			linux,default-trigger = "heartbeat";
+		};
+	};
 };
 
 &gmac0 {