ASoC: twl4030: Correct the support for Voice port
authorPeter Ujfalusi <peter.ujfalusi@ti.com>
Mon, 31 Dec 2012 10:51:42 +0000 (11:51 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 2 Jan 2013 13:04:24 +0000 (13:04 +0000)
In order to be able to use the Voice port of twl4030 three bits need to be
handled in VOICE_IF register:
VIF_EN: to enable the voice port (needed for both playback and capture)
VIF_DIN_EN: Need to be enabled for playback only (input to the codec)
VIF_DOUT_EN: Need to be enabled for capture only (output from codec)

Use DAPM_SUPPLY for the VIF_EN bit and add DAPM_AIF_IO/OUT widget to handle
the playback/capture bit.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/codecs/twl4030.c

index 63b280b060359f12ffda4f018f4f9e012f32eac2..79b2f86f61cf367961935e5ed0dd4dfa930cda9d 100644 (file)
@@ -1306,6 +1306,9 @@ static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = {
        SND_SOC_DAPM_DAC("DAC Left2", NULL, SND_SOC_NOPM, 0, 0),
        SND_SOC_DAPM_DAC("DAC Voice", NULL, SND_SOC_NOPM, 0, 0),
 
+       SND_SOC_DAPM_AIF_IN("VAIFIN", "Voice Playback", 0,
+                           TWL4030_REG_VOICE_IF, 6, 0),
+
        /* Analog bypasses */
        SND_SOC_DAPM_SWITCH("Right1 Analog Loopback", SND_SOC_NOPM, 0, 0,
                        &twl4030_dapm_abypassr1_control),
@@ -1438,6 +1441,9 @@ static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = {
        SND_SOC_DAPM_ADC("ADC Virtual Left2", NULL, SND_SOC_NOPM, 0, 0),
        SND_SOC_DAPM_ADC("ADC Virtual Right2", NULL, SND_SOC_NOPM, 0, 0),
 
+       SND_SOC_DAPM_AIF_OUT("VAIFOUT", "Voice Capture", 0,
+                            TWL4030_REG_VOICE_IF, 5, 0),
+
        /* Analog/Digital mic path selection.
           TX1 Left/Right: either analog Left/Right or Digimic0
           TX2 Left/Right: either analog Left/Right or Digimic1 */
@@ -1477,6 +1483,7 @@ static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = {
        SND_SOC_DAPM_MICBIAS("Mic Bias 2", TWL4030_REG_MICBIAS_CTL, 1, 0),
        SND_SOC_DAPM_MICBIAS("Headset Mic Bias", TWL4030_REG_MICBIAS_CTL, 2, 0),
 
+       SND_SOC_DAPM_SUPPLY("VIF Enable", TWL4030_REG_VOICE_IF, 0, 0, NULL, 0),
 };
 
 static const struct snd_soc_dapm_route intercon[] = {
@@ -1485,17 +1492,16 @@ static const struct snd_soc_dapm_route intercon[] = {
        {"DAC Left1", NULL, "HiFi Playback"},
        {"DAC Right2", NULL, "HiFi Playback"},
        {"DAC Left2", NULL, "HiFi Playback"},
-       {"DAC Voice", NULL, "Voice Playback"},
+       {"DAC Voice", NULL, "VAIFIN"},
 
        /* ADC -> Stream mapping */
        {"HiFi Capture", NULL, "ADC Virtual Left1"},
        {"HiFi Capture", NULL, "ADC Virtual Right1"},
        {"HiFi Capture", NULL, "ADC Virtual Left2"},
        {"HiFi Capture", NULL, "ADC Virtual Right2"},
-       {"Voice Capture", NULL, "ADC Virtual Left1"},
-       {"Voice Capture", NULL, "ADC Virtual Right1"},
-       {"Voice Capture", NULL, "ADC Virtual Left2"},
-       {"Voice Capture", NULL, "ADC Virtual Right2"},
+       {"VAIFOUT", NULL, "ADC Virtual Left2"},
+       {"VAIFOUT", NULL, "ADC Virtual Right2"},
+       {"VAIFOUT", NULL, "VIF Enable"},
 
        {"Digital L1 Playback Mixer", NULL, "DAC Left1"},
        {"Digital R1 Playback Mixer", NULL, "DAC Right1"},
@@ -1510,6 +1516,7 @@ static const struct snd_soc_dapm_route intercon[] = {
        {"DAC Right1", NULL, "AIF Enable"},
        {"DAC Left2", NULL, "AIF Enable"},
        {"DAC Right1", NULL, "AIF Enable"},
+       {"DAC Voice", NULL, "VIF Enable"},
 
        {"Digital R2 Playback Mixer", NULL, "AIF Enable"},
        {"Digital L2 Playback Mixer", NULL, "AIF Enable"},