From: Jyri Sarha <jsarha@ti.com>
To: Jean-Francois Moine <moinejf@free.fr>
Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org,
kuninori.morimoto.gx@renesas.com,
liam.r.girdwood@linux.intel.com, Li.Xiubo@freescale.com,
peter.ujfalusi@ti.com, detheridge@ti.com, broonie@kernel.org,
bcousson@baylibre.com, linux-omap@vger.kernel.org
Subject: Re: [PATCH RFC 2/2] ASoC: simple-card: Move dai-link level properties away from dai subnodes
Date: Mon, 24 Mar 2014 11:38:59 +0200 [thread overview]
Message-ID: <532FFD33.6040506@ti.com> (raw)
In-Reply-To: <20140323105412.4f312449@armhf>
On 03/23/2014 11:54 AM, Jean-Francois Moine wrote:
> On Fri, 21 Mar 2014 18:47:23 +0200
> Jyri Sarha <jsarha@ti.com> wrote:
>
>> The properties like format, bitclock-master, frame-master,
>> bitclock-inversion, and frame-inversion should be common to the dais
>> connected with a dai-link. For bitclock-master and frame-master
>> properties to be unambiguous they need to indicate the mastering dai
>> node with a phandle.
>>
>> Signed-off-by: Jyri Sarha <jsarha@ti.com>
>> ---
[...]
>> -Required subnodes:
>> +Requred dai-link subnodes:
>
> Typo: 'Required'
>
Fixed. Thanks!
[...]
>> --- a/sound/soc/generic/simple-card.c
>> +++ b/sound/soc/generic/simple-card.c
>> @@ -8,6 +8,7 @@
>> * it under the terms of the GNU General Public License version 2 as
>> * published by the Free Software Foundation.
>> */
>> +#define DEBUG
>
> Should be removed.
>
Removed. Thanks!
[...]
>> + if (!bitclkmaster && !framemaster) {
>> + /* Master setting not found from dai_link level, revert back
>> + to legacy DT parsing and take settings from codec node. */
>> + dev_dbg(dev, "%s: Revert to legacy daifmt parsing\n",
>> + __func__);
>> + dai_props->cpu_dai.fmt = dai_props->codec_dai.fmt =
>> + snd_soc_of_parse_daifmt(np, NULL, NULL, NULL) |
>> + (daifmt & ~SND_SOC_DAIFMT_CLOCK_MASK);
>
> We are here each time there is no bitclock-master and no frame-master,
> i.e. each time for me. It could be simpler to keep the first 'daifmt'
> instead of parsing again.
>
Sorry, I missed this and comments bellow first time around. I'll make
another patch set shortly.
Adding another check to test if we are parsing top level sound node
would save you from the legacy mode parsing. I'll do that and update the
DT binding document accordingly.
[...]
>> + if (multi) {
>> + struct device_node *np = NULL;
>> + int i;
>> + for (i = 0; (np = of_get_next_child(node, np)); i++) {
>> + dev_dbg(dev, "\tlink %d:\n", i);
>> + ret = simple_card_dai_link_of(np, dev, dai_link + i,
>> + dai_props + i);
>
> I feel that my loop was quicker:
>
I was targeting for readability rather than speed. I doubt the
difference is significant since most string processing is anyway taking
most of the time anyway.
> struct device_node *np = NULL;
>
> for (;;) {
> np = of_get_next_child(node, np);
> if (!np)
> break;
> dev_dbg(dev, "\tlink %d:\n", dai_link - priv->snd_card.dai_link);
> ret = simple_card_dai_link_of(np, dev, dai_link++,
> dai_props++);
>
>
>> + of_node_put(np);
>> + if (ret < 0)
>> + return ret;
>
> The np reference count is updated in of_get_next_child(), so:
>
> if (ret < 0) {
> of_node_put(np);
> return ret;
> }
>
Oops, need to fix that. Thanks !
> Otherwise, it works for me.
>
> Tested-by: Jean-Francois Moine <moinejf@free.fr>
>
Best regards,
Jyri
next prev parent reply other threads:[~2014-03-24 9:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-21 16:47 [PATCH RFC 0/2] Move dai-link level properties away from dai subnodes Jyri Sarha
2014-03-21 16:47 ` [PATCH RFC 1/2] ASoC: core: Update snd_soc_of_parse_daifmt() interface Jyri Sarha
2014-03-21 16:47 ` [PATCH RFC 2/2] ASoC: simple-card: Move dai-link level properties away from dai subnodes Jyri Sarha
2014-03-23 9:54 ` Jean-Francois Moine
2014-03-24 9:38 ` Jyri Sarha [this message]
2014-03-24 0:05 ` [alsa-devel] " Kuninori Morimoto
2014-03-24 9:45 ` Jyri Sarha
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=532FFD33.6040506@ti.com \
--to=jsarha@ti.com \
--cc=Li.Xiubo@freescale.com \
--cc=alsa-devel@alsa-project.org \
--cc=bcousson@baylibre.com \
--cc=broonie@kernel.org \
--cc=detheridge@ti.com \
--cc=devicetree@vger.kernel.org \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=liam.r.girdwood@linux.intel.com \
--cc=linux-omap@vger.kernel.org \
--cc=moinejf@free.fr \
--cc=peter.ujfalusi@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).