Skip to content

Commit 805238b

Browse files
Peter Ujfalusibroonie
authored andcommitted
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 <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent 7f51e7d commit 805238b

File tree

1 file changed

+29
-14
lines changed

1 file changed

+29
-14
lines changed

sound/soc/codecs/twl6040.c

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -727,10 +727,8 @@ static const struct snd_soc_dapm_widget twl6040_dapm_widgets[] = {
727727
TWL6040_REG_MICRCTL, 1, 0, NULL, 0),
728728

729729
/* ADCs */
730-
SND_SOC_DAPM_ADC("ADC Left", "Left Front Capture",
731-
TWL6040_REG_MICLCTL, 2, 0),
732-
SND_SOC_DAPM_ADC("ADC Right", "Right Front Capture",
733-
TWL6040_REG_MICRCTL, 2, 0),
730+
SND_SOC_DAPM_ADC("ADC Left", NULL, TWL6040_REG_MICLCTL, 2, 0),
731+
SND_SOC_DAPM_ADC("ADC Right", NULL, TWL6040_REG_MICRCTL, 2, 0),
734732

735733
/* Microphone bias */
736734
SND_SOC_DAPM_SUPPLY("Headset Mic Bias",
@@ -743,15 +741,12 @@ static const struct snd_soc_dapm_widget twl6040_dapm_widgets[] = {
743741
TWL6040_REG_DMICBCTL, 4, 0, NULL, 0),
744742

745743
/* DACs */
746-
SND_SOC_DAPM_DAC("HSDAC Left", "Headset Playback", SND_SOC_NOPM, 0, 0),
747-
SND_SOC_DAPM_DAC("HSDAC Right", "Headset Playback", SND_SOC_NOPM, 0, 0),
748-
SND_SOC_DAPM_DAC("HFDAC Left", "Handsfree Playback",
749-
TWL6040_REG_HFLCTL, 0, 0),
750-
SND_SOC_DAPM_DAC("HFDAC Right", "Handsfree Playback",
751-
TWL6040_REG_HFRCTL, 0, 0),
744+
SND_SOC_DAPM_DAC("HSDAC Left", NULL, SND_SOC_NOPM, 0, 0),
745+
SND_SOC_DAPM_DAC("HSDAC Right", NULL, SND_SOC_NOPM, 0, 0),
746+
SND_SOC_DAPM_DAC("HFDAC Left", NULL, TWL6040_REG_HFLCTL, 0, 0),
747+
SND_SOC_DAPM_DAC("HFDAC Right", NULL, TWL6040_REG_HFRCTL, 0, 0),
752748
/* Virtual DAC for vibra path (DL4 channel) */
753-
SND_SOC_DAPM_DAC("VIBRA DAC", "Vibra Playback",
754-
SND_SOC_NOPM, 0, 0),
749+
SND_SOC_DAPM_DAC("VIBRA DAC", NULL, SND_SOC_NOPM, 0, 0),
755750

756751
SND_SOC_DAPM_MUX("Handsfree Left Playback",
757752
SND_SOC_NOPM, 0, 0, &hfl_mux_controls),
@@ -810,6 +805,26 @@ static const struct snd_soc_dapm_widget twl6040_dapm_widgets[] = {
810805
};
811806

812807
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+
813828
/* Capture path */
814829
{"Analog Left Capture Route", "Headset Mic", "HSMIC"},
815830
{"Analog Left Capture Route", "Main Mic", "MAINMIC"},
@@ -1028,14 +1043,14 @@ static struct snd_soc_dai_driver twl6040_dai[] = {
10281043
{
10291044
.name = "twl6040-legacy",
10301045
.playback = {
1031-
.stream_name = "Playback",
1046+
.stream_name = "Legacy Playback",
10321047
.channels_min = 1,
10331048
.channels_max = 5,
10341049
.rates = TWL6040_RATES,
10351050
.formats = TWL6040_FORMATS,
10361051
},
10371052
.capture = {
1038-
.stream_name = "Capture",
1053+
.stream_name = "Legacy Capture",
10391054
.channels_min = 1,
10401055
.channels_max = 2,
10411056
.rates = TWL6040_RATES,

0 commit comments

Comments
 (0)