Commit a65f0568 authored by Mark Brown's avatar Mark Brown Committed by Jaroslav Kysela

[ALSA] soc - Convert Wolfson codec drivers to use bulk DAPM registration

Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarJaroslav Kysela <perex@perex.cz>
parent 3ff3f64b
...@@ -193,7 +193,7 @@ SND_SOC_DAPM_INPUT("RLINEIN"), ...@@ -193,7 +193,7 @@ SND_SOC_DAPM_INPUT("RLINEIN"),
SND_SOC_DAPM_INPUT("LLINEIN"), SND_SOC_DAPM_INPUT("LLINEIN"),
}; };
static const char *intercon[][3] = { static const struct snd_soc_dapm_route intercon[] = {
/* output mixer */ /* output mixer */
{"Output Mixer", "Line Bypass Switch", "Line Input"}, {"Output Mixer", "Line Bypass Switch", "Line Input"},
{"Output Mixer", "HiFi Playback Switch", "DAC"}, {"Output Mixer", "HiFi Playback Switch", "DAC"},
...@@ -214,22 +214,14 @@ static const char *intercon[][3] = { ...@@ -214,22 +214,14 @@ static const char *intercon[][3] = {
{"Line Input", NULL, "LLINEIN"}, {"Line Input", NULL, "LLINEIN"},
{"Line Input", NULL, "RLINEIN"}, {"Line Input", NULL, "RLINEIN"},
{"Mic Bias", NULL, "MICIN"}, {"Mic Bias", NULL, "MICIN"},
/* terminator */
{NULL, NULL, NULL},
}; };
static int wm8731_add_widgets(struct snd_soc_codec *codec) static int wm8731_add_widgets(struct snd_soc_codec *codec)
{ {
int i; snd_soc_dapm_new_controls(codec, wm8731_dapm_widgets,
ARRAY_SIZE(wm8731_dapm_widgets));
for (i = 0; i < ARRAY_SIZE(wm8731_dapm_widgets); i++)
snd_soc_dapm_new_control(codec, &wm8731_dapm_widgets[i]);
/* set up audio path interconnects */ snd_soc_dapm_add_routes(codec, intercon, ARRAY_SIZE(intercon));
for (i = 0; intercon[i][0] != NULL; i++)
snd_soc_dapm_connect_input(codec, intercon[i][0],
intercon[i][1], intercon[i][2]);
snd_soc_dapm_new_widgets(codec); snd_soc_dapm_new_widgets(codec);
return 0; return 0;
......
...@@ -378,7 +378,7 @@ static const struct snd_soc_dapm_widget wm8750_dapm_widgets[] = { ...@@ -378,7 +378,7 @@ static const struct snd_soc_dapm_widget wm8750_dapm_widgets[] = {
SND_SOC_DAPM_INPUT("RINPUT3"), SND_SOC_DAPM_INPUT("RINPUT3"),
}; };
static const char *audio_map[][3] = { static const struct snd_soc_dapm_route audio_map[] = {
/* left mixer */ /* left mixer */
{"Left Mixer", "Playback Switch", "Left DAC"}, {"Left Mixer", "Playback Switch", "Left DAC"},
{"Left Mixer", "Left Bypass Switch", "Left Line Mux"}, {"Left Mixer", "Left Bypass Switch", "Left Line Mux"},
...@@ -470,22 +470,14 @@ static const char *audio_map[][3] = { ...@@ -470,22 +470,14 @@ static const char *audio_map[][3] = {
/* ADC */ /* ADC */
{"Left ADC", NULL, "Left ADC Mux"}, {"Left ADC", NULL, "Left ADC Mux"},
{"Right ADC", NULL, "Right ADC Mux"}, {"Right ADC", NULL, "Right ADC Mux"},
/* terminator */
{NULL, NULL, NULL},
}; };
static int wm8750_add_widgets(struct snd_soc_codec *codec) static int wm8750_add_widgets(struct snd_soc_codec *codec)
{ {
int i; snd_soc_dapm_new_controls(codec, wm8750_dapm_widgets,
ARRAY_SIZE(wm8750_dapm_widgets));
for (i = 0; i < ARRAY_SIZE(wm8750_dapm_widgets); i++)
snd_soc_dapm_new_control(codec, &wm8750_dapm_widgets[i]);
/* set up audio path audio_mapnects */ snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map));
for (i = 0; audio_map[i][0] != NULL; i++)
snd_soc_dapm_connect_input(codec, audio_map[i][0],
audio_map[i][1], audio_map[i][2]);
snd_soc_dapm_new_widgets(codec); snd_soc_dapm_new_widgets(codec);
return 0; return 0;
......
...@@ -523,7 +523,7 @@ SND_SOC_DAPM_INPUT("MIC2"), ...@@ -523,7 +523,7 @@ SND_SOC_DAPM_INPUT("MIC2"),
SND_SOC_DAPM_VMID("VREF"), SND_SOC_DAPM_VMID("VREF"),
}; };
static const char *audio_map[][3] = { static const struct snd_soc_dapm_route audio_map[] = {
/* left mixer */ /* left mixer */
{"Left Mixer", "Left Playback Switch", "Left DAC"}, {"Left Mixer", "Left Playback Switch", "Left DAC"},
{"Left Mixer", "Voice Playback Switch", "Voice DAC"}, {"Left Mixer", "Voice Playback Switch", "Voice DAC"},
...@@ -674,23 +674,14 @@ static const char *audio_map[][3] = { ...@@ -674,23 +674,14 @@ static const char *audio_map[][3] = {
/* ACOP */ /* ACOP */
{"ACOP", NULL, "ALC Mixer"}, {"ACOP", NULL, "ALC Mixer"},
/* terminator */
{NULL, NULL, NULL},
}; };
static int wm8753_add_widgets(struct snd_soc_codec *codec) static int wm8753_add_widgets(struct snd_soc_codec *codec)
{ {
int i; snd_soc_dapm_new_controls(codec, wm8753_dapm_widgets,
ARRAY_SIZE(wm8753_dapm_widgets));
for (i = 0; i < ARRAY_SIZE(wm8753_dapm_widgets); i++) snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map));
snd_soc_dapm_new_control(codec, &wm8753_dapm_widgets[i]);
/* set up the WM8753 audio map */
for (i = 0; audio_map[i][0] != NULL; i++) {
snd_soc_dapm_connect_input(codec, audio_map[i][0],
audio_map[i][1], audio_map[i][2]);
}
snd_soc_dapm_new_widgets(codec); snd_soc_dapm_new_widgets(codec);
return 0; return 0;
......
...@@ -348,7 +348,7 @@ SND_SOC_DAPM_INPUT("MIC1"), ...@@ -348,7 +348,7 @@ SND_SOC_DAPM_INPUT("MIC1"),
SND_SOC_DAPM_INPUT("MIC2"), SND_SOC_DAPM_INPUT("MIC2"),
}; };
static const char *audio_map[][3] = { static const struct snd_soc_dapm_route audio_map[] = {
/* virtual mixer - mixes left & right channels for spk and mono */ /* virtual mixer - mixes left & right channels for spk and mono */
{"AC97 Mixer", NULL, "Left DAC"}, {"AC97 Mixer", NULL, "Left DAC"},
{"AC97 Mixer", NULL, "Right DAC"}, {"AC97 Mixer", NULL, "Right DAC"},
...@@ -443,21 +443,14 @@ static const char *audio_map[][3] = { ...@@ -443,21 +443,14 @@ static const char *audio_map[][3] = {
{"Speaker PGA", NULL, "Speaker Mux"}, {"Speaker PGA", NULL, "Speaker Mux"},
{"LOUT2", NULL, "Speaker PGA"}, {"LOUT2", NULL, "Speaker PGA"},
{"ROUT2", NULL, "Speaker PGA"}, {"ROUT2", NULL, "Speaker PGA"},
{NULL, NULL, NULL},
}; };
static int wm9712_add_widgets(struct snd_soc_codec *codec) static int wm9712_add_widgets(struct snd_soc_codec *codec)
{ {
int i; snd_soc_dapm_new_controls(codec, wm9712_dapm_widgets,
ARRAY_SIZE(wm9712_dapm_widgets));
for (i = 0; i < ARRAY_SIZE(wm9712_dapm_widgets); i++)
snd_soc_dapm_new_control(codec, &wm9712_dapm_widgets[i]);
/* set up audio path connects */ snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map));
for (i = 0; audio_map[i][0] != NULL; i++)
snd_soc_dapm_connect_input(codec, audio_map[i][0],
audio_map[i][1], audio_map[i][2]);
snd_soc_dapm_new_widgets(codec); snd_soc_dapm_new_widgets(codec);
return 0; return 0;
......
...@@ -453,7 +453,7 @@ SND_SOC_DAPM_INPUT("MIC2B"), ...@@ -453,7 +453,7 @@ SND_SOC_DAPM_INPUT("MIC2B"),
SND_SOC_DAPM_VMID("VMID"), SND_SOC_DAPM_VMID("VMID"),
}; };
static const char *audio_map[][3] = { static const struct snd_soc_dapm_route audio_map[] = {
/* left HP mixer */ /* left HP mixer */
{"Left HP Mixer", "PC Beep Playback Switch", "PCBEEP"}, {"Left HP Mixer", "PC Beep Playback Switch", "PCBEEP"},
{"Left HP Mixer", "Voice Playback Switch", "Voice DAC"}, {"Left HP Mixer", "Voice Playback Switch", "Voice DAC"},
...@@ -604,21 +604,14 @@ static const char *audio_map[][3] = { ...@@ -604,21 +604,14 @@ static const char *audio_map[][3] = {
{"Capture Mono Mux", "Stereo", "Capture Mixer"}, {"Capture Mono Mux", "Stereo", "Capture Mixer"},
{"Capture Mono Mux", "Left", "Left Capture Source"}, {"Capture Mono Mux", "Left", "Left Capture Source"},
{"Capture Mono Mux", "Right", "Right Capture Source"}, {"Capture Mono Mux", "Right", "Right Capture Source"},
{NULL, NULL, NULL},
}; };
static int wm9713_add_widgets(struct snd_soc_codec *codec) static int wm9713_add_widgets(struct snd_soc_codec *codec)
{ {
int i; snd_soc_dapm_new_controls(codec, wm9713_dapm_widgets,
ARRAY_SIZE(wm9713_dapm_widgets));
for (i = 0; i < ARRAY_SIZE(wm9713_dapm_widgets); i++)
snd_soc_dapm_new_control(codec, &wm9713_dapm_widgets[i]);
/* set up audio path audio_mapnects */ snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map));
for (i = 0; audio_map[i][0] != NULL; i++)
snd_soc_dapm_connect_input(codec, audio_map[i][0],
audio_map[i][1], audio_map[i][2]);
snd_soc_dapm_new_widgets(codec); snd_soc_dapm_new_widgets(codec);
return 0; return 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