diff mbox

ASoC: nau8825: fix stream_name conflicting

Message ID 1446596019-83464-1-git-send-email-yang.a.fang@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

yang.a.fang@intel.com Nov. 4, 2015, 12:13 a.m. UTC
From: M Naveen <naveen.m@intel.com>

There is naming conflict with dai stream_name defined in dmic.c
so assign different name

Signed-off-by: Fang, Yang A <yang.a.fang@intel.com>
Signed-off-by: M Naveen <naveen.m@intel.com>
---
 sound/soc/codecs/nau8825.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Mark Brown Nov. 4, 2015, 11:26 a.m. UTC | #1
On Tue, Nov 03, 2015 at 04:13:39PM -0800, yang.a.fang@intel.com wrote:
> From: M Naveen <naveen.m@intel.com>
> 
> There is naming conflict with dai stream_name defined in dmic.c
> so assign different name

What sort of conflict?  All names are scoped within their device,
conflicts are inevitable since we support havig more than one instance
of a device in the system.
yang.a.fang@intel.com Nov. 4, 2015, 10:14 p.m. UTC | #2
> -----Original Message-----
> From: Mark Brown [mailto:broonie@kernel.org]
> Sent: Wednesday, November 04, 2015 3:26 AM
> To: Fang, Yang A
> Cc: lgirdwood@gmail.com; alsa-devel@alsa-project.org; Nujella,
> Sathyanarayana; Koul, Vinod; M, Naveen; Sripathi, Srinivas; Konno, Joe; Patel,
> Vedang
> Subject: Re: [PATCH] ASoC: nau8825: fix stream_name conflicting
> 
> On Tue, Nov 03, 2015 at 04:13:39PM -0800, yang.a.fang@intel.com wrote:
> > From: M Naveen <naveen.m@intel.com>
> >
> > There is naming conflict with dai stream_name defined in dmic.c so
> > assign different name
> 
> What sort of conflict?  All names are scoped within their device, conflicts are
> inevitable since we support havig more than one instance of a device in the
> system.
Hi Mark,
For skylake there are two cpu BE dai  1)ssp1 Rx 2) DMIC01 Rx
In our machine driver we want to connect ssp1 Rx to Nuvuton codec and Connect DMIC01 Rx
To DMIC codec(sound/soc/codecs/dmic.c)

In our machine driver route table is like below
static const struct snd_soc_dapm_route skylake_map[] = {
{ "ssp1 Rx", NULL, " Capture" }, 
{ "DMIC01 Rx", NULL, "Capture" },
}
If we use same Capture name. When we open dmic capture we saw it is connected to SSP1-Codec
Instead of dmic01

[   53.594602]  Skl Audio Capture Port: ASoC: found 3 audio capture paths
[   53.601910]  Skl Audio Capture Port: connected new DPCM capture path Skl Audio Capture Port <- dmic01
[   53.612234]  Skl Audio Capture Port: connected new DPCM capture path Skl Audio Capture Port <- SSP1-Codec
[   53.622929]  Skl Audio Capture Port: ASoC: found 2 new BE paths
[   53.629550]  SSP1-Codec: ASoC: open capture BE SSP1-Codec

Is there a better way to differentiate the name in route map?
Thanks
Mark Brown Nov. 5, 2015, 12:07 p.m. UTC | #3
On Wed, Nov 04, 2015 at 10:14:23PM +0000, Fang, Yang A wrote:

> Is there a better way to differentiate the name in route map?

You need to differentiate by scoping within the device, consider what
happens if you get a second DMIC added for example.  We can't do that
right now but it should be simple enough to add fields to the routing
information that allow a dev_name() to be specified.  Is that something
you can work on?
diff mbox

Patch

diff --git a/sound/soc/codecs/nau8825.c b/sound/soc/codecs/nau8825.c
index 7fc7b4e..4d00ac0 100644
--- a/sound/soc/codecs/nau8825.c
+++ b/sound/soc/codecs/nau8825.c
@@ -298,8 +298,8 @@  static const struct snd_kcontrol_new nau8825_dacr_mux =
 
 
 static const struct snd_soc_dapm_widget nau8825_dapm_widgets[] = {
-	SND_SOC_DAPM_AIF_OUT("AIFTX", "Capture", 0, NAU8825_REG_I2S_PCM_CTRL2,
-		15, 1),
+	SND_SOC_DAPM_AIF_OUT("AIFTX", "AIF1 Capture", 0,
+		NAU8825_REG_I2S_PCM_CTRL2, 15, 1),
 
 	SND_SOC_DAPM_INPUT("MIC"),
 	SND_SOC_DAPM_MICBIAS("MICBIAS", NAU8825_REG_MIC_BIAS, 8, 0),
@@ -365,8 +365,8 @@  static const struct snd_soc_dapm_route nau8825_dapm_routes[] = {
 	{"ADC", NULL, "ADC Power"},
 	{"AIFTX", NULL, "ADC"},
 
-	{"DDACL", NULL, "Playback"},
-	{"DDACR", NULL, "Playback"},
+	{"DDACL", NULL, "AIF1 Playback"},
+	{"DDACR", NULL, "AIF1 Playback"},
 	{"DDACL", NULL, "DDAC Clock"},
 	{"DDACR", NULL, "DDAC Clock"},
 	{"DACL Mux", "DACL", "DDACL"},
@@ -495,14 +495,14 @@  static const struct snd_soc_dai_ops nau8825_dai_ops = {
 static struct snd_soc_dai_driver nau8825_dai = {
 	.name = "nau8825-hifi",
 	.playback = {
-		.stream_name	 = "Playback",
+		.stream_name	 = "AIF1 Playback",
 		.channels_min	 = 1,
 		.channels_max	 = 2,
 		.rates		 = NAU8825_RATES,
 		.formats	 = NAU8825_FORMATS,
 	},
 	.capture = {
-		.stream_name	 = "Capture",
+		.stream_name	 = "AIF1 Capture",
 		.channels_min	 = 1,
 		.channels_max	 = 1,
 		.rates		 = NAU8825_RATES,