diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-08-16 15:28:18 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-08-17 17:32:59 -0400 |
commit | a3150f09174ace7878bf4bbbf23d3ba25cc01261 (patch) | |
tree | 23aadf7d800e90d93c5d1a8551fa22d80d2557c8 /sound/soc/codecs/wm5102.c | |
parent | 1837ce352d4c05a9d0fc86e743b0ec2ea775fd38 (diff) |
ASoC: wm5102: Add AEC routing control
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/wm5102.c')
-rw-r--r-- | sound/soc/codecs/wm5102.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/sound/soc/codecs/wm5102.c b/sound/soc/codecs/wm5102.c index 4c2fc361051c..2e6f1ffc9fd4 100644 --- a/sound/soc/codecs/wm5102.c +++ b/sound/soc/codecs/wm5102.c | |||
@@ -280,6 +280,27 @@ ARIZONA_MIXER_ENUMS(ASRC1R, ARIZONA_ASRC1RMIX_INPUT_1_SOURCE); | |||
280 | ARIZONA_MIXER_ENUMS(ASRC2L, ARIZONA_ASRC2LMIX_INPUT_1_SOURCE); | 280 | ARIZONA_MIXER_ENUMS(ASRC2L, ARIZONA_ASRC2LMIX_INPUT_1_SOURCE); |
281 | ARIZONA_MIXER_ENUMS(ASRC2R, ARIZONA_ASRC2RMIX_INPUT_1_SOURCE); | 281 | ARIZONA_MIXER_ENUMS(ASRC2R, ARIZONA_ASRC2RMIX_INPUT_1_SOURCE); |
282 | 282 | ||
283 | |||
284 | static const char *wm5102_aec_loopback_texts[] = { | ||
285 | "HPOUT1L", "HPOUT1R", "HPOUT2L", "HPOUT2R", "EPOUT", | ||
286 | "SPKOUTL", "SPKOUTR", "SPKDAT1L", "SPKDAT1R", | ||
287 | }; | ||
288 | |||
289 | static const unsigned int wm5102_aec_loopback_values[] = { | ||
290 | 0, 1, 2, 3, 4, 6, 7, 8, 9, | ||
291 | }; | ||
292 | |||
293 | static const struct soc_enum wm5102_aec_loopback = | ||
294 | SOC_VALUE_ENUM_SINGLE(ARIZONA_DAC_AEC_CONTROL_1, | ||
295 | ARIZONA_AEC_LOOPBACK_SRC_SHIFT, | ||
296 | ARIZONA_AEC_LOOPBACK_SRC_MASK, | ||
297 | ARRAY_SIZE(wm5102_aec_loopback_texts), | ||
298 | wm5102_aec_loopback_texts, | ||
299 | wm5102_aec_loopback_values); | ||
300 | |||
301 | static const struct snd_kcontrol_new wm5102_aec_loopback_mux = | ||
302 | SOC_DAPM_VALUE_ENUM("AEC Loopback", wm5102_aec_loopback); | ||
303 | |||
283 | static const struct snd_soc_dapm_widget wm5102_dapm_widgets[] = { | 304 | static const struct snd_soc_dapm_widget wm5102_dapm_widgets[] = { |
284 | SND_SOC_DAPM_SUPPLY("SYSCLK", ARIZONA_SYSTEM_CLOCK_1, ARIZONA_SYSCLK_ENA_SHIFT, | 305 | SND_SOC_DAPM_SUPPLY("SYSCLK", ARIZONA_SYSTEM_CLOCK_1, ARIZONA_SYSCLK_ENA_SHIFT, |
285 | 0, NULL, 0), | 306 | 0, NULL, 0), |
@@ -435,6 +456,9 @@ SND_SOC_DAPM_AIF_IN("AIF3RX1", NULL, 0, | |||
435 | SND_SOC_DAPM_AIF_IN("AIF3RX2", NULL, 0, | 456 | SND_SOC_DAPM_AIF_IN("AIF3RX2", NULL, 0, |
436 | ARIZONA_AIF3_RX_ENABLES, ARIZONA_AIF3RX2_ENA_SHIFT, 0), | 457 | ARIZONA_AIF3_RX_ENABLES, ARIZONA_AIF3RX2_ENA_SHIFT, 0), |
437 | 458 | ||
459 | SND_SOC_DAPM_VALUE_MUX("AEC Loopback", ARIZONA_DAC_AEC_CONTROL_1, | ||
460 | ARIZONA_AEC_LOOPBACK_ENA, 0, &wm5102_aec_loopback_mux), | ||
461 | |||
438 | SND_SOC_DAPM_PGA_E("OUT1L", ARIZONA_OUTPUT_ENABLES_1, | 462 | SND_SOC_DAPM_PGA_E("OUT1L", ARIZONA_OUTPUT_ENABLES_1, |
439 | ARIZONA_OUT1L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev, | 463 | ARIZONA_OUT1L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev, |
440 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU), | 464 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU), |
@@ -532,6 +556,7 @@ SND_SOC_DAPM_OUTPUT("SPKDAT1R"), | |||
532 | { name, "Noise Generator", "Noise Generator" }, \ | 556 | { name, "Noise Generator", "Noise Generator" }, \ |
533 | { name, "Tone Generator 1", "Tone Generator 1" }, \ | 557 | { name, "Tone Generator 1", "Tone Generator 1" }, \ |
534 | { name, "Tone Generator 2", "Tone Generator 2" }, \ | 558 | { name, "Tone Generator 2", "Tone Generator 2" }, \ |
559 | { name, "AEC", "AEC Loopback" }, \ | ||
535 | { name, "IN1L", "IN1L PGA" }, \ | 560 | { name, "IN1L", "IN1L PGA" }, \ |
536 | { name, "IN1R", "IN1R PGA" }, \ | 561 | { name, "IN1R", "IN1R PGA" }, \ |
537 | { name, "IN2L", "IN2L PGA" }, \ | 562 | { name, "IN2L", "IN2L PGA" }, \ |
@@ -692,21 +717,30 @@ static const struct snd_soc_dapm_route wm5102_dapm_routes[] = { | |||
692 | ARIZONA_MIXER_ROUTES("ASRC2L", "ASRC2L"), | 717 | ARIZONA_MIXER_ROUTES("ASRC2L", "ASRC2L"), |
693 | ARIZONA_MIXER_ROUTES("ASRC2R", "ASRC2R"), | 718 | ARIZONA_MIXER_ROUTES("ASRC2R", "ASRC2R"), |
694 | 719 | ||
720 | { "AEC Loopback", "HPOUT1L", "OUT1L" }, | ||
721 | { "AEC Loopback", "HPOUT1R", "OUT1R" }, | ||
695 | { "HPOUT1L", NULL, "OUT1L" }, | 722 | { "HPOUT1L", NULL, "OUT1L" }, |
696 | { "HPOUT1R", NULL, "OUT1R" }, | 723 | { "HPOUT1R", NULL, "OUT1R" }, |
697 | 724 | ||
725 | { "AEC Loopback", "HPOUT2L", "OUT2L" }, | ||
726 | { "AEC Loopback", "HPOUT2R", "OUT2R" }, | ||
698 | { "HPOUT2L", NULL, "OUT2L" }, | 727 | { "HPOUT2L", NULL, "OUT2L" }, |
699 | { "HPOUT2R", NULL, "OUT2R" }, | 728 | { "HPOUT2R", NULL, "OUT2R" }, |
700 | 729 | ||
730 | { "AEC Loopback", "EPOUT", "OUT3L" }, | ||
701 | { "EPOUTN", NULL, "OUT3L" }, | 731 | { "EPOUTN", NULL, "OUT3L" }, |
702 | { "EPOUTP", NULL, "OUT3L" }, | 732 | { "EPOUTP", NULL, "OUT3L" }, |
703 | 733 | ||
734 | { "AEC Loopback", "SPKOUTL", "OUT4L" }, | ||
704 | { "SPKOUTLN", NULL, "OUT4L" }, | 735 | { "SPKOUTLN", NULL, "OUT4L" }, |
705 | { "SPKOUTLP", NULL, "OUT4L" }, | 736 | { "SPKOUTLP", NULL, "OUT4L" }, |
706 | 737 | ||
738 | { "AEC Loopback", "SPKOUTR", "OUT4R" }, | ||
707 | { "SPKOUTRN", NULL, "OUT4R" }, | 739 | { "SPKOUTRN", NULL, "OUT4R" }, |
708 | { "SPKOUTRP", NULL, "OUT4R" }, | 740 | { "SPKOUTRP", NULL, "OUT4R" }, |
709 | 741 | ||
742 | { "AEC Loopback", "SPKDAT1L", "OUT5L" }, | ||
743 | { "AEC Loopback", "SPKDAT1R", "OUT5R" }, | ||
710 | { "SPKDAT1L", NULL, "OUT5L" }, | 744 | { "SPKDAT1L", NULL, "OUT5L" }, |
711 | { "SPKDAT1R", NULL, "OUT5R" }, | 745 | { "SPKDAT1R", NULL, "OUT5R" }, |
712 | }; | 746 | }; |