aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8903.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-02-09 08:47:08 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-02-09 17:48:26 -0500
commit1e113bf9e088f1a6f4a1cdadce598ccc340f8fc1 (patch)
treee68c87e5eec4d9012122bc781e09861b46cca56e /sound/soc/codecs/wm8903.c
parent1d8d62d637577afc568da32e3ecc7bddc11db56d (diff)
ASoC: Add support for AIF channel muxing on WM8903
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'sound/soc/codecs/wm8903.c')
-rw-r--r--sound/soc/codecs/wm8903.c66
1 files changed, 62 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c
index e6ba4d05bf2e..0190c5aa44f8 100644
--- a/sound/soc/codecs/wm8903.c
+++ b/sound/soc/codecs/wm8903.c
@@ -674,6 +674,22 @@ static const struct soc_enum lsidetone_enum =
674static const struct soc_enum rsidetone_enum = 674static const struct soc_enum rsidetone_enum =
675 SOC_ENUM_SINGLE(WM8903_DAC_DIGITAL_0, 0, 3, sidetone_text); 675 SOC_ENUM_SINGLE(WM8903_DAC_DIGITAL_0, 0, 3, sidetone_text);
676 676
677static const char *aif_text[] = {
678 "Left", "Right"
679};
680
681static const struct soc_enum lcapture_enum =
682 SOC_ENUM_SINGLE(WM8903_AUDIO_INTERFACE_0, 7, 2, aif_text);
683
684static const struct soc_enum rcapture_enum =
685 SOC_ENUM_SINGLE(WM8903_AUDIO_INTERFACE_0, 6, 2, aif_text);
686
687static const struct soc_enum lplay_enum =
688 SOC_ENUM_SINGLE(WM8903_AUDIO_INTERFACE_0, 5, 2, aif_text);
689
690static const struct soc_enum rplay_enum =
691 SOC_ENUM_SINGLE(WM8903_AUDIO_INTERFACE_0, 4, 2, aif_text);
692
677static const struct snd_kcontrol_new wm8903_snd_controls[] = { 693static const struct snd_kcontrol_new wm8903_snd_controls[] = {
678 694
679/* Input PGAs - No TLV since the scale depends on PGA mode */ 695/* Input PGAs - No TLV since the scale depends on PGA mode */
@@ -791,6 +807,18 @@ static const struct snd_kcontrol_new lsidetone_mux =
791static const struct snd_kcontrol_new rsidetone_mux = 807static const struct snd_kcontrol_new rsidetone_mux =
792 SOC_DAPM_ENUM("DACR Sidetone Mux", rsidetone_enum); 808 SOC_DAPM_ENUM("DACR Sidetone Mux", rsidetone_enum);
793 809
810static const struct snd_kcontrol_new lcapture_mux =
811 SOC_DAPM_ENUM("Left Capture Mux", lcapture_enum);
812
813static const struct snd_kcontrol_new rcapture_mux =
814 SOC_DAPM_ENUM("Right Capture Mux", rcapture_enum);
815
816static const struct snd_kcontrol_new lplay_mux =
817 SOC_DAPM_ENUM("Left Playback Mux", lplay_enum);
818
819static const struct snd_kcontrol_new rplay_mux =
820 SOC_DAPM_ENUM("Right Playback Mux", rplay_enum);
821
794static const struct snd_kcontrol_new left_output_mixer[] = { 822static const struct snd_kcontrol_new left_output_mixer[] = {
795SOC_DAPM_SINGLE("DACL Switch", WM8903_ANALOGUE_LEFT_MIX_0, 3, 1, 0), 823SOC_DAPM_SINGLE("DACL Switch", WM8903_ANALOGUE_LEFT_MIX_0, 3, 1, 0),
796SOC_DAPM_SINGLE("DACR Switch", WM8903_ANALOGUE_LEFT_MIX_0, 2, 1, 0), 824SOC_DAPM_SINGLE("DACR Switch", WM8903_ANALOGUE_LEFT_MIX_0, 2, 1, 0),
@@ -854,14 +882,26 @@ SND_SOC_DAPM_MUX("Right Input Mode Mux", SND_SOC_NOPM, 0, 0, &rinput_mode_mux),
854SND_SOC_DAPM_PGA("Left Input PGA", WM8903_POWER_MANAGEMENT_0, 1, 0, NULL, 0), 882SND_SOC_DAPM_PGA("Left Input PGA", WM8903_POWER_MANAGEMENT_0, 1, 0, NULL, 0),
855SND_SOC_DAPM_PGA("Right Input PGA", WM8903_POWER_MANAGEMENT_0, 0, 0, NULL, 0), 883SND_SOC_DAPM_PGA("Right Input PGA", WM8903_POWER_MANAGEMENT_0, 0, 0, NULL, 0),
856 884
857SND_SOC_DAPM_ADC("ADCL", "Left HiFi Capture", WM8903_POWER_MANAGEMENT_6, 1, 0), 885SND_SOC_DAPM_ADC("ADCL", NULL, WM8903_POWER_MANAGEMENT_6, 1, 0),
858SND_SOC_DAPM_ADC("ADCR", "Right HiFi Capture", WM8903_POWER_MANAGEMENT_6, 0, 0), 886SND_SOC_DAPM_ADC("ADCR", NULL, WM8903_POWER_MANAGEMENT_6, 0, 0),
887
888SND_SOC_DAPM_MUX("Left Capture Mux", SND_SOC_NOPM, 0, 0, &lcapture_mux),
889SND_SOC_DAPM_MUX("Right Capture Mux", SND_SOC_NOPM, 0, 0, &rcapture_mux),
890
891SND_SOC_DAPM_AIF_OUT("AIFTXL", "Left HiFi Capture", 0, SND_SOC_NOPM, 0, 0),
892SND_SOC_DAPM_AIF_OUT("AIFTXR", "Right HiFi Capture", 0, SND_SOC_NOPM, 0, 0),
859 893
860SND_SOC_DAPM_MUX("DACL Sidetone", SND_SOC_NOPM, 0, 0, &lsidetone_mux), 894SND_SOC_DAPM_MUX("DACL Sidetone", SND_SOC_NOPM, 0, 0, &lsidetone_mux),
861SND_SOC_DAPM_MUX("DACR Sidetone", SND_SOC_NOPM, 0, 0, &rsidetone_mux), 895SND_SOC_DAPM_MUX("DACR Sidetone", SND_SOC_NOPM, 0, 0, &rsidetone_mux),
862 896
863SND_SOC_DAPM_DAC("DACL", "Left Playback", WM8903_POWER_MANAGEMENT_6, 3, 0), 897SND_SOC_DAPM_AIF_IN("AIFRXL", "Left Playback", 0, SND_SOC_NOPM, 0, 0),
864SND_SOC_DAPM_DAC("DACR", "Right Playback", WM8903_POWER_MANAGEMENT_6, 2, 0), 898SND_SOC_DAPM_AIF_IN("AIFRXR", "Right Playback", 0, SND_SOC_NOPM, 0, 0),
899
900SND_SOC_DAPM_MUX("Left Playback Mux", SND_SOC_NOPM, 0, 0, &lplay_mux),
901SND_SOC_DAPM_MUX("Right Playback Mux", SND_SOC_NOPM, 0, 0, &rplay_mux),
902
903SND_SOC_DAPM_DAC("DACL", NULL, WM8903_POWER_MANAGEMENT_6, 3, 0),
904SND_SOC_DAPM_DAC("DACR", NULL, WM8903_POWER_MANAGEMENT_6, 2, 0),
865 905
866SND_SOC_DAPM_MIXER("Left Output Mixer", WM8903_POWER_MANAGEMENT_1, 1, 0, 906SND_SOC_DAPM_MIXER("Left Output Mixer", WM8903_POWER_MANAGEMENT_1, 1, 0,
867 left_output_mixer, ARRAY_SIZE(left_output_mixer)), 907 left_output_mixer, ARRAY_SIZE(left_output_mixer)),
@@ -943,18 +983,36 @@ static const struct snd_soc_dapm_route intercon[] = {
943 { "Left Input PGA", NULL, "Left Input Mode Mux" }, 983 { "Left Input PGA", NULL, "Left Input Mode Mux" },
944 { "Right Input PGA", NULL, "Right Input Mode Mux" }, 984 { "Right Input PGA", NULL, "Right Input Mode Mux" },
945 985
986 { "Left Capture Mux", "Left", "ADCL" },
987 { "Left Capture Mux", "Right", "ADCR" },
988
989 { "Right Capture Mux", "Left", "ADCL" },
990 { "Right Capture Mux", "Right", "ADCR" },
991
992 { "AIFTXL", NULL, "Left Capture Mux" },
993 { "AIFTXR", NULL, "Right Capture Mux" },
994
946 { "ADCL", NULL, "Left Input PGA" }, 995 { "ADCL", NULL, "Left Input PGA" },
947 { "ADCL", NULL, "CLK_DSP" }, 996 { "ADCL", NULL, "CLK_DSP" },
948 { "ADCR", NULL, "Right Input PGA" }, 997 { "ADCR", NULL, "Right Input PGA" },
949 { "ADCR", NULL, "CLK_DSP" }, 998 { "ADCR", NULL, "CLK_DSP" },
950 999
1000 { "Left Playback Mux", "Left", "AIFRXL" },
1001 { "Left Playback Mux", "Right", "AIFRXR" },
1002
1003 { "Right Playback Mux", "Left", "AIFRXL" },
1004 { "Right Playback Mux", "Right", "AIFRXR" },
1005
951 { "DACL Sidetone", "Left", "ADCL" }, 1006 { "DACL Sidetone", "Left", "ADCL" },
952 { "DACL Sidetone", "Right", "ADCR" }, 1007 { "DACL Sidetone", "Right", "ADCR" },
953 { "DACR Sidetone", "Left", "ADCL" }, 1008 { "DACR Sidetone", "Left", "ADCL" },
954 { "DACR Sidetone", "Right", "ADCR" }, 1009 { "DACR Sidetone", "Right", "ADCR" },
955 1010
1011 { "DACL", NULL, "Left Playback Mux" },
956 { "DACL", NULL, "DACL Sidetone" }, 1012 { "DACL", NULL, "DACL Sidetone" },
957 { "DACL", NULL, "CLK_DSP" }, 1013 { "DACL", NULL, "CLK_DSP" },
1014
1015 { "DACR", NULL, "Right Playback Mux" },
958 { "DACR", NULL, "DACR Sidetone" }, 1016 { "DACR", NULL, "DACR Sidetone" },
959 { "DACR", NULL, "CLK_DSP" }, 1017 { "DACR", NULL, "CLK_DSP" },
960 1018