I think I need to use SND_SOC_DAPM_SWITCH with
SOC_DAPM_SINGLE_AUTODISABLE for this control.
Am I right? I am trying to do that, but meet a problem. If I set speaker switch unmute before playing music, dapm will mute it
automatically in power on sequence.
The only way I can unmute speaker is set speaker switch unmute while
playing music.
DAPM should unmute the switch on power up and mute it on power down. The Speaker Channel Switch control has the invert flag set did you also set the invert flag for the new autodisable control?
Yes, the related code is as below. static const struct snd_kcontrol_new spk_l_enable_control = SOC_DAPM_SINGLE_AUTODISABLE("Switch", RT5640_SPK_VOL, RT5640_L_MUTE_SFT, 1, 1);
static const struct snd_kcontrol_new spk_r_enable_control = SOC_DAPM_SINGLE_AUTODISABLE("Switch", RT5640_SPK_VOL, RT5640_R_MUTE_SFT, 1, 1);
SND_SOC_DAPM_SWITCH("Speaker L Playback", SND_SOC_NOPM, 0, 0, &spk_l_enable_control), SND_SOC_DAPM_SWITCH("Speaker R Playback", SND_SOC_NOPM, 0, 0, &spk_r_enable_control),
I tried set SND_SOC_DAPM_SWITCH invert flag, but it comes the same result. I will do some more experiments about it.
- Lars
------Please consider the environment before printing this e-mail.