On 05/04/2015 02:12 PM, Stas Sergeev wrote:But led_trigger_set() does led_stop_software_blink(), which
Only under that condition:set_brightness_work not only sets the brightness but also
---
if (led_cdev->blink_delay_on || led_cdev->blink_delay_off) {
led_cdev->delayed_set_value = brightness;
schedule_work(&led_cdev->set_brightness_work);
---
But the main condition is:
---
if (led_cdev->flags & SET_BRIGHTNESS_ASYNC) {
led_set_brightness_async(led_cdev, brightness);
---
So I think it is actually unused.
I don't see why schedule_work() above can't be just replaced
with led_set_brightness_async(). Is there the reason not to do so?
stops software blinking, which was the primary reason
for adding this work queue I think. Here is the commit message:
------------------------Instead of disabling the soft-blink beforehand, which is what led_trigger_set()
leds: delay led_set_brightness if stopping soft-blink
Delay execution of led_set_brightness() if need to stop soft-blink
timer.
This allows led_set_brightness to be called in hard-irq context even if soft-blink was activated on that LED.
> Now your leds-aat1290 already asks for such a change,OK, I googled the patch:
because it can sleep but does not use a work-queue theIt doesn't need this change - it defines two ops: brightness_set
way other drivers do.
(the async one) and brightness_set_sync (the sync one). The
former is called from led_set_brightness_async and the latter
form led_set_brightness_sync.
led_set_brightness_async is called from led_set_brightness
for drivers that define SET_BRIGHTNESS_ASYNC flag and
led_set_brightness_sync for the drivers that define
SET_BRIGHTNESS_SYNC flags.
led_timer_function calls always led_set_brightness_async.
As long as all drivers use the work-queue when needed andSo what should we do?It would have to be done for the LED core and all drivers
I can try the aforementioned massive clean-up with removing
the work-queue from every driver and using the one in
led-core, but my attempts have few chances to succeed
because of no test-cases. Or can you do this instead, so
that leds-aat1290 driver is in line with the others? Or any
other options I can try?
in one patch set. We would have to get acks from all LED drivers'
authors (or at least from majority of them).
Once this is done we could think about adding optional hr timers
based triggers and invite people for testing.