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: 4348111 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5491B9F433 for ; Fri, 13 Jun 2014 10:04:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 789362022A for ; Fri, 13 Jun 2014 10:04:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 997902028D for ; Fri, 13 Jun 2014 10:04:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752742AbaFMKEv (ORCPT ); Fri, 13 Jun 2014 06:04:51 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:52023 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752197AbaFMKEu (ORCPT ); Fri, 13 Jun 2014 06:04:50 -0400 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: , , CC: , , , , , Jyri Sarha Subject: [PATCH 3/3] ASoC: simple-card: Add system-clock-id DT parameter to dai nodes 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 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.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)