Re: [PATCH] leds: trigger: tty: Fix tty trigger when LED's max_brightness is greater than 1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue,  1 Aug 2023 16:26:42 +0200
Marek Behún <kabel@xxxxxxxxxx> wrote:

> The tty LED trigger uses the obsolete LED_ON & LED_OFF constants when
> setting LED brightness. This is bad because the LED_ON constant is equal
> to 1, and so when activating the tty LED trigger on a LED class device
> with max_brightness greater than 1, the LED is dimmer than it can be
> (when max_brightness is 255, the LED is very dimm indeed; some devices
> translate 1/255 to 0, so the LED is OFF all the time).
> 
> Use a mechanism similar to the netdev trigger, wherein on activation
> time, the current LED brightness is taken as blinking brightness, and if
> it is zero, the max_brightness is taken instead.
> 
> Fixes: fd4a641ac88f ("leds: trigger: implement a tty trigger")
> Signed-off-by: Marek Behún <kabel@xxxxxxxxxx>
> ---
> PS: We need to get rid of the LED_ON, LED_OFF, LED_FULL and LED_HALF or
>     we're bound to repeat this kind of issues.

Ignore this, even better fix coming utilizing led_blink_set_oneshot()




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux