[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAEnQRZAAU34YS778WJVD6uubSwQxjA-5LTG9g0CvSdSZOuO+tQ@mail.gmail.com>
Date: Fri, 12 Mar 2021 14:37:30 +0200
From: Daniel Baluta <daniel.baluta@...il.com>
To: Mark Brown <broonie@...nel.org>
Cc: Daniel Baluta <daniel.baluta@....nxp.com>,
Linux-ALSA <alsa-devel@...a-project.org>,
Liam Girdwood <lgirdwood@...il.com>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
dl-linux-imx <linux-imx@....com>,
Ranjani Sridharan <ranjani.sridharan@...ux.intel.com>,
Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>,
"S.j. Wang" <shengjiu.wang@....com>,
Daniel Baluta <daniel.baluta@....com>
Subject: Re: [PATCH] ASoC: core: Don't set platform name when of_node is set
On Fri, Mar 12, 2021 at 1:59 PM Mark Brown <broonie@...nel.org> wrote:
>
> On Fri, Mar 12, 2021 at 12:59:29PM +0200, Daniel Baluta wrote:
> > On Fri, Mar 12, 2021 at 12:50 PM Mark Brown <broonie@...nel.org> wrote:
>
> > > If an explicit name has been provided why would we override it with an
> > > autogenerated one?
>
> > Wait, are you asking why the initial code:
>
> > dai_link->platforms->name = component->name;
>
> > is there in the initial code?
>
> No, just the opposite! If there's an explict name configured why do you
> want to ignore it?
Because the initial assignment:
dai_link->platforms->name = component->name;
doesn't take into consideration that dai_link->platform->of_node is
also explicitly configured.
So, my change only configures the name (dai_link->platform->name)
if the dai->platform->of_node wasn't previously explicitly configured.
Otherwise, we end up with both dai_link->platforms->name and
dai->link->platforms->of_node
configured and we hit this error:
soc_dai_link_sanity_check:
/*
* Platform may be specified by either name or OF node, but it
* can be left unspecified, then no components will be inserted
* in the rtdcom list
*/
if (!!platform->name == !!platform->of_node) {
dev_err(card->dev,
"ASoC: Neither/both platform name/of_node are set for %s\n", link->name);
return -EINVAL;
}
I start with a simple-audio-card node:
sof-sound-wm8960 {
compatible = "simple-audio-card";
simple-audio-card,dai-link {
format = "i2s";
cpu {
sound-dai = <&dsp 1>;
};
sndcodec: codec {
sound-dai = <&wm8960>;
};
}
Notice that doesn't have any platform field.
But then in sound/soc/generic/simple-card-utils.c:asoc_simple_canonicalize_platform
explicitly sets dai_link->platforms->of_node like this:
» if (!dai_link->platforms->of_node)
» » dai_link->platforms->of_node = dai_link->cpus->of_node;
I hope this is more clear.
Powered by blists - more mailing lists