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

Jaroslav Kysela perex at perex.cz
Sun Feb 14 19:51:39 CET 2021


Dne 14. 02. 21 v 7:43 Perry Yuan napsal(a):

>>> @@ -287,6 +291,18 @@ static int rt715_sdca_put_volsw(struct snd_kcontrol *kcontrol,
>>>   			return err;
>>>   	}
>>>   
>>> +#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
>>> +

My question is, how do we know that the rt715 codec has connected internal
microphone to this input? I believe that this should be covered in the machine
specific code (runtime check), not in the codec code. #if CONFIG is not
sufficient here.

> I have moved this part code to the local definition of 
> rt715_set_amp_gain_put and removed from rt715_priv.
> new code will be like this in V4.
> 
> @@ -88,6 +89,7 @@ static int rt715_set_amp_gain_put(struct snd_kcontrol 
> *kcontrol,
>                  RT715_SET_GAIN_MIX_ADC2_L};
>          unsigned int addr_h, addr_l, val_h, val_ll, val_lr;
>          unsigned int read_ll, read_rl, i, j, loop_cnt;
> +       bool micmute_led;
> 

The whole LED trigger mechanism for the sound is covered in my LED generic
code : https://lore.kernel.org/alsa-devel/20210211111400.1131020-1-perex@perex.cz/

						Jaroslav

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


More information about the Alsa-devel mailing list