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

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

 



Hi!

> 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 :-).

See sysfs-class-led and sysfs-class-led-trigger-oneshot.

We definitely want this documented. We probably want this for most
triggers, maybe it should get one implementation in library somewhere?

Otherwise it makes sense.

> +static ssize_t do_invert_store(enum led_audio type,
> +			       const char *buf, size_t size)
> +{
> +	unsigned long state;
> +	int ret;
> +
> +	ret = kstrtoul(buf, 0, &state);
> +	if (ret)
> +		return ret;
> +
> +	led_invert[type] = !!state;
> +	ledtrig_audio_set(type, audio_state[type]);

Accepting 42 as valid value sounds wrong. Anyway, this should do what
oneshot trigger does.

Best regards,
								Pavel
-- 
http://www.livejournal.com/~pavelmachek

Attachment: signature.asc
Description: PGP 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