aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/wm8731.c16
-rw-r--r--sound/soc/codecs/wm8750.c16
-rw-r--r--sound/soc/codecs/wm8753.c17
-rw-r--r--sound/soc/codecs/wm9712.c15
-rw-r--r--sound/soc/codecs/wm9713.c15
5 files changed, 20 insertions, 59 deletions
diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c
index 0f28aa4bccc..5acf43ab104 100644
--- a/sound/soc/codecs/wm8731.c
+++ b/sound/soc/codecs/wm8731.c
@@ -193,7 +193,7 @@ SND_SOC_DAPM_INPUT("RLINEIN"),
193SND_SOC_DAPM_INPUT("LLINEIN"), 193SND_SOC_DAPM_INPUT("LLINEIN"),
194}; 194};
195 195
196static const char *intercon[][3] = { 196static const struct snd_soc_dapm_route intercon[] = {
197 /* output mixer */ 197 /* output mixer */
198 {"Output Mixer", "Line Bypass Switch", "Line Input"}, 198 {"Output Mixer", "Line Bypass Switch", "Line Input"},
199 {"Output Mixer", "HiFi Playback Switch", "DAC"}, 199 {"Output Mixer", "HiFi Playback Switch", "DAC"},
@@ -214,22 +214,14 @@ static const char *intercon[][3] = {
214 {"Line Input", NULL, "LLINEIN"}, 214 {"Line Input", NULL, "LLINEIN"},
215 {"Line Input", NULL, "RLINEIN"}, 215 {"Line Input", NULL, "RLINEIN"},
216 {"Mic Bias", NULL, "MICIN"}, 216 {"Mic Bias", NULL, "MICIN"},
217
218 /* terminator */
219 {NULL, NULL, NULL},
220}; 217};
221 218
222static int wm8731_add_widgets(struct snd_soc_codec *codec) 219static int wm8731_add_widgets(struct snd_soc_codec *codec)
223{ 220{
224 int i; 221 snd_soc_dapm_new_controls(codec, wm8731_dapm_widgets,
225 222 ARRAY_SIZE(wm8731_dapm_widgets));
226 for (i = 0; i < ARRAY_SIZE(wm8731_dapm_widgets); i++)
227 snd_soc_dapm_new_control(codec, &wm8731_dapm_widgets[i]);
228 223
229 /* set up audio path interconnects */ 224 snd_soc_dapm_add_routes(codec, intercon, ARRAY_SIZE(intercon));
230 for (i = 0; intercon[i][0] != NULL; i++)
231 snd_soc_dapm_connect_input(codec, intercon[i][0],
232 intercon[i][1], intercon[i][2]);
233 225
234 snd_soc_dapm_new_widgets(codec); 226 snd_soc_dapm_new_widgets(codec);
235 return 0; 227 return 0;
diff --git a/sound/soc/codecs/wm8750.c b/sound/soc/codecs/wm8750.c
index 62423f4493b..1f11ad24551 100644
--- a/sound/soc/codecs/wm8750.c
+++ b/sound/soc/codecs/wm8750.c
@@ -378,7 +378,7 @@ static const struct snd_soc_dapm_widget wm8750_dapm_widgets[] = {
378 SND_SOC_DAPM_INPUT("RINPUT3"), 378 SND_SOC_DAPM_INPUT("RINPUT3"),
379}; 379};
380 380
381static const char *audio_map[][3] = { 381static const struct snd_soc_dapm_route audio_map[] = {
382 /* left mixer */ 382 /* left mixer */
383 {"Left Mixer", "Playback Switch", "Left DAC"}, 383 {"Left Mixer", "Playback Switch", "Left DAC"},
384 {"Left Mixer", "Left Bypass Switch", "Left Line Mux"}, 384 {"Left Mixer", "Left Bypass Switch", "Left Line Mux"},
@@ -470,22 +470,14 @@ static const char *audio_map[][3] = {
470 /* ADC */ 470 /* ADC */
471 {"Left ADC", NULL, "Left ADC Mux"}, 471 {"Left ADC", NULL, "Left ADC Mux"},
472 {"Right ADC", NULL, "Right ADC Mux"}, 472 {"Right ADC", NULL, "Right ADC Mux"},
473
474 /* terminator */
475 {NULL, NULL, NULL},
476}; 473};
477 474
478static int wm8750_add_widgets(struct snd_soc_codec *codec) 475static int wm8750_add_widgets(struct snd_soc_codec *codec)
479{ 476{
480 int i; 477 snd_soc_dapm_new_controls(codec, wm8750_dapm_widgets,
481 478 ARRAY_SIZE(wm8750_dapm_widgets));
482 for (i = 0; i < ARRAY_SIZE(wm8750_dapm_widgets); i++)
483 snd_soc_dapm_new_control(codec, &wm8750_dapm_widgets[i]);
484 479
485 /* set up audio path audio_mapnects */ 480 snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map));
486 for (i = 0; audio_map[i][0] != NULL; i++)
487 snd_soc_dapm_connect_input(codec, audio_map[i][0],
488 audio_map[i][1], audio_map[i][2]);
489 481
490 snd_soc_dapm_new_widgets(codec); 482 snd_soc_dapm_new_widgets(codec);
491 return 0; 483 return 0;
diff --git a/sound/soc/codecs/wm8753.c b/sound/soc/codecs/wm8753.c
index 9032b0c07c8..c32e6326be6 100644
--- a/sound/soc/codecs/wm8753.c
+++ b/sound/soc/codecs/wm8753.c
@@ -523,7 +523,7 @@ SND_SOC_DAPM_INPUT("MIC2"),
523SND_SOC_DAPM_VMID("VREF"), 523SND_SOC_DAPM_VMID("VREF"),
524}; 524};
525 525
526static const char *audio_map[][3] = { 526static const struct snd_soc_dapm_route audio_map[] = {
527 /* left mixer */ 527 /* left mixer */
528 {"Left Mixer", "Left Playback Switch", "Left DAC"}, 528 {"Left Mixer", "Left Playback Switch", "Left DAC"},
529 {"Left Mixer", "Voice Playback Switch", "Voice DAC"}, 529 {"Left Mixer", "Voice Playback Switch", "Voice DAC"},
@@ -674,23 +674,14 @@ static const char *audio_map[][3] = {
674 674
675 /* ACOP */ 675 /* ACOP */
676 {"ACOP", NULL, "ALC Mixer"}, 676 {"ACOP", NULL, "ALC Mixer"},
677
678 /* terminator */
679 {NULL, NULL, NULL},
680}; 677};
681 678
682static int wm8753_add_widgets(struct snd_soc_codec *codec) 679static int wm8753_add_widgets(struct snd_soc_codec *codec)
683{ 680{
684 int i; 681 snd_soc_dapm_new_controls(codec, wm8753_dapm_widgets,
682 ARRAY_SIZE(wm8753_dapm_widgets));
685 683
686 for (i = 0; i < ARRAY_SIZE(wm8753_dapm_widgets); i++) 684 snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map));
687 snd_soc_dapm_new_control(codec, &wm8753_dapm_widgets[i]);
688
689 /* set up the WM8753 audio map */
690 for (i = 0; audio_map[i][0] != NULL; i++) {
691 snd_soc_dapm_connect_input(codec, audio_map[i][0],
692 audio_map[i][1], audio_map[i][2]);
693 }
694 685
695 snd_soc_dapm_new_widgets(codec); 686 snd_soc_dapm_new_widgets(codec);
696 return 0; 687 return 0;
diff --git a/sound/soc/codecs/wm9712.c b/sound/soc/codecs/wm9712.c
index e26cfcf0b4f..d9789f1c890 100644
--- a/sound/soc/codecs/wm9712.c
+++ b/sound/soc/codecs/wm9712.c
@@ -348,7 +348,7 @@ SND_SOC_DAPM_INPUT("MIC1"),
348SND_SOC_DAPM_INPUT("MIC2"), 348SND_SOC_DAPM_INPUT("MIC2"),
349}; 349};
350 350
351static const char *audio_map[][3] = { 351static const struct snd_soc_dapm_route audio_map[] = {
352 /* virtual mixer - mixes left & right channels for spk and mono */ 352 /* virtual mixer - mixes left & right channels for spk and mono */
353 {"AC97 Mixer", NULL, "Left DAC"}, 353 {"AC97 Mixer", NULL, "Left DAC"},
354 {"AC97 Mixer", NULL, "Right DAC"}, 354 {"AC97 Mixer", NULL, "Right DAC"},
@@ -443,21 +443,14 @@ static const char *audio_map[][3] = {
443 {"Speaker PGA", NULL, "Speaker Mux"}, 443 {"Speaker PGA", NULL, "Speaker Mux"},
444 {"LOUT2", NULL, "Speaker PGA"}, 444 {"LOUT2", NULL, "Speaker PGA"},
445 {"ROUT2", NULL, "Speaker PGA"}, 445 {"ROUT2", NULL, "Speaker PGA"},
446
447 {NULL, NULL, NULL},
448}; 446};
449 447
450static int wm9712_add_widgets(struct snd_soc_codec *codec) 448static int wm9712_add_widgets(struct snd_soc_codec *codec)
451{ 449{
452 int i; 450 snd_soc_dapm_new_controls(codec, wm9712_dapm_widgets,
453 451 ARRAY_SIZE(wm9712_dapm_widgets));
454 for (i = 0; i < ARRAY_SIZE(wm9712_dapm_widgets); i++)
455 snd_soc_dapm_new_control(codec, &wm9712_dapm_widgets[i]);
456 452
457 /* set up audio path connects */ 453 snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map));
458 for (i = 0; audio_map[i][0] != NULL; i++)
459 snd_soc_dapm_connect_input(codec, audio_map[i][0],
460 audio_map[i][1], audio_map[i][2]);
461 454
462 snd_soc_dapm_new_widgets(codec); 455 snd_soc_dapm_new_widgets(codec);
463 return 0; 456 return 0;
diff --git a/sound/soc/codecs/wm9713.c b/sound/soc/codecs/wm9713.c
index 4863636e9d5..4f516a5a561 100644
--- a/sound/soc/codecs/wm9713.c
+++ b/sound/soc/codecs/wm9713.c
@@ -453,7 +453,7 @@ SND_SOC_DAPM_INPUT("MIC2B"),
453SND_SOC_DAPM_VMID("VMID"), 453SND_SOC_DAPM_VMID("VMID"),
454}; 454};
455 455
456static const char *audio_map[][3] = { 456static const struct snd_soc_dapm_route audio_map[] = {
457 /* left HP mixer */ 457 /* left HP mixer */
458 {"Left HP Mixer", "PC Beep Playback Switch", "PCBEEP"}, 458 {"Left HP Mixer", "PC Beep Playback Switch", "PCBEEP"},
459 {"Left HP Mixer", "Voice Playback Switch", "Voice DAC"}, 459 {"Left HP Mixer", "Voice Playback Switch", "Voice DAC"},
@@ -604,21 +604,14 @@ static const char *audio_map[][3] = {
604 {"Capture Mono Mux", "Stereo", "Capture Mixer"}, 604 {"Capture Mono Mux", "Stereo", "Capture Mixer"},
605 {"Capture Mono Mux", "Left", "Left Capture Source"}, 605 {"Capture Mono Mux", "Left", "Left Capture Source"},
606 {"Capture Mono Mux", "Right", "Right Capture Source"}, 606 {"Capture Mono Mux", "Right", "Right Capture Source"},
607
608 {NULL, NULL, NULL},
609}; 607};
610 608
611static int wm9713_add_widgets(struct snd_soc_codec *codec) 609static int wm9713_add_widgets(struct snd_soc_codec *codec)
612{ 610{
613 int i; 611 snd_soc_dapm_new_controls(codec, wm9713_dapm_widgets,
614 612 ARRAY_SIZE(wm9713_dapm_widgets));
615 for (i = 0; i < ARRAY_SIZE(wm9713_dapm_widgets); i++)
616 snd_soc_dapm_new_control(codec, &wm9713_dapm_widgets[i]);
617 613
618 /* set up audio path audio_mapnects */ 614 snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map));
619 for (i = 0; audio_map[i][0] != NULL; i++)
620 snd_soc_dapm_connect_input(codec, audio_map[i][0],
621 audio_map[i][1], audio_map[i][2]);
622 615
623 snd_soc_dapm_new_widgets(codec); 616 snd_soc_dapm_new_widgets(codec);
624 return 0; 617 return 0;