Commit e5ba3198 authored by Katsuhiro Suzuki's avatar Katsuhiro Suzuki Committed by Mark Brown

ASoC: uniphier: evea: use DAPM to change source of line-in

This patch replaces mixer switch to DAPM one for changing audio source
of line-in.
Signed-off-by: default avatarKatsuhiro Suzuki <suzuki.katsuhiro@socionext.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 2ce7eb25
...@@ -54,8 +54,21 @@ struct evea_priv { ...@@ -54,8 +54,21 @@ struct evea_priv {
int switch_hp; int switch_hp;
}; };
static const char * const linsw1_sel1_text[] = {
"LIN1", "LIN2", "LIN3"
};
static SOC_ENUM_SINGLE_DECL(linsw1_sel1_enum,
ALINSW1, ALINSW1_SEL1_SHIFT,
linsw1_sel1_text);
static const struct snd_kcontrol_new linesw1_mux[] = {
SOC_DAPM_ENUM("Line In 1 Source", linsw1_sel1_enum),
};
static const struct snd_soc_dapm_widget evea_widgets[] = { static const struct snd_soc_dapm_widget evea_widgets[] = {
SND_SOC_DAPM_ADC("ADC", "Capture", SND_SOC_NOPM, 0, 0), SND_SOC_DAPM_ADC("ADC", NULL, SND_SOC_NOPM, 0, 0),
SND_SOC_DAPM_MUX("Line In 1 Mux", SND_SOC_NOPM, 0, 0, linesw1_mux),
SND_SOC_DAPM_INPUT("LIN1_LP"), SND_SOC_DAPM_INPUT("LIN1_LP"),
SND_SOC_DAPM_INPUT("LIN1_RP"), SND_SOC_DAPM_INPUT("LIN1_RP"),
SND_SOC_DAPM_INPUT("LIN2_LP"), SND_SOC_DAPM_INPUT("LIN2_LP"),
...@@ -63,7 +76,9 @@ static const struct snd_soc_dapm_widget evea_widgets[] = { ...@@ -63,7 +76,9 @@ static const struct snd_soc_dapm_widget evea_widgets[] = {
SND_SOC_DAPM_INPUT("LIN3_LP"), SND_SOC_DAPM_INPUT("LIN3_LP"),
SND_SOC_DAPM_INPUT("LIN3_RP"), SND_SOC_DAPM_INPUT("LIN3_RP"),
SND_SOC_DAPM_DAC("DAC", "Playback", SND_SOC_NOPM, 0, 0), SND_SOC_DAPM_DAC("DAC HP", NULL, SND_SOC_NOPM, 0, 0),
SND_SOC_DAPM_DAC("DAC LO1", NULL, SND_SOC_NOPM, 0, 0),
SND_SOC_DAPM_DAC("DAC LO2", NULL, SND_SOC_NOPM, 0, 0),
SND_SOC_DAPM_OUTPUT("HP1_L"), SND_SOC_DAPM_OUTPUT("HP1_L"),
SND_SOC_DAPM_OUTPUT("HP1_R"), SND_SOC_DAPM_OUTPUT("HP1_R"),
SND_SOC_DAPM_OUTPUT("LO2_L"), SND_SOC_DAPM_OUTPUT("LO2_L"),
...@@ -71,17 +86,22 @@ static const struct snd_soc_dapm_widget evea_widgets[] = { ...@@ -71,17 +86,22 @@ static const struct snd_soc_dapm_widget evea_widgets[] = {
}; };
static const struct snd_soc_dapm_route evea_routes[] = { static const struct snd_soc_dapm_route evea_routes[] = {
{ "ADC", NULL, "LIN1_LP" }, { "Line In 1", NULL, "ADC" },
{ "ADC", NULL, "LIN1_RP" }, { "ADC", NULL, "Line In 1 Mux" },
{ "ADC", NULL, "LIN2_LP" }, { "Line In 1 Mux", "LIN1", "LIN1_LP" },
{ "ADC", NULL, "LIN2_RP" }, { "Line In 1 Mux", "LIN1", "LIN1_RP" },
{ "ADC", NULL, "LIN3_LP" }, { "Line In 1 Mux", "LIN2", "LIN2_LP" },
{ "ADC", NULL, "LIN3_RP" }, { "Line In 1 Mux", "LIN2", "LIN2_RP" },
{ "Line In 1 Mux", "LIN3", "LIN3_LP" },
{ "HP1_L", NULL, "DAC" }, { "Line In 1 Mux", "LIN3", "LIN3_RP" },
{ "HP1_R", NULL, "DAC" },
{ "LO2_L", NULL, "DAC" }, { "DAC HP", NULL, "Headphone 1" },
{ "LO2_R", NULL, "DAC" }, { "DAC LO1", NULL, "Line Out 1" },
{ "DAC LO2", NULL, "Line Out 2" },
{ "HP1_L", NULL, "DAC HP" },
{ "HP1_R", NULL, "DAC HP" },
{ "LO2_L", NULL, "DAC LO2" },
{ "LO2_R", NULL, "DAC LO2" },
}; };
static void evea_set_power_state_on(struct evea_priv *evea) static void evea_set_power_state_on(struct evea_priv *evea)
...@@ -280,16 +300,7 @@ static int evea_set_switch_hp(struct snd_kcontrol *kcontrol, ...@@ -280,16 +300,7 @@ static int evea_set_switch_hp(struct snd_kcontrol *kcontrol,
return evea_update_switch_hp(evea); return evea_update_switch_hp(evea);
} }
static const char * const linsw1_sel1_text[] = {
"LIN1", "LIN2", "LIN3"
};
static SOC_ENUM_SINGLE_DECL(linsw1_sel1_enum,
ALINSW1, ALINSW1_SEL1_SHIFT,
linsw1_sel1_text);
static const struct snd_kcontrol_new evea_controls[] = { static const struct snd_kcontrol_new evea_controls[] = {
SOC_ENUM("Line Capture Source", linsw1_sel1_enum),
SOC_SINGLE_BOOL_EXT("Line Capture Switch", 0, SOC_SINGLE_BOOL_EXT("Line Capture Switch", 0,
evea_get_switch_lin, evea_set_switch_lin), evea_get_switch_lin, evea_set_switch_lin),
SOC_SINGLE_BOOL_EXT("Line Playback Switch", 0, SOC_SINGLE_BOOL_EXT("Line Playback Switch", 0,
......
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