Linux LED subsystem development
 help / color / mirror / Atom feed
From: "Marek Behún" <kabel@kernel.org>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Pavel Machek" <pavel@ucw.cz>, "Lee Jones" <lee@kernel.org>,
	linux-leds@vger.kernel.org
Subject: Re: [PATCH] leds: trigger: tty: Fix tty trigger when LED's max_brightness is greater than 1
Date: Wed, 2 Aug 2023 10:37:17 +0200	[thread overview]
Message-ID: <20230802103717.03ed40f6@dellmb> (raw)
In-Reply-To: <20230801142642.21335-1-kabel@kernel.org>

On Tue,  1 Aug 2023 16:26:42 +0200
Marek Behún <kabel@kernel.org> 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@kernel.org>
> ---
> 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()

      reply	other threads:[~2023-08-02  8:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-01 14:26 [PATCH] leds: trigger: tty: Fix tty trigger when LED's max_brightness is greater than 1 Marek Behún
2023-08-02  8:37 ` Marek Behún [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230802103717.03ed40f6@dellmb \
    --to=kabel@kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=u.kleine-koenig@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox