Re: [PATCH] leds: trigger: Add invert attribute to ledtrig-audio

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

 



Hi!

> 
> On Mon, Aug 09, 2021 at 08:11:18PM +0200, Pavel Machek wrote:
> > > Inverting micmute LED used to be possible via a mixer setting, but
> > > conversion to LEDs class (probably) killed it. Re-establish the old
> > > functionality via sysfs attribute in audio LED triggers.
> > 
> > So we have both invert and inverted attributes. Fun :-).
> 
> Hmm! :)
> 
> Are you talking about LED_BLINK_INVERT flag? I see a few triggers allow
> inversion but didn't find LED drivers exporting such a property.
> 
> > See sysfs-class-led and sysfs-class-led-trigger-oneshot.
> 
> I think I "copied" from oneshot trigger when writing this patch.
> 
> > We definitely want this documented. We probably want this for most
> > triggers, maybe it should get one implementation in library somewhere?
> 
> Should this be an implicit attribute of simple triggers only or all? In
> the latter case (which could simplify some triggers) I guess the value
> inversion has to take place in led_set_brightness_nopm(), the lowest
> level function triggers may use.

Actual inversion is trivial (so it may not make sense to share), but
sysfs interface is not. Sharing that would be good.

> How does inversion work, actually? LED_OFF <-> LED_ON is trivial, but
> what about LED_HALF and LED_FULL? Leaving LED_HALF as-is seems logical,
> but the opposite of LED_OFF might be LED_ON or LED_FULL. Does
> max_brightness determine that?

max_brightness determines that, and it would be simply

if (->inverted)
   b = ->max_brighntess-b;
   
Best regards,
								Pavel
-- 
http://www.livejournal.com/~pavelmachek

Attachment: signature.asc
Description: Digital signature


[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