From be61e8ba0ad44db98fcb369e49dff896729549b1 Mon Sep 17 00:00:00 2001 From: Tomaz Zaman Date: Wed, 12 Aug 2026 00:59:47 +0200 Subject: [PATCH 38/72] layerscape: status LED policy (green off, white dim) The LP5812 status LED had no policy: board.d/01_led has no mono case, the lp5812 driver ignores DT default-state (parses only reg/color/label/max-current, registers non-_ext, never resets the chip) and its probe leaves U-Boot's lit green. So shipped units sat with green on and no ready indicator. Set the steady state in userspace via a uci-default: status:green off, status:white a dim static (brightness 16) "ready" light, gated on board_name. (DTS default-state would need an lp5812 driver change - queued for the ASK repo.) Co-Authored-By: Claude Opus 4.8 --- .../etc/uci-defaults/11-mono-gateway-leds | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 target/linux/layerscape/base-files/etc/uci-defaults/11-mono-gateway-leds diff --git a/target/linux/layerscape/base-files/etc/uci-defaults/11-mono-gateway-leds b/target/linux/layerscape/base-files/etc/uci-defaults/11-mono-gateway-leds new file mode 100644 index 0000000000..2e80391db7 --- /dev/null +++ b/target/linux/layerscape/base-files/etc/uci-defaults/11-mono-gateway-leds @@ -0,0 +1,35 @@ +#!/bin/sh +# Mono Gateway status LED policy (LP5812 I2C controller). +# +# Done in userspace, not the DTS: the lp5812 driver does not parse +# `default-state` (it reads only reg/color/label/led-max-microamp and registers +# with the non-_ext classdev call), and its probe never resets the chip - so it +# leaves whatever U-Boot set. U-Boot lights status:green during boot; set the +# steady state here instead. Runs once (uci-defaults self-deletes); the `led` +# service then re-applies /etc/config/system on every boot. +# +# Scheme: green off, white a dim static "ready" light. Adjust to taste. +. /lib/functions.sh + +case "$(board_name)" in +mono,gateway-dk|mono,gateway-dk-sdboot) ;; +*) exit 0 ;; +esac + +uci -q batch <<'EOF' +set system.led_status_green=led +set system.led_status_green.name='Status Green' +set system.led_status_green.sysfs='status:green' +set system.led_status_green.trigger='none' +set system.led_status_green.default='0' + +set system.led_status_white=led +set system.led_status_white.name='Status White' +set system.led_status_white.sysfs='status:white' +set system.led_status_white.trigger='none' +set system.led_status_white.default='1' +set system.led_status_white.brightness='16' +EOF +uci commit system + +exit 0 -- 2.47.3