diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-02-09 08:47:08 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-02-09 17:48:26 -0500 |
commit | 1e113bf9e088f1a6f4a1cdadce598ccc340f8fc1 (patch) | |
tree | e68c87e5eec4d9012122bc781e09861b46cca56e /sound/soc/codecs/wm8903.c | |
parent | 1d8d62d637577afc568da32e3ecc7bddc11db56d (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.c | 66 |
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 = | |||
674 | static const struct soc_enum rsidetone_enum = | 674 | static 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 | ||
677 | static const char *aif_text[] = { | ||
678 | "Left", "Right" | ||
679 | }; | ||
680 | |||
681 | static const struct soc_enum lcapture_enum = | ||
682 | SOC_ENUM_SINGLE(WM8903_AUDIO_INTERFACE_0, 7, 2, aif_text); | ||
683 | |||
684 | static const struct soc_enum rcapture_enum = | ||
685 | SOC_ENUM_SINGLE(WM8903_AUDIO_INTERFACE_0, 6, 2, aif_text); | ||
686 | |||
687 | static const struct soc_enum lplay_enum = | ||
688 | SOC_ENUM_SINGLE(WM8903_AUDIO_INTERFACE_0, 5, 2, aif_text); | ||
689 | |||
690 | static const struct soc_enum rplay_enum = | ||
691 | SOC_ENUM_SINGLE(WM8903_AUDIO_INTERFACE_0, 4, 2, aif_text); | ||
692 | |||
677 | static const struct snd_kcontrol_new wm8903_snd_controls[] = { | 693 | static 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 = | |||
791 | static const struct snd_kcontrol_new rsidetone_mux = | 807 | static 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 | ||
810 | static const struct snd_kcontrol_new lcapture_mux = | ||
811 | SOC_DAPM_ENUM("Left Capture Mux", lcapture_enum); | ||
812 | |||
813 | static const struct snd_kcontrol_new rcapture_mux = | ||
814 | SOC_DAPM_ENUM("Right Capture Mux", rcapture_enum); | ||
815 | |||
816 | static const struct snd_kcontrol_new lplay_mux = | ||
817 | SOC_DAPM_ENUM("Left Playback Mux", lplay_enum); | ||
818 | |||
819 | static const struct snd_kcontrol_new rplay_mux = | ||
820 | SOC_DAPM_ENUM("Right Playback Mux", rplay_enum); | ||
821 | |||
794 | static const struct snd_kcontrol_new left_output_mixer[] = { | 822 | static const struct snd_kcontrol_new left_output_mixer[] = { |
795 | SOC_DAPM_SINGLE("DACL Switch", WM8903_ANALOGUE_LEFT_MIX_0, 3, 1, 0), | 823 | SOC_DAPM_SINGLE("DACL Switch", WM8903_ANALOGUE_LEFT_MIX_0, 3, 1, 0), |
796 | SOC_DAPM_SINGLE("DACR Switch", WM8903_ANALOGUE_LEFT_MIX_0, 2, 1, 0), | 824 | SOC_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), | |||
854 | SND_SOC_DAPM_PGA("Left Input PGA", WM8903_POWER_MANAGEMENT_0, 1, 0, NULL, 0), | 882 | SND_SOC_DAPM_PGA("Left Input PGA", WM8903_POWER_MANAGEMENT_0, 1, 0, NULL, 0), |
855 | SND_SOC_DAPM_PGA("Right Input PGA", WM8903_POWER_MANAGEMENT_0, 0, 0, NULL, 0), | 883 | SND_SOC_DAPM_PGA("Right Input PGA", WM8903_POWER_MANAGEMENT_0, 0, 0, NULL, 0), |
856 | 884 | ||
857 | SND_SOC_DAPM_ADC("ADCL", "Left HiFi Capture", WM8903_POWER_MANAGEMENT_6, 1, 0), | 885 | SND_SOC_DAPM_ADC("ADCL", NULL, WM8903_POWER_MANAGEMENT_6, 1, 0), |
858 | SND_SOC_DAPM_ADC("ADCR", "Right HiFi Capture", WM8903_POWER_MANAGEMENT_6, 0, 0), | 886 | SND_SOC_DAPM_ADC("ADCR", NULL, WM8903_POWER_MANAGEMENT_6, 0, 0), |
887 | |||
888 | SND_SOC_DAPM_MUX("Left Capture Mux", SND_SOC_NOPM, 0, 0, &lcapture_mux), | ||
889 | SND_SOC_DAPM_MUX("Right Capture Mux", SND_SOC_NOPM, 0, 0, &rcapture_mux), | ||
890 | |||
891 | SND_SOC_DAPM_AIF_OUT("AIFTXL", "Left HiFi Capture", 0, SND_SOC_NOPM, 0, 0), | ||
892 | SND_SOC_DAPM_AIF_OUT("AIFTXR", "Right HiFi Capture", 0, SND_SOC_NOPM, 0, 0), | ||
859 | 893 | ||
860 | SND_SOC_DAPM_MUX("DACL Sidetone", SND_SOC_NOPM, 0, 0, &lsidetone_mux), | 894 | SND_SOC_DAPM_MUX("DACL Sidetone", SND_SOC_NOPM, 0, 0, &lsidetone_mux), |
861 | SND_SOC_DAPM_MUX("DACR Sidetone", SND_SOC_NOPM, 0, 0, &rsidetone_mux), | 895 | SND_SOC_DAPM_MUX("DACR Sidetone", SND_SOC_NOPM, 0, 0, &rsidetone_mux), |
862 | 896 | ||
863 | SND_SOC_DAPM_DAC("DACL", "Left Playback", WM8903_POWER_MANAGEMENT_6, 3, 0), | 897 | SND_SOC_DAPM_AIF_IN("AIFRXL", "Left Playback", 0, SND_SOC_NOPM, 0, 0), |
864 | SND_SOC_DAPM_DAC("DACR", "Right Playback", WM8903_POWER_MANAGEMENT_6, 2, 0), | 898 | SND_SOC_DAPM_AIF_IN("AIFRXR", "Right Playback", 0, SND_SOC_NOPM, 0, 0), |
899 | |||
900 | SND_SOC_DAPM_MUX("Left Playback Mux", SND_SOC_NOPM, 0, 0, &lplay_mux), | ||
901 | SND_SOC_DAPM_MUX("Right Playback Mux", SND_SOC_NOPM, 0, 0, &rplay_mux), | ||
902 | |||
903 | SND_SOC_DAPM_DAC("DACL", NULL, WM8903_POWER_MANAGEMENT_6, 3, 0), | ||
904 | SND_SOC_DAPM_DAC("DACR", NULL, WM8903_POWER_MANAGEMENT_6, 2, 0), | ||
865 | 905 | ||
866 | SND_SOC_DAPM_MIXER("Left Output Mixer", WM8903_POWER_MANAGEMENT_1, 1, 0, | 906 | SND_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 | ||