[PATCH v5 04/12] leds: cros_ec: Implement offloaded() trigger callback

From: Rong Zhang

Date: Thu Aug 20 2026 - 13:38:19 EST


"chromeos-auto" is a private hardware control trigger which always stays
in hardware control. Implement offloaded() callback with its return
value to be always true to reflect this.

Reviewed-by: Thomas Weißschuh <linux@xxxxxxxxxxxxxx>
Acked-by: Ike Panhc <ikepanhc@xxxxxxxxx>
Signed-off-by: Rong Zhang <i@xxxxxxxx>
---
I am aware of a pre-existing bug on probe, i.e., non-idempotent trigger
registration. Since the driver is very platform-specific and the
relevant platforms never have more than one such device, the bug is
never triggered on real devices. Therefore, fixing it is far beyond the
scope of the series.
---
drivers/leds/leds-cros_ec.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/drivers/leds/leds-cros_ec.c b/drivers/leds/leds-cros_ec.c
index 1844d0cd5f52..6db83d015277 100644
--- a/drivers/leds/leds-cros_ec.c
+++ b/drivers/leds/leds-cros_ec.c
@@ -85,12 +85,18 @@ static int cros_ec_led_trigger_activate(struct led_classdev *led_cdev)
return cros_ec_led_send_cmd(priv->cros_ec, &arg);
}

+static bool cros_ec_led_trigger_offloaded(struct led_classdev *led_cdev)
+{
+ return true;
+}
+
static struct led_hw_trigger_type cros_ec_led_trigger_type;

static struct led_trigger cros_ec_led_trigger = {
.name = "chromeos-auto",
.trigger_type = &cros_ec_led_trigger_type,
.activate = cros_ec_led_trigger_activate,
+ .offloaded = cros_ec_led_trigger_offloaded,
};

static int cros_ec_led_brightness_set_blocking(struct led_classdev *led_cdev,

--
2.55.0