riscv: defconfig: enable "heartbeat" led trigger
Subsystems (3)
PATCH 1/2 riscv: defconfig: enable "heartbeat" led trigger
Milk-V Mars has a green LED for heartbeat. This patch adds and enables related configuration for it.
--- arch/riscv/configs/defconfig | 6 ++++++ 1 file changed, 6 insertions(+)
arch/riscv/configs/defconfig +6 -0
@@ -144,6 +144,7 @@ CONFIG_STMMAC_ETH=m CONFIG_MICREL_PHY=y CONFIG_MICROSEMI_PHY=y CONFIG_CAN_RCAR_CANFD=m +# CONFIG_INPUT_LEDS is not set CONFIG_INPUT_MOUSEDEV=y CONFIG_KEYBOARD_SUN4I_LRADC=m CONFIG_SERIAL_8250=y
@@ -223,6 +224,11 @@ CONFIG_MMC_DW=y CONFIG_MMC_DW_STARFIVE=y CONFIG_MMC_SDHI=y CONFIG_MMC_SUNXI=y +CONFIG_NEW_LEDS=y +CONFIG_LEDS_CLASS=y +CONFIG_LEDS_GPIO=y +CONFIG_LEDS_TRIGGERS=y +CONFIG_LEDS_TRIGGER_HEARTBEAT=y CONFIG_RTC_CLASS=y CONFIG_RTC_DRV_SUN6I=y CONFIG_DMADEVICES=y
Signature · 1 line
2.43.0
PATCH 2/2 riscv: dts: starfive: enable heartbeat LED for Milk-V Mars
Milk-V Mars has a green LED to show system load. This patch enables a green LED as a heartbeat LED.
--- arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts | 13 +++++++++++++ 1 file changed, 13 insertions(+)
arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts +13 -0
@@ -4,11 +4,24 @@ */ /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>; + linux,default-trigger = "heartbeat"; + function = LED_FUNCTION_HEARTBEAT; + }; + }; }; &gmac0 {
Signature · 1 line
2.43.0
Re: [PATCH 2/2] riscv: dts: starfive: enable heartbeat LED for Milk-V Mars
Quoted 22 lines · FUKAUMI Naoki
Milk-V Mars has a green LED to show system load. This patch enables a green LED as a heartbeat LED.
Signed-off-by FUKAUMI Naoki <[email protected]>--- arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts | 13 +++++++++++++ 1 file changed, 13 insertions(+)arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts +2
-0@@ -4,11 +4,24 @@ */ /dts-v1/; +#include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/leds/common.h> #include "jh7110-common.dtsi" / { model = "Milk-V Mars";
arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts line 22
Quoted 10 lines
arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts +9
-0compatible = "milkv,mars", "starfive,jh7110"; + + leds { + compatible = "gpio-leds"; + + led-0 { + gpios = <&aongpio 3 GPIO_ACTIVE_HIGH>; + color = <LED_COLOR_ID_GREEN>; + linux,default-trigger = "heartbeat"; + function = LED_FUNCTION_HEARTBEAT;
Hi Naoki,
Thank you for the patch! I know the JH7100 boards are a bad example but normally we don't assign triggers/functions to LEDs unless they have a clearly marked purpose on the board. Otherwise we'll let userspace assign their function (usually with udev rules).
As far as I can tell this line is marked "STS_PWR" in the schematic, the LED itself is just marked "Green", and the silkscreen doesn't seem to indicate that this LED should be a heartbeat. So I'd prefer just describing the LED and let it be up to users or pre-cooked images to assign the function.
/Emil
Quoted 8 lines
arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts +2
-1+ }; + }; }; &gmac0 { --2.43.0