diff options
author | Dilan Lee <dilee@nvidia.com> | 2011-04-07 13:08:38 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-04-07 20:17:11 -0400 |
commit | 1b877cb57a8e329e571cd41b60ed51ba8f8c9edd (patch) | |
tree | 8ba661dd3ac4daaa523566de7d07e0223b244911 /sound/soc/codecs/wm8903.c | |
parent | baa8160382e2818179d025063697ce0a471ec48f (diff) |
ASoC: WM8903: HP and Line out PGA/mixer DAPM fixes
Update the headphone and line out mixers and PGAs use the same logical
set of register bits and sequencing as the speaker mixer/PGA.
This allows ALSA controls for mute and volume on headphone and line out
to operate correctly.
Per conversation on alsa-devel, earlier datasheets indicated that the
POWER_MANAGEMENT_* register bits 0 and 1 were aliases to ANALOG_* register
bits 0 and 4, and hence only one copy of those bits was programmed.
However, later datasheets corrected this.
From: Dilan Lee <dilee@nvidia.com>
[swarren: Applied same change to headphone widgets]
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/wm8903.c')
-rw-r--r-- | sound/soc/codecs/wm8903.c | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c index ae1cadfae84c..f52b623bb692 100644 --- a/sound/soc/codecs/wm8903.c +++ b/sound/soc/codecs/wm8903.c | |||
@@ -247,8 +247,6 @@ static int wm8903_volatile_register(struct snd_soc_codec *codec, unsigned int re | |||
247 | case WM8903_REVISION_NUMBER: | 247 | case WM8903_REVISION_NUMBER: |
248 | case WM8903_INTERRUPT_STATUS_1: | 248 | case WM8903_INTERRUPT_STATUS_1: |
249 | case WM8903_WRITE_SEQUENCER_4: | 249 | case WM8903_WRITE_SEQUENCER_4: |
250 | case WM8903_POWER_MANAGEMENT_3: | ||
251 | case WM8903_POWER_MANAGEMENT_2: | ||
252 | case WM8903_DC_SERVO_READBACK_1: | 250 | case WM8903_DC_SERVO_READBACK_1: |
253 | case WM8903_DC_SERVO_READBACK_2: | 251 | case WM8903_DC_SERVO_READBACK_2: |
254 | case WM8903_DC_SERVO_READBACK_3: | 252 | case WM8903_DC_SERVO_READBACK_3: |
@@ -875,34 +873,40 @@ SND_SOC_DAPM_MIXER("Left Speaker Mixer", WM8903_POWER_MANAGEMENT_4, 1, 0, | |||
875 | SND_SOC_DAPM_MIXER("Right Speaker Mixer", WM8903_POWER_MANAGEMENT_4, 0, 0, | 873 | SND_SOC_DAPM_MIXER("Right Speaker Mixer", WM8903_POWER_MANAGEMENT_4, 0, 0, |
876 | right_speaker_mixer, ARRAY_SIZE(right_speaker_mixer)), | 874 | right_speaker_mixer, ARRAY_SIZE(right_speaker_mixer)), |
877 | 875 | ||
878 | SND_SOC_DAPM_PGA_S("Left Headphone Output PGA", 0, WM8903_ANALOGUE_HP_0, | 876 | SND_SOC_DAPM_PGA_S("Left Headphone Output PGA", 0, WM8903_POWER_MANAGEMENT_2, |
879 | 4, 0, NULL, 0), | 877 | 1, 0, NULL, 0), |
880 | SND_SOC_DAPM_PGA_S("Right Headphone Output PGA", 0, WM8903_ANALOGUE_HP_0, | 878 | SND_SOC_DAPM_PGA_S("Right Headphone Output PGA", 0, WM8903_POWER_MANAGEMENT_2, |
881 | 0, 0, NULL, 0), | 879 | 0, 0, NULL, 0), |
882 | 880 | ||
883 | SND_SOC_DAPM_PGA_S("Left Line Output PGA", 0, WM8903_ANALOGUE_LINEOUT_0, 4, 0, | 881 | SND_SOC_DAPM_PGA_S("Left Line Output PGA", 0, WM8903_POWER_MANAGEMENT_3, 1, 0, |
884 | NULL, 0), | 882 | NULL, 0), |
885 | SND_SOC_DAPM_PGA_S("Right Line Output PGA", 0, WM8903_ANALOGUE_LINEOUT_0, 0, 0, | 883 | SND_SOC_DAPM_PGA_S("Right Line Output PGA", 0, WM8903_POWER_MANAGEMENT_3, 0, 0, |
886 | NULL, 0), | 884 | NULL, 0), |
887 | 885 | ||
888 | SND_SOC_DAPM_PGA_S("HPL_RMV_SHORT", 4, WM8903_ANALOGUE_HP_0, 7, 0, NULL, 0), | 886 | SND_SOC_DAPM_PGA_S("HPL_RMV_SHORT", 4, WM8903_ANALOGUE_HP_0, 7, 0, NULL, 0), |
889 | SND_SOC_DAPM_PGA_S("HPL_ENA_OUTP", 3, WM8903_ANALOGUE_HP_0, 6, 0, NULL, 0), | 887 | SND_SOC_DAPM_PGA_S("HPL_ENA_OUTP", 3, WM8903_ANALOGUE_HP_0, 6, 0, NULL, 0), |
890 | SND_SOC_DAPM_PGA_S("HPL_ENA_DLY", 1, WM8903_ANALOGUE_HP_0, 5, 0, NULL, 0), | 888 | SND_SOC_DAPM_PGA_S("HPL_ENA_DLY", 2, WM8903_ANALOGUE_HP_0, 5, 0, NULL, 0), |
889 | SND_SOC_DAPM_PGA_S("HPL_ENA", 1, WM8903_ANALOGUE_HP_0, 4, 0, NULL, 0), | ||
891 | SND_SOC_DAPM_PGA_S("HPR_RMV_SHORT", 4, WM8903_ANALOGUE_HP_0, 3, 0, NULL, 0), | 890 | SND_SOC_DAPM_PGA_S("HPR_RMV_SHORT", 4, WM8903_ANALOGUE_HP_0, 3, 0, NULL, 0), |
892 | SND_SOC_DAPM_PGA_S("HPR_ENA_OUTP", 3, WM8903_ANALOGUE_HP_0, 2, 0, NULL, 0), | 891 | SND_SOC_DAPM_PGA_S("HPR_ENA_OUTP", 3, WM8903_ANALOGUE_HP_0, 2, 0, NULL, 0), |
893 | SND_SOC_DAPM_PGA_S("HPR_ENA_DLY", 1, WM8903_ANALOGUE_HP_0, 1, 0, NULL, 0), | 892 | SND_SOC_DAPM_PGA_S("HPR_ENA_DLY", 2, WM8903_ANALOGUE_HP_0, 1, 0, NULL, 0), |
893 | SND_SOC_DAPM_PGA_S("HPR_ENA", 1, WM8903_ANALOGUE_HP_0, 0, 0, NULL, 0), | ||
894 | 894 | ||
895 | SND_SOC_DAPM_PGA_S("LINEOUTL_RMV_SHORT", 4, WM8903_ANALOGUE_LINEOUT_0, 7, 0, | 895 | SND_SOC_DAPM_PGA_S("LINEOUTL_RMV_SHORT", 4, WM8903_ANALOGUE_LINEOUT_0, 7, 0, |
896 | NULL, 0), | 896 | NULL, 0), |
897 | SND_SOC_DAPM_PGA_S("LINEOUTL_ENA_OUTP", 3, WM8903_ANALOGUE_LINEOUT_0, 6, 0, | 897 | SND_SOC_DAPM_PGA_S("LINEOUTL_ENA_OUTP", 3, WM8903_ANALOGUE_LINEOUT_0, 6, 0, |
898 | NULL, 0), | 898 | NULL, 0), |
899 | SND_SOC_DAPM_PGA_S("LINEOUTL_ENA_DLY", 1, WM8903_ANALOGUE_LINEOUT_0, 5, 0, | 899 | SND_SOC_DAPM_PGA_S("LINEOUTL_ENA_DLY", 2, WM8903_ANALOGUE_LINEOUT_0, 5, 0, |
900 | NULL, 0), | ||
901 | SND_SOC_DAPM_PGA_S("LINEOUTL_ENA", 1, WM8903_ANALOGUE_LINEOUT_0, 4, 0, | ||
900 | NULL, 0), | 902 | NULL, 0), |
901 | SND_SOC_DAPM_PGA_S("LINEOUTR_RMV_SHORT", 4, WM8903_ANALOGUE_LINEOUT_0, 3, 0, | 903 | SND_SOC_DAPM_PGA_S("LINEOUTR_RMV_SHORT", 4, WM8903_ANALOGUE_LINEOUT_0, 3, 0, |
902 | NULL, 0), | 904 | NULL, 0), |
903 | SND_SOC_DAPM_PGA_S("LINEOUTR_ENA_OUTP", 3, WM8903_ANALOGUE_LINEOUT_0, 2, 0, | 905 | SND_SOC_DAPM_PGA_S("LINEOUTR_ENA_OUTP", 3, WM8903_ANALOGUE_LINEOUT_0, 2, 0, |
904 | NULL, 0), | 906 | NULL, 0), |
905 | SND_SOC_DAPM_PGA_S("LINEOUTR_ENA_DLY", 1, WM8903_ANALOGUE_LINEOUT_0, 1, 0, | 907 | SND_SOC_DAPM_PGA_S("LINEOUTR_ENA_DLY", 2, WM8903_ANALOGUE_LINEOUT_0, 1, 0, |
908 | NULL, 0), | ||
909 | SND_SOC_DAPM_PGA_S("LINEOUTR_ENA", 1, WM8903_ANALOGUE_LINEOUT_0, 0, 0, | ||
906 | NULL, 0), | 910 | NULL, 0), |
907 | 911 | ||
908 | SND_SOC_DAPM_SUPPLY("DCS Master", WM8903_DC_SERVO_0, 4, 0, NULL, 0), | 912 | SND_SOC_DAPM_SUPPLY("DCS Master", WM8903_DC_SERVO_0, 4, 0, NULL, 0), |
@@ -1037,10 +1041,14 @@ static const struct snd_soc_dapm_route intercon[] = { | |||
1037 | { "Left Speaker PGA", NULL, "Left Speaker Mixer" }, | 1041 | { "Left Speaker PGA", NULL, "Left Speaker Mixer" }, |
1038 | { "Right Speaker PGA", NULL, "Right Speaker Mixer" }, | 1042 | { "Right Speaker PGA", NULL, "Right Speaker Mixer" }, |
1039 | 1043 | ||
1040 | { "HPL_ENA_DLY", NULL, "Left Headphone Output PGA" }, | 1044 | { "HPL_ENA", NULL, "Left Headphone Output PGA" }, |
1041 | { "HPR_ENA_DLY", NULL, "Right Headphone Output PGA" }, | 1045 | { "HPR_ENA", NULL, "Right Headphone Output PGA" }, |
1042 | { "LINEOUTL_ENA_DLY", NULL, "Left Line Output PGA" }, | 1046 | { "HPL_ENA_DLY", NULL, "HPL_ENA" }, |
1043 | { "LINEOUTR_ENA_DLY", NULL, "Right Line Output PGA" }, | 1047 | { "HPR_ENA_DLY", NULL, "HPR_ENA" }, |
1048 | { "LINEOUTL_ENA", NULL, "Left Line Output PGA" }, | ||
1049 | { "LINEOUTR_ENA", NULL, "Right Line Output PGA" }, | ||
1050 | { "LINEOUTL_ENA_DLY", NULL, "LINEOUTL_ENA" }, | ||
1051 | { "LINEOUTR_ENA_DLY", NULL, "LINEOUTR_ENA" }, | ||
1044 | 1052 | ||
1045 | { "HPL_DCS", NULL, "DCS Master" }, | 1053 | { "HPL_DCS", NULL, "DCS Master" }, |
1046 | { "HPR_DCS", NULL, "DCS Master" }, | 1054 | { "HPR_DCS", NULL, "DCS Master" }, |