diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2012-09-20 09:32:15 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-09-22 10:57:41 -0400 |
commit | 805238b1b76c8f4f17a92f50c12664a8e6f3564f (patch) | |
tree | 2ac2cce44d06d6517594263457f0953b61066e07 /sound | |
parent | 7f51e7d30e36ac987d7a0e480d890477c5f8b04f (diff) |
ASoC: twl6040: Convert to use DAI DAPM widgets
Use DAPM mapping for stream events and give unique names for the streams.
This change also fixes the following warning:
twl6040-codec twl6040-codec: Failed to create Capture debugfs file
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/twl6040.c | 43 |
1 files changed, 29 insertions, 14 deletions
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c index c084c549942e..e8f97af75928 100644 --- a/sound/soc/codecs/twl6040.c +++ b/sound/soc/codecs/twl6040.c | |||
@@ -727,10 +727,8 @@ static const struct snd_soc_dapm_widget twl6040_dapm_widgets[] = { | |||
727 | TWL6040_REG_MICRCTL, 1, 0, NULL, 0), | 727 | TWL6040_REG_MICRCTL, 1, 0, NULL, 0), |
728 | 728 | ||
729 | /* ADCs */ | 729 | /* ADCs */ |
730 | SND_SOC_DAPM_ADC("ADC Left", "Left Front Capture", | 730 | SND_SOC_DAPM_ADC("ADC Left", NULL, TWL6040_REG_MICLCTL, 2, 0), |
731 | TWL6040_REG_MICLCTL, 2, 0), | 731 | SND_SOC_DAPM_ADC("ADC Right", NULL, TWL6040_REG_MICRCTL, 2, 0), |
732 | SND_SOC_DAPM_ADC("ADC Right", "Right Front Capture", | ||
733 | TWL6040_REG_MICRCTL, 2, 0), | ||
734 | 732 | ||
735 | /* Microphone bias */ | 733 | /* Microphone bias */ |
736 | SND_SOC_DAPM_SUPPLY("Headset Mic Bias", | 734 | SND_SOC_DAPM_SUPPLY("Headset Mic Bias", |
@@ -743,15 +741,12 @@ static const struct snd_soc_dapm_widget twl6040_dapm_widgets[] = { | |||
743 | TWL6040_REG_DMICBCTL, 4, 0, NULL, 0), | 741 | TWL6040_REG_DMICBCTL, 4, 0, NULL, 0), |
744 | 742 | ||
745 | /* DACs */ | 743 | /* DACs */ |
746 | SND_SOC_DAPM_DAC("HSDAC Left", "Headset Playback", SND_SOC_NOPM, 0, 0), | 744 | SND_SOC_DAPM_DAC("HSDAC Left", NULL, SND_SOC_NOPM, 0, 0), |
747 | SND_SOC_DAPM_DAC("HSDAC Right", "Headset Playback", SND_SOC_NOPM, 0, 0), | 745 | SND_SOC_DAPM_DAC("HSDAC Right", NULL, SND_SOC_NOPM, 0, 0), |
748 | SND_SOC_DAPM_DAC("HFDAC Left", "Handsfree Playback", | 746 | SND_SOC_DAPM_DAC("HFDAC Left", NULL, TWL6040_REG_HFLCTL, 0, 0), |
749 | TWL6040_REG_HFLCTL, 0, 0), | 747 | SND_SOC_DAPM_DAC("HFDAC Right", NULL, TWL6040_REG_HFRCTL, 0, 0), |
750 | SND_SOC_DAPM_DAC("HFDAC Right", "Handsfree Playback", | ||
751 | TWL6040_REG_HFRCTL, 0, 0), | ||
752 | /* Virtual DAC for vibra path (DL4 channel) */ | 748 | /* Virtual DAC for vibra path (DL4 channel) */ |
753 | SND_SOC_DAPM_DAC("VIBRA DAC", "Vibra Playback", | 749 | SND_SOC_DAPM_DAC("VIBRA DAC", NULL, SND_SOC_NOPM, 0, 0), |
754 | SND_SOC_NOPM, 0, 0), | ||
755 | 750 | ||
756 | SND_SOC_DAPM_MUX("Handsfree Left Playback", | 751 | SND_SOC_DAPM_MUX("Handsfree Left Playback", |
757 | SND_SOC_NOPM, 0, 0, &hfl_mux_controls), | 752 | SND_SOC_NOPM, 0, 0, &hfl_mux_controls), |
@@ -810,6 +805,26 @@ static const struct snd_soc_dapm_widget twl6040_dapm_widgets[] = { | |||
810 | }; | 805 | }; |
811 | 806 | ||
812 | static const struct snd_soc_dapm_route intercon[] = { | 807 | static const struct snd_soc_dapm_route intercon[] = { |
808 | /* Stream -> DAC mapping */ | ||
809 | {"HSDAC Left", NULL, "Legacy Playback"}, | ||
810 | {"HSDAC Left", NULL, "Headset Playback"}, | ||
811 | {"HSDAC Right", NULL, "Legacy Playback"}, | ||
812 | {"HSDAC Right", NULL, "Headset Playback"}, | ||
813 | |||
814 | {"HFDAC Left", NULL, "Legacy Playback"}, | ||
815 | {"HFDAC Left", NULL, "Handsfree Playback"}, | ||
816 | {"HFDAC Right", NULL, "Legacy Playback"}, | ||
817 | {"HFDAC Right", NULL, "Handsfree Playback"}, | ||
818 | |||
819 | {"VIBRA DAC", NULL, "Legacy Playback"}, | ||
820 | {"VIBRA DAC", NULL, "Vibra Playback"}, | ||
821 | |||
822 | /* ADC -> Stream mapping */ | ||
823 | {"ADC Left", NULL, "Legacy Capture"}, | ||
824 | {"ADC Left", NULL, "Capture"}, | ||
825 | {"ADC Right", NULL, "Legacy Capture"}, | ||
826 | {"ADC Right", NULL, "Capture"}, | ||
827 | |||
813 | /* Capture path */ | 828 | /* Capture path */ |
814 | {"Analog Left Capture Route", "Headset Mic", "HSMIC"}, | 829 | {"Analog Left Capture Route", "Headset Mic", "HSMIC"}, |
815 | {"Analog Left Capture Route", "Main Mic", "MAINMIC"}, | 830 | {"Analog Left Capture Route", "Main Mic", "MAINMIC"}, |
@@ -1028,14 +1043,14 @@ static struct snd_soc_dai_driver twl6040_dai[] = { | |||
1028 | { | 1043 | { |
1029 | .name = "twl6040-legacy", | 1044 | .name = "twl6040-legacy", |
1030 | .playback = { | 1045 | .playback = { |
1031 | .stream_name = "Playback", | 1046 | .stream_name = "Legacy Playback", |
1032 | .channels_min = 1, | 1047 | .channels_min = 1, |
1033 | .channels_max = 5, | 1048 | .channels_max = 5, |
1034 | .rates = TWL6040_RATES, | 1049 | .rates = TWL6040_RATES, |
1035 | .formats = TWL6040_FORMATS, | 1050 | .formats = TWL6040_FORMATS, |
1036 | }, | 1051 | }, |
1037 | .capture = { | 1052 | .capture = { |
1038 | .stream_name = "Capture", | 1053 | .stream_name = "Legacy Capture", |
1039 | .channels_min = 1, | 1054 | .channels_min = 1, |
1040 | .channels_max = 2, | 1055 | .channels_max = 2, |
1041 | .rates = TWL6040_RATES, | 1056 | .rates = TWL6040_RATES, |