From patchwork Fri Jun 13 10:04:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jyri Sarha X-Patchwork-Id: 4348131 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 C291CBEEAA for ; Fri, 13 Jun 2014 10:05:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C133020222 for ; Fri, 13 Jun 2014 10:05:29 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 8767A201D5 for ; Fri, 13 Jun 2014 10:05:28 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 9530D264F45; Fri, 13 Jun 2014 12:05:27 +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, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 05B8E261A57; Fri, 13 Jun 2014 12:04:59 +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 31E6D261B33; Fri, 13 Jun 2014 12:04:58 +0200 (CEST) Received: from devils.ext.ti.com (devils.ext.ti.com [198.47.26.153]) by alsa0.perex.cz (Postfix) with ESMTP id 6710A261A57 for ; Fri, 13 Jun 2014 12:04:47 +0200 (CEST) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id s5DA4kaO021004; Fri, 13 Jun 2014 05:04:46 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s5DA4kcq006008; Fri, 13 Jun 2014 05:04:46 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.174.1; Fri, 13 Jun 2014 05:04:46 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s5DA4j0U032304; Fri, 13 Jun 2014 05:04:45 -0500 From: Jyri Sarha To: , , Date: Fri, 13 Jun 2014 13:04:38 +0300 Message-ID: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 Cc: liam.r.girdwood@linux.intel.com, detheridge@ti.com, Jyri Sarha , peter.ujfalusi@ti.com, broonie@kernel.org, bcousson@baylibre.com Subject: [alsa-devel] [PATCH 3/3] ASoC: simple-card: Add system-clock-id DT parameter to dai nodes 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 Select clk_id parameters for set_sysclk calls in the card init phase. Signed-off-by: Jyri Sarha --- .../devicetree/bindings/sound/simple-card.txt | 2 ++ include/sound/simple_card.h | 1 + sound/soc/generic/simple-card.c | 6 +++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/sound/simple-card.txt b/Documentation/devicetree/bindings/sound/simple-card.txt index 8460744..8877130 100644 --- a/Documentation/devicetree/bindings/sound/simple-card.txt +++ b/Documentation/devicetree/bindings/sound/simple-card.txt @@ -72,6 +72,8 @@ Optional CPU/CODEC subnodes properties: clock node (= common clock), or "system-clock-frequency" (if system doens't support common clock) - system-clock-direction : "in" or "out", default "in" +- system-clock-id : u32, clk_id parameter for set_sysclk, + default 0 Example 1 - single DAI link: diff --git a/include/sound/simple_card.h b/include/sound/simple_card.h index 6d74fef..f3c7a30 100644 --- a/include/sound/simple_card.h +++ b/include/sound/simple_card.h @@ -19,6 +19,7 @@ struct asoc_simple_dai { unsigned int fmt; unsigned int sysclk; int sysclk_dir; + int sysclk_id; int slots; int slot_width; }; diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index 8dd7957..f840d9c 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -64,7 +64,7 @@ static int __asoc_simple_card_dai_init(struct snd_soc_dai *dai, } if (set->sysclk) { - ret = snd_soc_dai_set_sysclk(dai, 0, set->sysclk, + ret = snd_soc_dai_set_sysclk(dai, set->sysclk_id, set->sysclk, set->sysclk_dir); if (ret && ret != -ENOTSUPP) { dev_err(dai->dev, "simple-card: set_sysclk error\n"); @@ -150,6 +150,10 @@ asoc_simple_card_sub_parse_of(struct device_node *np, return -EINVAL; } + ret = of_property_read_u32(np, "system-clock-id", &val); + if (ret == 0) + dai->sysclk_id = val; + /* * dai->sysclk come from * "clocks = <&xxx>" (if system has common clock)