]> www.infradead.org Git - linux.git/commit
power: supply: leds: Add activate() callback to triggers
authorHans de Goede <hdegoede@redhat.com>
Fri, 31 May 2024 13:47:02 +0000 (15:47 +0200)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Sun, 2 Jun 2024 23:29:43 +0000 (01:29 +0200)
commit8179b068d5cb182a2c61f2f8365837a37f140feb
tree0445e47c0a45f972379772a25876e1bd5ec01856
parent6c951a84dab9c0e051aec54d7497f25e910a4953
power: supply: leds: Add activate() callback to triggers

Add an activate() callback to the power-supply LED triggers so that
the LED being activated will properly reflect the current power-supply
state for power-supply devices which are already fully registered
when the trigger gets activated.

This fixes e.g. wrong LED state (1) when the LED gets registered
after the power-supply device.

1) Until the psy driver has a reason to call power_supply_changed()
   which may take quite a while

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/r/20240531134702.166145-4-hdegoede@redhat.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/power_supply_leds.c