From 90ecc4a20c4ed533e2ff3c61c9d611e41427f5c2 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Sat, 28 Dec 2024 13:52:01 +0100 Subject: [PATCH] raspberry-pi.4.leds.{eth,pwr}: fix target rename --- raspberry-pi/4/leds.nix | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/raspberry-pi/4/leds.nix b/raspberry-pi/4/leds.nix index 279a71b..5f58fa2 100644 --- a/raspberry-pi/4/leds.nix +++ b/raspberry-pi/4/leds.nix @@ -71,13 +71,16 @@ in { name = "disable-act-led"; filter = "*rpi-4-b*"; - dtsText = '' + dtsText = let + kernelVersion = lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.2"; + target = if kernelVersion then "<&led_act>" else "<&act_led>"; + in '' /dts-v1/; /plugin/; /{ compatible = "raspberrypi,4-model-b"; fragment@0 { - target = <&act_led>; + target = ${target}; __overlay__ { gpios = <&gpio 42 0>; /* first two values copied from bcm2711-rpi-4-b.dts */ linux,default-trigger = "none"; @@ -98,13 +101,16 @@ in { name = "disable-pwr-led"; filter = "*rpi-4-b*"; - dtsText = '' + dtsText = let + kernelVersion = lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.2"; + target = if kernelVersion then "<&led_pwr>" else "<&pwr_led>"; + in '' /dts-v1/; /plugin/; /{ compatible = "raspberrypi,4-model-b"; fragment@0 { - target = <&pwr_led>; + target = ${target}; __overlay__ { gpios = <&expgpio 2 0>; /* first two values copied from bcm2711-rpi-4-b.dts */ linux,default-trigger = "default-on";