Commit 9158221b authored by Maciej Strozek's avatar Maciej Strozek Committed by Mark Brown

ASoC: cs43130: Add switch to control normal and alt hp inputs

Make sure these inputs are mutually exclusive as recommended by the
datasheet
Signed-off-by: default avatarMaciej Strozek <mstrozek@opensource.cirrus.com>
Acked-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20231117141344.64320-8-mstrozek@opensource.cirrus.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent ce7944b7
...@@ -1366,7 +1366,15 @@ static int cs43130_hpin_event(struct snd_soc_dapm_widget *w, ...@@ -1366,7 +1366,15 @@ static int cs43130_hpin_event(struct snd_soc_dapm_widget *w,
return 0; return 0;
} }
static const char * const bypass_mux_text[] = {
"Internal",
"Alternative",
};
static SOC_ENUM_SINGLE_DECL(bypass_enum, SND_SOC_NOPM, 0, bypass_mux_text);
static const struct snd_kcontrol_new bypass_ctrl = SOC_DAPM_ENUM("Switch", bypass_enum);
static const struct snd_soc_dapm_widget digital_hp_widgets[] = { static const struct snd_soc_dapm_widget digital_hp_widgets[] = {
SND_SOC_DAPM_MUX("Bypass Switch", SND_SOC_NOPM, 0, 0, &bypass_ctrl),
SND_SOC_DAPM_OUTPUT("HPOUTA"), SND_SOC_DAPM_OUTPUT("HPOUTA"),
SND_SOC_DAPM_OUTPUT("HPOUTB"), SND_SOC_DAPM_OUTPUT("HPOUTB"),
...@@ -1419,13 +1427,13 @@ static const struct snd_soc_dapm_route digital_hp_routes[] = { ...@@ -1419,13 +1427,13 @@ static const struct snd_soc_dapm_route digital_hp_routes[] = {
{"DSD", NULL, "XSPIN DSD"}, {"DSD", NULL, "XSPIN DSD"},
{"HiFi DAC", NULL, "ASPIN PCM"}, {"HiFi DAC", NULL, "ASPIN PCM"},
{"HiFi DAC", NULL, "DSD"}, {"HiFi DAC", NULL, "DSD"},
{"HPOUTA", NULL, "HiFi DAC"}, {"Bypass Switch", "Internal", "HiFi DAC"},
{"HPOUTB", NULL, "HiFi DAC"}, {"HPOUTA", NULL, "Bypass Switch"},
{"HPOUTB", NULL, "Bypass Switch"},
}; };
static const struct snd_soc_dapm_route analog_hp_routes[] = { static const struct snd_soc_dapm_route analog_hp_routes[] = {
{"HPOUTA", NULL, "Analog Playback"}, {"Bypass Switch", "Alternative", "Analog Playback"},
{"HPOUTB", NULL, "Analog Playback"},
}; };
static struct snd_soc_dapm_route all_hp_routes[ static struct snd_soc_dapm_route all_hp_routes[
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment