aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2012-12-31 05:51:42 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-01-02 08:04:24 -0500
commit927a77476ed37080793f0e9d3211359f2d480d4d (patch)
tree02cc0b4b9e5b2bba55f5a726375352f4cb91910b /sound
parenta49f0d1ea3ec94fc7cf33a7c36a16343b74bd565 (diff)
ASoC: twl4030: Correct the support for Voice port
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>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/twl4030.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
index 63b280b06035..79b2f86f61cf 100644
--- a/sound/soc/codecs/twl4030.c
+++ b/sound/soc/codecs/twl4030.c
@@ -1306,6 +1306,9 @@ static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = {
1306 SND_SOC_DAPM_DAC("DAC Left2", NULL, SND_SOC_NOPM, 0, 0), 1306 SND_SOC_DAPM_DAC("DAC Left2", NULL, SND_SOC_NOPM, 0, 0),
1307 SND_SOC_DAPM_DAC("DAC Voice", NULL, SND_SOC_NOPM, 0, 0), 1307 SND_SOC_DAPM_DAC("DAC Voice", NULL, SND_SOC_NOPM, 0, 0),
1308 1308
1309 SND_SOC_DAPM_AIF_IN("VAIFIN", "Voice Playback", 0,
1310 TWL4030_REG_VOICE_IF, 6, 0),
1311
1309 /* Analog bypasses */ 1312 /* Analog bypasses */
1310 SND_SOC_DAPM_SWITCH("Right1 Analog Loopback", SND_SOC_NOPM, 0, 0, 1313 SND_SOC_DAPM_SWITCH("Right1 Analog Loopback", SND_SOC_NOPM, 0, 0,
1311 &twl4030_dapm_abypassr1_control), 1314 &twl4030_dapm_abypassr1_control),
@@ -1438,6 +1441,9 @@ static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = {
1438 SND_SOC_DAPM_ADC("ADC Virtual Left2", NULL, SND_SOC_NOPM, 0, 0), 1441 SND_SOC_DAPM_ADC("ADC Virtual Left2", NULL, SND_SOC_NOPM, 0, 0),
1439 SND_SOC_DAPM_ADC("ADC Virtual Right2", NULL, SND_SOC_NOPM, 0, 0), 1442 SND_SOC_DAPM_ADC("ADC Virtual Right2", NULL, SND_SOC_NOPM, 0, 0),
1440 1443
1444 SND_SOC_DAPM_AIF_OUT("VAIFOUT", "Voice Capture", 0,
1445 TWL4030_REG_VOICE_IF, 5, 0),
1446
1441 /* Analog/Digital mic path selection. 1447 /* Analog/Digital mic path selection.
1442 TX1 Left/Right: either analog Left/Right or Digimic0 1448 TX1 Left/Right: either analog Left/Right or Digimic0
1443 TX2 Left/Right: either analog Left/Right or Digimic1 */ 1449 TX2 Left/Right: either analog Left/Right or Digimic1 */
@@ -1477,6 +1483,7 @@ static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = {
1477 SND_SOC_DAPM_MICBIAS("Mic Bias 2", TWL4030_REG_MICBIAS_CTL, 1, 0), 1483 SND_SOC_DAPM_MICBIAS("Mic Bias 2", TWL4030_REG_MICBIAS_CTL, 1, 0),
1478 SND_SOC_DAPM_MICBIAS("Headset Mic Bias", TWL4030_REG_MICBIAS_CTL, 2, 0), 1484 SND_SOC_DAPM_MICBIAS("Headset Mic Bias", TWL4030_REG_MICBIAS_CTL, 2, 0),
1479 1485
1486 SND_SOC_DAPM_SUPPLY("VIF Enable", TWL4030_REG_VOICE_IF, 0, 0, NULL, 0),
1480}; 1487};
1481 1488
1482static const struct snd_soc_dapm_route intercon[] = { 1489static const struct snd_soc_dapm_route intercon[] = {
@@ -1485,17 +1492,16 @@ static const struct snd_soc_dapm_route intercon[] = {
1485 {"DAC Left1", NULL, "HiFi Playback"}, 1492 {"DAC Left1", NULL, "HiFi Playback"},
1486 {"DAC Right2", NULL, "HiFi Playback"}, 1493 {"DAC Right2", NULL, "HiFi Playback"},
1487 {"DAC Left2", NULL, "HiFi Playback"}, 1494 {"DAC Left2", NULL, "HiFi Playback"},
1488 {"DAC Voice", NULL, "Voice Playback"}, 1495 {"DAC Voice", NULL, "VAIFIN"},
1489 1496
1490 /* ADC -> Stream mapping */ 1497 /* ADC -> Stream mapping */
1491 {"HiFi Capture", NULL, "ADC Virtual Left1"}, 1498 {"HiFi Capture", NULL, "ADC Virtual Left1"},
1492 {"HiFi Capture", NULL, "ADC Virtual Right1"}, 1499 {"HiFi Capture", NULL, "ADC Virtual Right1"},
1493 {"HiFi Capture", NULL, "ADC Virtual Left2"}, 1500 {"HiFi Capture", NULL, "ADC Virtual Left2"},
1494 {"HiFi Capture", NULL, "ADC Virtual Right2"}, 1501 {"HiFi Capture", NULL, "ADC Virtual Right2"},
1495 {"Voice Capture", NULL, "ADC Virtual Left1"}, 1502 {"VAIFOUT", NULL, "ADC Virtual Left2"},
1496 {"Voice Capture", NULL, "ADC Virtual Right1"}, 1503 {"VAIFOUT", NULL, "ADC Virtual Right2"},
1497 {"Voice Capture", NULL, "ADC Virtual Left2"}, 1504 {"VAIFOUT", NULL, "VIF Enable"},
1498 {"Voice Capture", NULL, "ADC Virtual Right2"},
1499 1505
1500 {"Digital L1 Playback Mixer", NULL, "DAC Left1"}, 1506 {"Digital L1 Playback Mixer", NULL, "DAC Left1"},
1501 {"Digital R1 Playback Mixer", NULL, "DAC Right1"}, 1507 {"Digital R1 Playback Mixer", NULL, "DAC Right1"},
@@ -1510,6 +1516,7 @@ static const struct snd_soc_dapm_route intercon[] = {
1510 {"DAC Right1", NULL, "AIF Enable"}, 1516 {"DAC Right1", NULL, "AIF Enable"},
1511 {"DAC Left2", NULL, "AIF Enable"}, 1517 {"DAC Left2", NULL, "AIF Enable"},
1512 {"DAC Right1", NULL, "AIF Enable"}, 1518 {"DAC Right1", NULL, "AIF Enable"},
1519 {"DAC Voice", NULL, "VIF Enable"},
1513 1520
1514 {"Digital R2 Playback Mixer", NULL, "AIF Enable"}, 1521 {"Digital R2 Playback Mixer", NULL, "AIF Enable"},
1515 {"Digital L2 Playback Mixer", NULL, "AIF Enable"}, 1522 {"Digital L2 Playback Mixer", NULL, "AIF Enable"},