[RFC 2/2] ASoC: rt5670: Add LED trigger support

Hans de Goede hdegoede at redhat.com
Tue Feb 23 14:59:17 CET 2021


Hi,

On 2/23/21 2:45 PM, Mark Brown wrote:
> On Mon, Feb 15, 2021 at 03:24:19PM +0100, Hans de Goede wrote:
> 
>> Add support for controlling a speaker and/or microphone mute LED through
>> LED triggers using the new generic LED trigger module.
> 
>> -	SOC_DOUBLE_EXT("DAC1 Playback Switch", SND_SOC_NOPM, 0, 1, 1, 0,
>> +	SOC_DOUBLE_EXT_ACCESS("DAC1 Playback Switch", SND_SOC_NOPM, 0, 1, 1, 0,
>> +			SNDRV_CTL_ELEM_ACCESS_SPK_LED,
>>  			rt5670_dac1_playback_switch_get, rt5670_dac1_playback_switch_put),
> 
>> -	SOC_DOUBLE("ADC Capture Switch", RT5670_STO1_ADC_DIG_VOL,
>> -		RT5670_L_MUTE_SFT, RT5670_R_MUTE_SFT, 1, 1),
>> +	SOC_DOUBLE_ACCESS("ADC Capture Switch", RT5670_STO1_ADC_DIG_VOL,
>> +			  RT5670_L_MUTE_SFT, RT5670_R_MUTE_SFT, 1, 1,
>> +			  SNDRV_CTL_ELEM_ACCESS_MIC_LED),
> 
> Why just these particular controls - what if a system has separate mutes
> for speakers or something?

These are the main volume controls, which are always in the output / input
path independent on if we are outputting to e.g. speakers or the headphones.

We want to use the main volume control for this, because there always is
only 1 output mute LED and 1 input mute LED. Well at least that is the assumption
the current ledtrig-audio.c code has.

The idea is to only turn the single LED on if we are sure there will be not
sound output on any of the outputs, which is why we tie the LED to the
mute switch on the main volume control.

Regards,

Hans



More information about the Alsa-devel mailing list