Skip to content

Commit 7f51e7d

Browse files
Peter Ujfalusibroonie
authored andcommitted
ASoC: twl4030: 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: twl4030-codec twl4030-codec: Failed to create Capture debugfs file Signed-off-by: Peter Ujfalusi <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent 0534951 commit 7f51e7d

File tree

1 file changed

+28
-20
lines changed

1 file changed

+28
-20
lines changed

sound/soc/codecs/twl4030.c

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,16 +1237,11 @@ static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = {
12371237
SND_SOC_DAPM_OUTPUT("Virtual Voice OUT"),
12381238

12391239
/* DACs */
1240-
SND_SOC_DAPM_DAC("DAC Right1", "Right Front HiFi Playback",
1241-
SND_SOC_NOPM, 0, 0),
1242-
SND_SOC_DAPM_DAC("DAC Left1", "Left Front HiFi Playback",
1243-
SND_SOC_NOPM, 0, 0),
1244-
SND_SOC_DAPM_DAC("DAC Right2", "Right Rear HiFi Playback",
1245-
SND_SOC_NOPM, 0, 0),
1246-
SND_SOC_DAPM_DAC("DAC Left2", "Left Rear HiFi Playback",
1247-
SND_SOC_NOPM, 0, 0),
1248-
SND_SOC_DAPM_DAC("DAC Voice", "Voice Playback",
1249-
SND_SOC_NOPM, 0, 0),
1240+
SND_SOC_DAPM_DAC("DAC Right1", NULL, SND_SOC_NOPM, 0, 0),
1241+
SND_SOC_DAPM_DAC("DAC Left1", NULL, SND_SOC_NOPM, 0, 0),
1242+
SND_SOC_DAPM_DAC("DAC Right2", NULL, SND_SOC_NOPM, 0, 0),
1243+
SND_SOC_DAPM_DAC("DAC Left2", NULL, SND_SOC_NOPM, 0, 0),
1244+
SND_SOC_DAPM_DAC("DAC Voice", NULL, SND_SOC_NOPM, 0, 0),
12501245

12511246
/* Analog bypasses */
12521247
SND_SOC_DAPM_SWITCH("Right1 Analog Loopback", SND_SOC_NOPM, 0, 0,
@@ -1375,14 +1370,10 @@ static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = {
13751370

13761371
/* Introducing four virtual ADC, since TWL4030 have four channel for
13771372
capture */
1378-
SND_SOC_DAPM_ADC("ADC Virtual Left1", "Left Front Capture",
1379-
SND_SOC_NOPM, 0, 0),
1380-
SND_SOC_DAPM_ADC("ADC Virtual Right1", "Right Front Capture",
1381-
SND_SOC_NOPM, 0, 0),
1382-
SND_SOC_DAPM_ADC("ADC Virtual Left2", "Left Rear Capture",
1383-
SND_SOC_NOPM, 0, 0),
1384-
SND_SOC_DAPM_ADC("ADC Virtual Right2", "Right Rear Capture",
1385-
SND_SOC_NOPM, 0, 0),
1373+
SND_SOC_DAPM_ADC("ADC Virtual Left1", NULL, SND_SOC_NOPM, 0, 0),
1374+
SND_SOC_DAPM_ADC("ADC Virtual Right1", NULL, SND_SOC_NOPM, 0, 0),
1375+
SND_SOC_DAPM_ADC("ADC Virtual Left2", NULL, SND_SOC_NOPM, 0, 0),
1376+
SND_SOC_DAPM_ADC("ADC Virtual Right2", NULL, SND_SOC_NOPM, 0, 0),
13861377

13871378
/* Analog/Digital mic path selection.
13881379
TX1 Left/Right: either analog Left/Right or Digimic0
@@ -1426,6 +1417,23 @@ static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = {
14261417
};
14271418

14281419
static const struct snd_soc_dapm_route intercon[] = {
1420+
/* Stream -> DAC mapping */
1421+
{"DAC Right1", NULL, "HiFi Playback"},
1422+
{"DAC Left1", NULL, "HiFi Playback"},
1423+
{"DAC Right2", NULL, "HiFi Playback"},
1424+
{"DAC Left2", NULL, "HiFi Playback"},
1425+
{"DAC Voice", NULL, "Voice Playback"},
1426+
1427+
/* ADC -> Stream mapping */
1428+
{"HiFi Capture", NULL, "ADC Virtual Left1"},
1429+
{"HiFi Capture", NULL, "ADC Virtual Right1"},
1430+
{"HiFi Capture", NULL, "ADC Virtual Left2"},
1431+
{"HiFi Capture", NULL, "ADC Virtual Right2"},
1432+
{"Voice Capture", NULL, "ADC Virtual Left1"},
1433+
{"Voice Capture", NULL, "ADC Virtual Right1"},
1434+
{"Voice Capture", NULL, "ADC Virtual Left2"},
1435+
{"Voice Capture", NULL, "ADC Virtual Right2"},
1436+
14291437
{"Digital L1 Playback Mixer", NULL, "DAC Left1"},
14301438
{"Digital R1 Playback Mixer", NULL, "DAC Right1"},
14311439
{"Digital L2 Playback Mixer", NULL, "DAC Left2"},
@@ -2170,7 +2178,7 @@ static struct snd_soc_dai_driver twl4030_dai[] = {
21702178
.formats = TWL4030_FORMATS,
21712179
.sig_bits = 24,},
21722180
.capture = {
2173-
.stream_name = "Capture",
2181+
.stream_name = "HiFi Capture",
21742182
.channels_min = 2,
21752183
.channels_max = 4,
21762184
.rates = TWL4030_RATES,
@@ -2187,7 +2195,7 @@ static struct snd_soc_dai_driver twl4030_dai[] = {
21872195
.rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000,
21882196
.formats = SNDRV_PCM_FMTBIT_S16_LE,},
21892197
.capture = {
2190-
.stream_name = "Capture",
2198+
.stream_name = "Voice Capture",
21912199
.channels_min = 1,
21922200
.channels_max = 2,
21932201
.rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000,

0 commit comments

Comments
 (0)