From patchwork Wed Sep 10 04:07:42 2014
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Xiubo Li
X-Patchwork-Id: 4873971
Return-Path:
X-Original-To: patchwork-alsa-devel@patchwork.kernel.org
Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org
Received: from mail.kernel.org (mail.kernel.org [198.145.19.201])
by patchwork2.web.kernel.org (Postfix) with ESMTP id A5024C0338
for ;
Wed, 10 Sep 2014 04:08:18 +0000 (UTC)
Received: from mail.kernel.org (localhost [127.0.0.1])
by mail.kernel.org (Postfix) with ESMTP id 7C42720149
for ;
Wed, 10 Sep 2014 04:08:17 +0000 (UTC)
Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243])
by mail.kernel.org (Postfix) with ESMTP id 0A36520145
for ;
Wed, 10 Sep 2014 04:08:16 +0000 (UTC)
Received: by alsa0.perex.cz (Postfix, from userid 1000)
id 432E9261603; Wed, 10 Sep 2014 06:08:14 +0200 (CEST)
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org
X-Spam-Level:
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM,
UNPARSEABLE_RELAY autolearn=no version=3.3.1
Received: from alsa0.perex.cz (localhost [IPv6:::1])
by alsa0.perex.cz (Postfix) with ESMTP id 54D48260851;
Wed, 10 Sep 2014 06:08:03 +0200 (CEST)
X-Original-To: alsa-devel@alsa-project.org
Delivered-To: alsa-devel@alsa-project.org
Received: by alsa0.perex.cz (Postfix, from userid 1000)
id 778452608EC; Wed, 10 Sep 2014 06:08:02 +0200 (CEST)
Received: from na01-bl2-obe.outbound.protection.outlook.com
(mail-bl2on0112.outbound.protection.outlook.com [65.55.169.112])
by alsa0.perex.cz (Postfix) with ESMTP id 13482260824
for ;
Wed, 10 Sep 2014 06:07:54 +0200 (CEST)
Received: from BN3PR0301CA0015.namprd03.prod.outlook.com (25.160.180.153) by
BN1PR0301MB0612.namprd03.prod.outlook.com (25.160.170.27) with
Microsoft SMTP
Server (TLS) id 15.0.1019.16; Wed, 10 Sep 2014 04:07:50 +0000
Received: from BN1AFFO11FD019.protection.gbl (2a01:111:f400:7c10::118) by
BN3PR0301CA0015.outlook.office365.com (2a01:111:e400:4000::25) with
Microsoft SMTP Server (TLS) id 15.0.1024.12 via Frontend Transport;
Wed, 10 Sep 2014 04:07:51 +0000
Received: from tx30smr01.am.freescale.net (192.88.168.50) by
BN1AFFO11FD019.mail.protection.outlook.com (10.58.52.79) with
Microsoft SMTP
Server (TLS) id 15.0.1019.14 via Frontend Transport; Wed, 10 Sep 2014
04:07:50 +0000
Received: from titan.ap.freescale.net ([10.192.208.233])
by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id
s8A47eFb001297; Tue, 9 Sep 2014 21:07:41 -0700
From: Xiubo Li
To: , , ,
, ,
, ,
Date: Wed, 10 Sep 2014 12:07:42 +0800
Message-ID: <1410322062-35077-1-git-send-email-Li.Xiubo@freescale.com>
X-Mailer: git-send-email 2.1.0.27.g96db324
X-EOPAttributedMessage: 0
X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:CAL; IPV:NLI;
EFV:NLI; SFV:NSPM;
SFS:(10019019)(6009001)(189002)(199003)(102836001)(104166001)(62966002)(105606002)(81342001)(36756003)(50466002)(50986999)(64706001)(99396002)(77982001)(4396001)(229853001)(77156001)(88136002)(47776003)(97736003)(46102001)(48376002)(92726001)(83322001)(44976005)(50226001)(80022001)(21056001)(86362001)(6806004)(19580395003)(85306004)(74662001)(2201001)(90102001)(87936001)(104016003)(76482001)(81542001)(84676001)(83072002)(93916002)(74502001)(19580405001)(87286001)(79102001)(107046002)(95666004)(92566001)(68736004)(31966008)(106466001)(85852003)(26826002)(89996001)(20776003);
DIR:OUT; SFP:1102; SCL:1; SRVR:BN1PR0301MB0612;
H:tx30smr01.am.freescale.net;
FPR:; MLV:ovrnspm; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en;
MIME-Version: 1.0
X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;UriScan:;
X-Forefront-PRVS: 033054F29A
Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not
designate 192.88.168.50 as permitted sender)
receiver=protection.outlook.com;
client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net;
Authentication-Results: spf=fail (sender IP is 192.88.168.50)
smtp.mailfrom=Li.Xiubo@freescale.com;
X-OriginatorOrg: freescale.com
Cc: mark.rutland@arm.com, pawel.moll@arm.com, ijc+devicetree@hellion.org.uk,
linux-kernel@vger.kernel.org, robh+dt@kernel.org,
Xiubo Li
Subject: [alsa-devel] [PATCHv4] ASoC: simple-card: binding: update binding
to support the new style.
X-BeenThere: alsa-devel@alsa-project.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Alsa-devel mailing list for ALSA developers -
http://www.alsa-project.org"
List-Unsubscribe:
,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Errors-To: alsa-devel-bounces@alsa-project.org
Sender: alsa-devel-bounces@alsa-project.org
X-Virus-Scanned: ClamAV using ClamSMTP
This patch will split the DT binding into old style and new style, the
new style will be easier to add many DAI links from old single DAI link
DTs.
This patch will maintian compatibility with the old DTs.
Signed-off-by: Xiubo Li
---
Changes in v4:
- Follow Jyri's advice.
- Fix some small words or sentences errors.
- Fix discription of the commit commnet.
- Apply against the current code.
- Add Notes.
.../devicetree/bindings/sound/simple-card.txt | 215 ++++++++++++++-------
1 file changed, 148 insertions(+), 67 deletions(-)
diff --git a/Documentation/devicetree/bindings/sound/simple-card.txt b/Documentation/devicetree/bindings/sound/simple-card.txt
index c2e9841..5fe0796 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,99 @@ 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
+ CODEC DAI node.
+ (This is used for single DAI link & old style.)
+- simple-audio-card,bitclock-master : Indicates DAI link bit clock master. One phandle to
+ a CODEC DAI node.
+ (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 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 node.
+ (This is used for single DAI link & old style.)
+- simple-audio-card,codec : CODEC DAI node.
+ (This is used for single DAI link & old style.)
+
+=== DAI link node's properties and its subnodes ===
+
+*** Required subnodes ***
+- cpu : CPU DAI node.
+- codec : CODEC DAI 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.
-
-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
-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
-
-Optional CPU/CODEC subnodes properties:
-
+- frame-master : Indicates DAI link frame master. One phandle to a
+ CODEC DAI node.
+ (This is One boolean property for old style.)
+- bitclock-master : Indicates DAI link bit clock master. One phandle to
+ a CODEC DAI node.
+ (This is one boolean property for old style.)
+
+For backward compatibility, the frame-master and bitclock-master
+can be used as boolean properties in CPU/CODEC DAI node indicating
+that the CODEC DAI is the DAI link frame master and bit clock master.
+In this case there should be no DAI link level nodes or boolean
+properties of them.
+
+For all the properties in DAI link level will be applied to both
+CPU and CODEC DAIs.
+
+=== CPU/CODEC DAI node's properties and its subnodes ===
+
+*** Required properties ***
+- sound-dai : One phandle and port of CPU/CODEC DAI device node.
+
+*** 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.
+- frame-master : Boolean property. Add this if the CODEC DAI device is
+ frame master.
+ (This is used for single DAI link & old style.)
+- bitclock-master : Boolean property. Add this if the CODEC DAI device is
+ bit clock master.
+ (This is used for single DAI link & old style.)
- 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'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)
+
+=== Notes ===
+*** DAI hardware clock masters ***
+For [prefix]frame-master and [prefix]bitclock-master, which prefix
+is "simple-audio-card,", are both wrt the CODEC DAI. If the CODEC DAI
+is bit clock and frame master then the CPU DAI will be bit clock and
+frame slave, and vice versa.
+
+=== Examples ===
+*** CPU & CODEC DAI DT nodes ***
+&i2c0 {
+ ak4648: ak4648@12 {
+ #sound-dai-cells = <0>;
+ compatible = "asahi-kasei,ak4648";
+ reg = <0x12>;
+ };
+};
-Example 1 - single DAI link:
+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 +131,7 @@ sound {
simple-audio-card,cpu {
sound-dai = <&sh_fsi2 0>;
+ bitclock-inversion;
};
dailink0_master: simple-audio-card,codec {
@@ -99,24 +140,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";