From patchwork Fri Sep 1 10:47:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 111479 Delivered-To: patch@linaro.org Received: by 10.140.95.112 with SMTP id h103csp854386qge; Fri, 1 Sep 2017 03:47:57 -0700 (PDT) X-Google-Smtp-Source: ADKCNb5K5wMBRYXfeRr2zZhqpByWsTk6nW/st5Tf4609LHExll1a8SwsKQG12tqvs+WdJVRO2L03 X-Received: by 10.28.30.73 with SMTP id e70mr155487wme.151.1504262877724; Fri, 01 Sep 2017 03:47:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504262877; cv=none; d=google.com; s=arc-20160816; b=jGS3gpedPFofjdFOWLgpxQJAMJW5WXq5l6REH5juRmXwfTbsierSKDta3RmM5uCHdW 7u5eTjDlTTap6GBf/ha7NNhaL7VdWt8T2XQR5CCbAvPl3G0PRBbnXLYZiFwm9Gkc5CQF PiKPaGcmiPF3Tpuo3wKw671UVQKfhp4lOgydJ5qWRPYUVeVCwgnUmlJeh/MR25lCPnpq E5wB9LNFUra9dOOYWeLJGeDdDuY0nT/Ie1Ch25h+JbpfpmfDDz+2TpK2YaiG5rWmjcwV FZmFavGA44Y/Hnm8c4C5FZw3IB2CMSezMEs6CzgAna+vcK3EaQ/WC91DEtGqCkfnwzKM FQZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=OaqmXouqlx39B4ZhOQJ543S1P7Yx56Lfn17Wep4s0FQ=; b=D0z/gwZM9QdyLVDs0FVqE/yiMRScDYIY+SP5WABNhfarjZIE6reQxROnuBFL8h1Z0c dYhHewERj6/ca9EeoG8UxzqbYGaAl0aQnsItu4tHerjSC+U0LqKMM9s6sJtk4LND6y2y 2BvCgmIS9GzbfNpWuJGY76WjdK85SyYlMdAliKE9uIiJ9rN/WzelX9C0e/wiFxvQPJOZ Osw4nU0rZuEFBJZnLMTb1AgDFGqzoZB0ezZp9vaKRI1JtK4KpoI7yZ9o19RYyM3LzpBY hb0+p0MFiKYWSvQ0/Ba6stNiRlpd8zWnX49Y/eDFDqcf9YZZHgCcJChgFER5887kvl4B T2Wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=Jo4SloRJ; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id 44si1614548wrk.438.2017.09.01.03.47.57; Fri, 01 Sep 2017 03:47:57 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=Jo4SloRJ; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id DBC672676E6; Fri, 1 Sep 2017 12:47:25 +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 DF8AC2676E2; Fri, 1 Sep 2017 12:47:23 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, RP_MATCHES_RCVD, SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id BB9472676D8 for ; Fri, 1 Sep 2017 12:47:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=JBKKhSHFHHDMFwm/05I8A0p3qjXyPxpU+PaEyNDDhGY=; b=Jo4SloRJdc34 D15q1SwqZpoxPkuQpp3xeGUrXVEjtGo3pOP8YaLYxUidz50raTa6xfNLoz27JLKDxvq8gejWvoLCd N2Q4eXuT4ie3aUSj8XeKDUQS9VCMONSfA+og296SA25eABjEUqHzSZwsCBXfNXYFOU6y0CngbC4wN hd1XI=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1dnjTk-00054q-La; Fri, 01 Sep 2017 10:47:12 +0000 Received: from broonie by debutante with local (Exim 4.89) (envelope-from ) id 1dnjTk-00061n-7K; Fri, 01 Sep 2017 11:47:12 +0100 From: Mark Brown To: Vitaly Wool In-Reply-To: <20170817134236.a89f513737877efd7c176a3c@gmail.com> Message-Id: Date: Fri, 01 Sep 2017 11:47:12 +0100 Cc: trini@konsulko.com, alsa-devel@alsa-project.org, Kuninori Morimoto , Kevin Hilman , Sekhar Nori , Mark Brown , Vitaly Wool Subject: [alsa-devel] Applied "ASoC: make clock direction configurable in asoc-simple" to the asoc tree 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org The patch ASoC: make clock direction configurable in asoc-simple has been applied to the asoc tree at git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From a728f56094e7cf60a1dc0642fe86901d1a4dfb4e Mon Sep 17 00:00:00 2001 From: Vitaly Wool Date: Thu, 17 Aug 2017 13:42:36 +0200 Subject: [PATCH] ASoC: make clock direction configurable in asoc-simple Some CPU drivers (e. g. davinci-mcasp) may require the system clock to be configured as OUT, while there's no good way currently to set SND_SOC_CLK_OUT in simple-soc driver if the clock is fixed-rate. This patch makes asoc_simple_card_init_dai() initialize clock to SND_SOCK_CLK_OUT if explicitly stated in the relevant dts file. This change is transparent and doesn't change the default behavior. Signed-off-by: Vitaly Wool Signed-off-by: Mark Brown --- Documentation/devicetree/bindings/sound/simple-card.txt | 3 +++ include/sound/simple_card_utils.h | 1 + sound/soc/generic/simple-card-utils.c | 9 +++++++-- 3 files changed, 11 insertions(+), 2 deletions(-) -- 2.14.1 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/Documentation/devicetree/bindings/sound/simple-card.txt b/Documentation/devicetree/bindings/sound/simple-card.txt index c7a93931fad2..166f2290233b 100644 --- a/Documentation/devicetree/bindings/sound/simple-card.txt +++ b/Documentation/devicetree/bindings/sound/simple-card.txt @@ -86,6 +86,9 @@ Optional CPU/CODEC subnodes properties: in dai startup() and disabled with clk_disable_unprepare() in dai shutdown(). +- system-clock-direction-out : specifies clock direction as 'out' on + initialization. It is useful for some aCPUs with + fixed clocks. Example 1 - single DAI link: diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h index 42c6a6ac3ce6..7e25afce6566 100644 --- a/include/sound/simple_card_utils.h +++ b/include/sound/simple_card_utils.h @@ -15,6 +15,7 @@ struct asoc_simple_dai { const char *name; unsigned int sysclk; + int clk_direction; int slots; int slot_width; unsigned int tx_slot_mask; diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c index 26d64fa40c9c..af44c8c52a19 100644 --- a/sound/soc/generic/simple-card-utils.c +++ b/sound/soc/generic/simple-card-utils.c @@ -196,7 +196,11 @@ int asoc_simple_card_parse_clk(struct device *dev, simple_dai->sysclk = clk_get_rate(clk); } - dev_dbg(dev, "%s : sysclk = %d\n", name, simple_dai->sysclk); + if (of_property_read_bool(node, "system-clock-direction-out")) + simple_dai->clk_direction = SND_SOC_CLOCK_OUT; + + dev_dbg(dev, "%s : sysclk = %d, direction %d\n", name, + simple_dai->sysclk, simple_dai->clk_direction); return 0; } @@ -310,7 +314,8 @@ int asoc_simple_card_init_dai(struct snd_soc_dai *dai, int ret; if (simple_dai->sysclk) { - ret = snd_soc_dai_set_sysclk(dai, 0, simple_dai->sysclk, 0); + ret = snd_soc_dai_set_sysclk(dai, 0, simple_dai->sysclk, + simple_dai->clk_direction); if (ret && ret != -ENOTSUPP) { dev_err(dai->dev, "simple-card: set_sysclk error\n"); return ret;