devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jyri Sarha <jsarha-l0cyMroinI0@public.gmane.org>
To: Xiubo Li <Li.Xiubo-KZfg59tc24xl57MIdRCFDg@public.gmane.org>,
	broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Kuninori Morimoto
	<kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>,
	Jean-Francois Moine <moinejf-GANU6spQydw@public.gmane.org>,
	Nicolin Chen
	<nicoleotsuka-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: Re: [RFC][PATCH] ASoC: simple-card: Merge single and muti DAI link code.
Date: Mon, 1 Sep 2014 12:39:10 +0300	[thread overview]
Message-ID: <54043EBE.9020808@ti.com> (raw)
In-Reply-To: <1409294797-21948-1-git-send-email-Li.Xiubo-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

This patch would break the current syntax without introducing any
improvements over it (actually the opposite, see bellow). So in its
current form I don't like this patch at all.

On 08/29/2014 09:46 AM, Xiubo Li wrote:
 > This patch merge single DAI link and muti-DAI links code together,
 > and simply the simple-card driver code.
 >
 > And also do some other improvement:
 >
 > Since from the DAI format micro SND_SOC_DAIFMT_CBx_CFx, the 'CBx'
 > mean Codec's bit clock is as master/slave and the 'CFx' mean Codec's
 > frame clock is as master/slave.
 >
 > So these same DAI formats should be informed to CPU and CODE DAIs at
 > the same time. For the Codec driver will set the bit clock and frame
 > clock as the DAI formats said, but for the CPU driver, if the the
 > bit clock or frame clock is as Codec master, so it should be set CPU
 > DAI device as bit clock or frame clock as slave, and vice versa.
 >

But there is no such problem with the current code any more. The new
preferred way is to indicate bitclock and frame master with phandles
that refer to the master DAI on the link (see the examples bellow).

 > The old code will cause confusion, and we should be clear that the
 > letter 'C' here mean to Codec.
 >
 > Signed-off-by: Xiubo Li <Li.Xiubo-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
 > Cc: Kuninori Morimoto <kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
 > Cc: Jean-Francois Moine <moinejf-GANU6spQydw@public.gmane.org>
 > Cc: Jyri Sarha <jsarha-l0cyMroinI0@public.gmane.org>
 > Cc: Nicolin Chen <nicoleotsuka-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
 > ---
 >
 > Hi,
 >
 > This patch will break the old DT, so i just send one RFC version, and
 > will add the old DT patches in next version if this patch can work
 > well.

I do not object in getting rid of this simplified description for a
single dailink card:

(example 1)
sound {
	compatible = "simple-audio-card";
...
	simple-audio-card,format = "left_j";
	simple-audio-card,bitclock-master = <&dailink0_master>;
	simple-audio-card,frame-master = <&dailink0_master>;
	simple-audio-card,cpu {
		sound-dai = <&sh_fsi2 0>;
	};

	dailink0_master: simple-audio-card,codec {
		sound-dai = <&ak4648>;
		clocks = <&osc>;
	};
};

and describing the DAI-links always like this:

(example 2)
sound {
	compatible = "simple-audio-card";
...
	simple-audio-card,dai-link@0 {
		format = "i2s";
		bitclock-master = <&dailink0_master>;
		frame-master = <&dailink0_master>;
		dailink0_master: cpu {
			sound-dai = <&audio1 0>;
		};
		codec {
			sound-dai = <&tda998x 0>;
		};
	};
};

But I do object going back to the old syntax exclusively and
describing the bitclock and frame master always with simple boolean
properties, like this:

(example 3)
sound {
	compatible = "simple-audio-card";
...
	simple-audio-card,dai-link@0 {
		format = "i2s";
		dailink0_master: cpu {
			sound-dai = <&audio1 0>;
		};
		codec {
			sound-dai = <&tda998x 0>;
			bitclock-master;
			frame-master;
		};
	};
};

In my opinion we should rather get rid of this syntax than move
exclusively to it.

The syntax of example 2 is simply superior to the syntax of example
3. With the syntax on example 2 it is possible to describe TDM setups
where there is multiple codecs on a single i2s bus. The syntax of
example 3 simply can not describe that kind of setup.

If you need to have the backwards compatibility syntax describing the
clock masters to work also in the multilink mode (example 3), then do
just that (it is simple enough [1]). But please do not break the new
phandle based syntax!!!

Best regards,
Jyri

[1] To enable legacy syntax in multilink mode just apply this patch:

diff --git a/sound/soc/generic/simple-card.c 
b/sound/soc/generic/simple-card.c
index 8dd7957..aed3423 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -242,10 +242,10 @@ static int simple_card_dai_link_of(struct 
device_node *node,
         if (ret < 0)
                 goto dai_link_of_err;

-       if (strlen(prefix) && !bitclkmaster && !framemaster) {
-               /* No dai-link level and master setting was not found from
-                  sound node level, revert back to legacy DT parsing and
-                  take the settings from codec node. */
+       if (!bitclkmaster && !framemaster) {
+               /* No dai-link level master setting was found, revert
+                  back to legacy DT parsing and take the settings
+                  from the codec node boolean properties. */
                 dev_dbg(dev, "%s: Revert to legacy daifmt parsing\n",
                         __func__);
                 dai_props->cpu_dai.fmt = dai_props->codec_dai.fmt =

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2014-09-01  9:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-29  6:46 [RFC][PATCH] ASoC: simple-card: Merge single and muti DAI link code Xiubo Li
2014-08-31 16:27 ` Jean-Francois Moine
2014-09-01  2:57   ` Li.Xiubo
     [not found] ` <1409294797-21948-1-git-send-email-Li.Xiubo-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2014-08-29 12:00   ` Mark Brown
     [not found]     ` <20140829120035.GW29327-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-09-01  2:02       ` Li.Xiubo-KZfg59tc24xl57MIdRCFDg
2014-09-01  9:39   ` Jyri Sarha [this message]
     [not found]     ` <54043EBE.9020808-l0cyMroinI0@public.gmane.org>
2014-09-02  9:05       ` Li.Xiubo-KZfg59tc24xl57MIdRCFDg

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=54043EBE.9020808@ti.com \
    --to=jsarha-l0cymroini0@public.gmane.org \
    --cc=Li.Xiubo-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
    --cc=alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=moinejf-GANU6spQydw@public.gmane.org \
    --cc=nicoleotsuka-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /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).