[PATCH 0/2] power: supply: leds: add triggers for non battery type
From: Steffen Dirkwinkel
Date: Thu Jun 25 2026 - 13:11:24 EST
We want to use the power supply leds to show a different led color based
on ups charging / non-charging state. For this we add support for led
triggers for non "battery" supplies and a "not-charging" trigger.
This is roughly how it would be used with a device tree power ups supply
to have a violet led on power failure and green on power ok:
ups {
compatible = "gpio-charger";
charger-type = "ups";
charge-status-gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
};
leds {
compatible = "gpio-leds";
pwr-red {
gpios = <&gpio 27 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "ups-not-charging";
};
pwr-green {
gpios = <&gpio 28 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "ups-charging";
};
pwr-blue {
gpios = <&gpio 34 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "ups-not-charging";
};
};
Signed-off-by: Steffen Dirkwinkel <s.dirkwinkel@xxxxxxxxxxxx>
---
Steffen Dirkwinkel (2):
power: supply: leds: create triggers based on properties, not type
power: supply: leds: add a not-charging trigger
drivers/power/supply/power_supply_leds.c | 93 +++++++++++++++++---------------
include/linux/power_supply.h | 4 +-
2 files changed, 52 insertions(+), 45 deletions(-)
---
base-commit: ab9de95c9cf952332ab79453b4b5d1bfca8e514f
change-id: 20260625-std-power-supply-triggers-0f4504fcbe37
Best regards,
--
Steffen Dirkwinkel <s.dirkwinkel@xxxxxxxxxxxx>