* [PATCH] ASoC: twl6040: Convert to use DAI DAPM widgets
@ 2012-09-20 13:32 Peter Ujfalusi
2012-09-22 14:59 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Peter Ujfalusi @ 2012-09-20 13:32 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown; +Cc: alsa-devel
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>
---
sound/soc/codecs/twl6040.c | 43 +++++++++++++++++++++++++++++--------------
1 file changed, 29 insertions(+), 14 deletions(-)
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index c084c54..e8f97af 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[] = {
TWL6040_REG_MICRCTL, 1, 0, NULL, 0),
/* ADCs */
- SND_SOC_DAPM_ADC("ADC Left", "Left Front Capture",
- TWL6040_REG_MICLCTL, 2, 0),
- SND_SOC_DAPM_ADC("ADC Right", "Right Front Capture",
- TWL6040_REG_MICRCTL, 2, 0),
+ SND_SOC_DAPM_ADC("ADC Left", NULL, TWL6040_REG_MICLCTL, 2, 0),
+ SND_SOC_DAPM_ADC("ADC Right", NULL, TWL6040_REG_MICRCTL, 2, 0),
/* Microphone bias */
SND_SOC_DAPM_SUPPLY("Headset Mic Bias",
@@ -743,15 +741,12 @@ static const struct snd_soc_dapm_widget twl6040_dapm_widgets[] = {
TWL6040_REG_DMICBCTL, 4, 0, NULL, 0),
/* DACs */
- SND_SOC_DAPM_DAC("HSDAC Left", "Headset Playback", SND_SOC_NOPM, 0, 0),
- SND_SOC_DAPM_DAC("HSDAC Right", "Headset Playback", SND_SOC_NOPM, 0, 0),
- SND_SOC_DAPM_DAC("HFDAC Left", "Handsfree Playback",
- TWL6040_REG_HFLCTL, 0, 0),
- SND_SOC_DAPM_DAC("HFDAC Right", "Handsfree Playback",
- TWL6040_REG_HFRCTL, 0, 0),
+ SND_SOC_DAPM_DAC("HSDAC Left", NULL, SND_SOC_NOPM, 0, 0),
+ SND_SOC_DAPM_DAC("HSDAC Right", NULL, SND_SOC_NOPM, 0, 0),
+ SND_SOC_DAPM_DAC("HFDAC Left", NULL, TWL6040_REG_HFLCTL, 0, 0),
+ SND_SOC_DAPM_DAC("HFDAC Right", NULL, TWL6040_REG_HFRCTL, 0, 0),
/* Virtual DAC for vibra path (DL4 channel) */
- SND_SOC_DAPM_DAC("VIBRA DAC", "Vibra Playback",
- SND_SOC_NOPM, 0, 0),
+ SND_SOC_DAPM_DAC("VIBRA DAC", NULL, SND_SOC_NOPM, 0, 0),
SND_SOC_DAPM_MUX("Handsfree Left Playback",
SND_SOC_NOPM, 0, 0, &hfl_mux_controls),
@@ -810,6 +805,26 @@ static const struct snd_soc_dapm_widget twl6040_dapm_widgets[] = {
};
static const struct snd_soc_dapm_route intercon[] = {
+ /* Stream -> DAC mapping */
+ {"HSDAC Left", NULL, "Legacy Playback"},
+ {"HSDAC Left", NULL, "Headset Playback"},
+ {"HSDAC Right", NULL, "Legacy Playback"},
+ {"HSDAC Right", NULL, "Headset Playback"},
+
+ {"HFDAC Left", NULL, "Legacy Playback"},
+ {"HFDAC Left", NULL, "Handsfree Playback"},
+ {"HFDAC Right", NULL, "Legacy Playback"},
+ {"HFDAC Right", NULL, "Handsfree Playback"},
+
+ {"VIBRA DAC", NULL, "Legacy Playback"},
+ {"VIBRA DAC", NULL, "Vibra Playback"},
+
+ /* ADC -> Stream mapping */
+ {"ADC Left", NULL, "Legacy Capture"},
+ {"ADC Left", NULL, "Capture"},
+ {"ADC Right", NULL, "Legacy Capture"},
+ {"ADC Right", NULL, "Capture"},
+
/* Capture path */
{"Analog Left Capture Route", "Headset Mic", "HSMIC"},
{"Analog Left Capture Route", "Main Mic", "MAINMIC"},
@@ -1028,14 +1043,14 @@ static struct snd_soc_dai_driver twl6040_dai[] = {
{
.name = "twl6040-legacy",
.playback = {
- .stream_name = "Playback",
+ .stream_name = "Legacy Playback",
.channels_min = 1,
.channels_max = 5,
.rates = TWL6040_RATES,
.formats = TWL6040_FORMATS,
},
.capture = {
- .stream_name = "Capture",
+ .stream_name = "Legacy Capture",
.channels_min = 1,
.channels_max = 2,
.rates = TWL6040_RATES,
--
1.7.12
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ASoC: twl6040: Convert to use DAI DAPM widgets
2012-09-20 13:32 [PATCH] ASoC: twl6040: Convert to use DAI DAPM widgets Peter Ujfalusi
@ 2012-09-22 14:59 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2012-09-22 14:59 UTC (permalink / raw)
To: Peter Ujfalusi; +Cc: alsa-devel, Liam Girdwood
On Thu, Sep 20, 2012 at 04:32:15PM +0300, Peter Ujfalusi wrote:
> 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
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-09-22 14:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-20 13:32 [PATCH] ASoC: twl6040: Convert to use DAI DAPM widgets Peter Ujfalusi
2012-09-22 14:59 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).