[PATCH v4 2/2] ASoC: rt715:add micmute led state control supports
Mark Brown
broonie at kernel.org
Mon Mar 8 18:24:09 CET 2021
On Mon, Mar 01, 2021 at 05:38:34PM +0800, Perry Yuan wrote:
> + /* Micmute LED state changed by muted/unmute switch */
> + if (mc->invert) {
> + if (ucontrol->value.integer.value[0] || ucontrol->value.integer.value[1]) {
> + micmute_led = LED_OFF;
> + } else {
> + micmute_led = LED_ON;
> + }
> + ledtrig_audio_set(LED_AUDIO_MICMUTE, micmute_led);
> + }
These conditionals on inversion seem weird and counterintuitive. If
we're going with this approach it would probably be clearer to define a
custom operation for the affected controls that wraps the standard one
and adds the LED setting rather than keying off invert like this.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20210308/ef76a488/attachment.sig>
More information about the Alsa-devel
mailing list