Thread (20 messages) 20 messages, 3 authors, 2021-03-01

Re: [PATCH RFC leds + net-next 3/7] leds: trigger: add API for HW offloading of triggers

From: Pavel Machek <hidden>
Date: 2021-03-01 10:40:49
Also in: linux-leds

Hi!
If the trigger with given configuration cannot be offloaded, the method
should return -EOPNOTSUPP, in which case the trigger must blink the LED
in SW.

Signed-off-by: Marek Behún <kabel@kernel.org>
+
+If the second argument (enable) to the trigger_offload() method is false, any
+active HW offloading must be deactivated.
Are errors permitted in the "disable" case?
+static inline void led_trigger_offload_stop(struct led_classdev *led_cdev)
+{
+	if (!led_cdev->trigger_offload)
+		return;
+
+	if (led_cdev->offloaded)
+		led_cdev->trigger_offload(led_cdev, false);
+}
Set offloaded to false?

Let me check the rest to decide if this makes sense.

Best regards,
									Pavel

-- 
http://www.livejournal.com/~pavelmachek

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help