[PATCH v3 3/3] ASoC: rt715:add micmute led state control supports

Jaroslav Kysela perex at perex.cz
Fri Jan 15 18:45:07 CET 2021


Dne 12. 01. 21 v 18:18 Perry Yuan napsal(a):

> +#if IS_ENABLED(CONFIG_DELL_PRIVACY)
> +	/* dell privacy LED trigger state changed by muted/unmute switch */
> +	if (mc->invert) {
> +		if (ucontrol->value.integer.value[0] || ucontrol->value.integer.value[1]) {
> +			rt715->micmute_led = LED_OFF;
> +		} else {
> +			rt715->micmute_led = LED_ON;
> +		}
> +		ledtrig_audio_set(LED_AUDIO_MICMUTE, rt715->micmute_led);
> +	}
> +#endif

[removing lkml and x86-platform lists]

Looking to this code, perhaps, it may be a good idea to move the LED trigger
handling from the low-level drivers and do it in the top-level control code
(sound/core/control.c). Adding a new flag SNDRV_CTL_ELEM_ACCESS_MIC_LED may be
an option and we can nicely handle the situation for multiple microphones (OR
operation). The motivation is to remove the duplicated code.

The same situation is for the playback LED.

					Jaroslav

-- 
Jaroslav Kysela <perex at perex.cz>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.


More information about the Alsa-devel mailing list