From: Xiubo Li <Li.Xiubo@freescale.com>
To: broonie@kernel.org, perex@perex.cz, lgirdwood@gmail.com,
tiwai@suse.de, moinejf@free.fr, andrew@lunn.ch,
kuninori.morimoto.gx@renesas.com, jsarha@ti.com,
devicetree@vger.kernel.org, alsa-devel@alsa-project.org,
robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com,
ijc+devicetree@hellion.org.uk, galak@codeaurora.org
Cc: linux-kernel@vger.kernel.org, Xiubo Li <Li.Xiubo@freescale.com>
Subject: [PATCHv2 4/4] ASoC: simple-card: binding: update binding to support the new style.
Date: Tue, 2 Sep 2014 17:26:09 +0800 [thread overview]
Message-ID: <1409649969-15759-5-git-send-email-Li.Xiubo@freescale.com> (raw)
In-Reply-To: <1409649969-15759-1-git-send-email-Li.Xiubo@freescale.com>
This update patch will split the DT node into old style and new style:
The new style will will be easier to add muti DAI links from old single
DAI link DTs.
This patch will maintian compatibility with the old DTs.
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
---
.../devicetree/bindings/sound/simple-card.txt | 184 ++++++++++++++-------
1 file changed, 126 insertions(+), 58 deletions(-)
diff --git a/Documentation/devicetree/bindings/sound/simple-card.txt b/Documentation/devicetree/bindings/sound/simple-card.txt
index c2e9841..6fb8966 100644
--- a/Documentation/devicetree/bindings/sound/simple-card.txt
+++ b/Documentation/devicetree/bindings/sound/simple-card.txt
@@ -1,15 +1,19 @@
-Simple-Card:
+Device-Tree bindings for Simple Card
Simple-Card specifies audio DAI connections of SoC <-> codec.
-Required properties:
+=== Top level's properties and subnodes ===
+*** Required properties ***
- compatible : "simple-audio-card"
-Optional properties:
-
+*** Optional properties ***
- simple-audio-card,name : User specified audio sound card name, one string
property.
+- simple-audio-card,format : CPU/CODEC common audio format.
+ "i2s", "right_j", "left_j" , "dsp_a"
+ "dsp_b", "ac97", "pdm", "msb", "lsb"
+ (This is used for single DAI link & old style.)
- simple-audio-card,widgets : Please refer to widgets.txt.
- simple-audio-card,routing : A list of the connections between audio components.
Each entry is a pair of strings, the first being the
@@ -17,63 +21,85 @@ Optional properties:
source.
- simple-audio-card,mclk-fs : Multiplication factor between stream rate and codec
mclk.
-
-Optional subnodes:
-
-- simple-audio-card,dai-link : Container for dai-link level
- properties and the CPU and CODEC
- sub-nodes. This container may be
- omitted when the card has only one
- DAI link. See the examples and the
- section bellow.
-
-Dai-link subnode properties and subnodes:
-
-If dai-link subnode is omitted and the subnode properties are directly
-under "sound"-node the subnode property and subnode names have to be
-prefixed with "simple-audio-card,"-prefix.
-
-Required dai-link subnodes:
-
-- cpu : CPU sub-node
-- codec : CODEC sub-node
-
-Optional dai-link subnode properties:
-
+- simple-audio-card,frame-master : Indicates DAI link frame master. One phandle to a cpu
+ or codec subnode.
+ (This is used for single DAI link & old style.)
+- simple-audio-card,bitclock-master : Indicates DAI link bit clock master. One phandle to a
+ cpu or codec subnode.
+ (This is used for single DAI link & old style.)
+
+*** Optional subnodes ***
+- simple-audio-card,dai-link : Container for DAI link level properties and the CPU
+ and CODEC sub-nodes. This container may be omitted
+ when the card has only one DAI link and using the old
+ style. See the examples and the section bellow.
+- simple-audio-card,cpu : CPU DAI sub-node.
+ (This is used for single DAI link & old style.)
+- simple-audio-card,codec : CODEC DAI sub-node.
+ (This is used for single DAI link & old style.)
+
+=== DAI link node's properties and its subnodes ===
+
+*** Required subnodes ***
+- cpu : CPU DAI sub-node
+- codec : CODEC DAI sub-node
+
+*** Optional properties ***
- format : CPU/CODEC common audio format.
"i2s", "right_j", "left_j" , "dsp_a"
"dsp_b", "ac97", "pdm", "msb", "lsb"
-- frame-master : Indicates dai-link frame master.
- phandle to a cpu or codec subnode.
-- bitclock-master : Indicates dai-link bit clock master.
- phandle to a cpu or codec subnode.
-- bitclock-inversion : bool property. Add this if the
- dai-link uses bit clock inversion.
-- frame-inversion : bool property. Add this if the
- dai-link uses frame clock inversion.
+- frame-master : Indicates DAI link frame master. One phandle to a cpu
+ or codec subnode.
+ (This is One boolean property for old style.)
+- bitclock-master : Indicates DAI link bit clock master. One phandle to a
+ cpu or codec subnode.
+ (This is one boolean property for old style.)
For backward compatibility the frame-master and bitclock-master
properties can be used as booleans in codec subnode to indicate if the
-codec is the dai-link frame or bit clock master. In this case there
-should be no dai-link node, the same properties should not be present
+codec is the DAI link frame or bit clock master. In this case there
+should be no DAI link node, the same properties should not be present
at sound-node level, and the bitclock-inversion and frame-inversion
properties should also be placed in the codec node if needed.
-Required CPU/CODEC subnodes properties:
-- sound-dai : phandle and port of CPU/CODEC
+=== CPU/CODEC DAI node's properties and its subnodes ===
-Optional CPU/CODEC subnodes properties:
+*** Required properties ***
+- sound-dai : One phandle and port of CPU/CODEC
+*** Optional properties ***
+- bitclock-inversion : Boolean property. Add this if the DAI device uses bit
+ clock inversion.
+- frame-inversion : Boolean property. Add this if the DAI device uses frame
+ clock inversion.
- dai-tdm-slot-num : Please refer to tdm-slot.txt.
- dai-tdm-slot-width : Please refer to tdm-slot.txt.
-- clocks / system-clock-frequency : specify subnode's clock if needed.
- it can be specified via "clocks" if system has
- clock node (= common clock), or "system-clock-frequency"
- (if system doens't support common clock)
+- clocks / system-clock-frequency : specify CPU/CODEC DAI node's clock if needed. It can be
+ specified via "clocks" if system has clock node
+ (= common clock), or "system-clock-frequency"(if system
+ doens't support common clock)
-Example 1 - single DAI link:
+=== Examples ===
+*** CPU & CODEC DAI DT nodes ***
+&i2c0 {
+ ak4648: ak4648@12 {
+ #sound-dai-cells = <0>;
+ compatible = "asahi-kasei,ak4648";
+ reg = <0x12>;
+ };
+};
+sh_fsi2: sh_fsi2@ec230000 {
+ #sound-dai-cells = <1>;
+ compatible = "renesas,sh_fsi2";
+ reg = <0xec230000 0x400>;
+ interrupt-parent = <&gic>;
+ interrupts = <0 146 0x4>;
+};
+
+Example 1 - single DAI link & old style:
+bitclock-master and frame-master as phandles.
sound {
compatible = "simple-audio-card";
simple-audio-card,name = "VF610-Tower-Sound-Card";
@@ -91,6 +117,7 @@ sound {
simple-audio-card,cpu {
sound-dai = <&sh_fsi2 0>;
+ bitclock-inversion;
};
dailink0_master: simple-audio-card,codec {
@@ -99,24 +126,64 @@ sound {
};
};
-&i2c0 {
- ak4648: ak4648@12 {
- #sound-dai-cells = <0>;
- compatible = "asahi-kasei,ak4648";
- reg = <0x12>;
+Example 2 - single DAI link & old style:
+bitclock-master and frame-master as boolean properties.
+sound {
+ compatible = "simple-audio-card";
+ simple-audio-card,name = "VF610-Tower-Sound-Card";
+ simple-audio-card,format = "left_j";
+ simple-audio-card,widgets =
+ "Microphone", "Microphone Jack",
+ "Headphone", "Headphone Jack",
+ "Speaker", "External Speaker";
+ simple-audio-card,routing =
+ "MIC_IN", "Microphone Jack",
+ "Headphone Jack", "HP_OUT",
+ "External Speaker", "LINE_OUT";
+
+ simple-audio-card,cpu {
+ sound-dai = <&sh_fsi2 0>;
};
-};
-sh_fsi2: sh_fsi2@ec230000 {
- #sound-dai-cells = <1>;
- compatible = "renesas,sh_fsi2";
- reg = <0xec230000 0x400>;
- interrupt-parent = <&gic>;
- interrupts = <0 146 0x4>;
+ simple-audio-card,codec {
+ sound-dai = <&ak4648>;
+ clocks = <&osc>;
+ bitclock-master;
+ frame-master;
+ bitclock-inversion;
+ };
};
-Example 2 - many DAI links:
+Example 3 - single DAI link & new style:
+sound {
+ compatible = "simple-audio-card";
+ simple-audio-card,name = "VF610-Tower-Sound-Card";
+ simple-audio-card,widgets =
+ "Microphone", "Microphone Jack",
+ "Headphone", "Headphone Jack",
+ "Speaker", "External Speaker";
+ simple-audio-card,routing =
+ "MIC_IN", "Microphone Jack",
+ "Headphone Jack", "HP_OUT",
+ "External Speaker", "LINE_OUT";
+
+ simple-audio-card,dai-link {
+ format = "i2s";
+ bitclock-master = <&dailink0_master>;
+ frame-master = <&dailink0_master>;
+ cpu {
+ sound-dai = <&sh_fsi2 0>;
+ frame-inversion;
+ };
+ dailink0_master: codec {
+ sound-dai = <&ak4648>;
+ clocks = <&osc>;
+ frame-inversion;
+ };
+ };
+};
+Example 4 - many DAI links:
sound {
compatible = "simple-audio-card";
simple-audio-card,name = "Cubox Audio";
@@ -128,6 +195,7 @@ sound {
};
codec {
sound-dai = <&tda998x 0>;
+ frame-inversion;
};
};
--
1.8.4
next prev parent reply other threads:[~2014-09-02 9:26 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-02 9:26 [PATCHv2 0/4] simple-card: simplify the code Xiubo Li
[not found] ` <1409649969-15759-1-git-send-email-Li.Xiubo-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2014-09-02 9:26 ` [PATCHv2 1/4] ASoC: simple-card: add asoc_simple_card_fmt_master() to " Xiubo Li
2014-09-02 10:21 ` Varka Bhadram
2014-09-02 10:38 ` Jean-Francois Moine
2014-09-02 10:42 ` Varka Bhadram
2014-09-02 11:04 ` Takashi Iwai
[not found] ` <54059F20.4080509-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-09-02 11:09 ` Jean-Francois Moine
2014-09-02 11:32 ` Jyri Sarha
2014-09-02 11:10 ` Jyri Sarha
2014-09-03 2:37 ` Li.Xiubo
2014-09-03 8:36 ` Jyri Sarha
[not found] ` <5406D317.5000403-l0cyMroinI0@public.gmane.org>
2014-09-03 8:39 ` Li.Xiubo-KZfg59tc24xl57MIdRCFDg
[not found] ` <1409649969-15759-2-git-send-email-Li.Xiubo-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2014-09-03 0:26 ` [alsa-devel] " Kuninori Morimoto
2014-09-03 2:21 ` Li.Xiubo
[not found] ` <b0ce0040e47a4ea8ab00ae7e113ecb41-swgC6WJTr6EbUgZD/0KOGpwN6zqB+hSMnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2014-09-03 3:36 ` Kuninori Morimoto
[not found] ` <87y4u15qa2.wl%kuninori.morimoto.gx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-09-03 3:41 ` Li.Xiubo-KZfg59tc24xl57MIdRCFDg
2014-09-03 3:37 ` Li.Xiubo-KZfg59tc24xl57MIdRCFDg
[not found] ` <df7936d5863948b0a0a33aa8283d6a67-swgC6WJTr6EbUgZD/0KOGpwN6zqB+hSMnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2014-09-03 4:13 ` Kuninori Morimoto
[not found] ` <87wq9l5ojn.wl%kuninori.morimoto.gx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-09-03 5:33 ` Li.Xiubo-KZfg59tc24xl57MIdRCFDg
2014-09-03 6:48 ` Jean-Francois Moine
2014-09-02 9:26 ` [PATCHv2 2/4] ASoC: simple-card: Merge single and muti DAI link(s) code Xiubo Li
2014-09-02 9:26 ` [PATCHv2 3/4] ASoC: simple-card: Adjust the comments of simple card Xiubo Li
[not found] ` <1409649969-15759-4-git-send-email-Li.Xiubo-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2014-09-02 10:44 ` Jean-Francois Moine
2014-09-03 1:55 ` Li.Xiubo-KZfg59tc24xl57MIdRCFDg
[not found] ` <37e5ba204cb340bc9fe01b7473721a9d-swgC6WJTr6EbUgZD/0KOGpwN6zqB+hSMnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2014-09-03 2:14 ` [alsa-devel] " Kuninori Morimoto
[not found] ` <87zjeh5u2o.wl%kuninori.morimoto.gx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-09-03 2:24 ` Li.Xiubo-KZfg59tc24xl57MIdRCFDg
2014-09-02 9:26 ` Xiubo Li [this message]
2014-09-02 10:41 ` [PATCHv2 4/4] ASoC: simple-card: binding: update binding to support the new style Jean-Francois Moine
2014-09-03 1:54 ` 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=1409649969-15759-5-git-send-email-Li.Xiubo@freescale.com \
--to=li.xiubo@freescale.com \
--cc=alsa-devel@alsa-project.org \
--cc=andrew@lunn.ch \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=galak@codeaurora.org \
--cc=ijc+devicetree@hellion.org.uk \
--cc=jsarha@ti.com \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=moinejf@free.fr \
--cc=pawel.moll@arm.com \
--cc=perex@perex.cz \
--cc=robh+dt@kernel.org \
--cc=tiwai@suse.de \
/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).