summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVlad Karpovich <vkarpovi@opensource.cirrus.com>2023-08-31 11:20:42 -0500
committerMark Brown <broonie@kernel.org>2023-09-11 01:30:05 +0100
commitc3c9b17d27887f7b2f6b85d0a364b009b8436539 (patch)
tree72b31e4ae49af1ecd864d93c8082cf61f09becd0
parent3fecf69aa7fdf1910267dee1dbaa8ed865cf2cb6 (diff)
ASoC: cs35l45: Add AMP Enable Switch control
The "AMP Enable Switch" is useful in systems with multiple amplifiers connected to the same audio bus but not all of them are needed for all use cases. Signed-off-by: Vlad Karpovich <vkarpovi@opensource.cirrus.com> Acked-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com> Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230831162042.471801-4-vkarpovi@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/codecs/cs35l45.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sound/soc/codecs/cs35l45.c b/sound/soc/codecs/cs35l45.c
index 52d58b61372e..b68853e42fd1 100644
--- a/sound/soc/codecs/cs35l45.c
+++ b/sound/soc/codecs/cs35l45.c
@@ -417,6 +417,8 @@ static const struct snd_kcontrol_new cs35l45_dsp_muxes[] = {
static const struct snd_kcontrol_new cs35l45_dac_muxes[] = {
SOC_DAPM_ENUM("DACPCM Source", cs35l45_dacpcm_enums[0]),
};
+static const struct snd_kcontrol_new amp_en_ctl =
+ SOC_DAPM_SINGLE("Switch", SND_SOC_NOPM, 0, 1, 0);
static const struct snd_soc_dapm_widget cs35l45_dapm_widgets[] = {
SND_SOC_DAPM_SPK("DSP1 Preload", NULL),
@@ -479,6 +481,8 @@ static const struct snd_soc_dapm_widget cs35l45_dapm_widgets[] = {
SND_SOC_DAPM_MUX("DACPCM Source", SND_SOC_NOPM, 0, 0, &cs35l45_dac_muxes[0]),
+ SND_SOC_DAPM_SWITCH("AMP Enable", SND_SOC_NOPM, 0, 0, &amp_en_ctl),
+
SND_SOC_DAPM_OUT_DRV("AMP", SND_SOC_NOPM, 0, 0, NULL, 0),
SND_SOC_DAPM_OUTPUT("SPK"),
@@ -586,7 +590,8 @@ static const struct snd_soc_dapm_route cs35l45_dapm_routes[] = {
CS35L45_DAC_MUX_ROUTE("DACPCM"),
- { "SPK", NULL, "AMP"},
+ { "AMP Enable", "Switch", "AMP" },
+ { "SPK", NULL, "AMP Enable"},
};
static const char * const amplifier_mode_texts[] = {"SPK", "RCV"};