From patchwork Tue Jun 13 21:07:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 105421 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp603912qgd; Tue, 13 Jun 2017 14:09:03 -0700 (PDT) X-Received: by 10.28.227.67 with SMTP id a64mr4097215wmh.43.1497388143297; Tue, 13 Jun 2017 14:09:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497388143; cv=none; d=google.com; s=arc-20160816; b=Jcj1r2eFsQiROGrzakpx/24hfWAwLZ0uzKD/Imy9Lc4ijYH4al29BM2feU+TfyJYcw uqW3fCZeVhUIF6ijzYw5Mz4sLlnm0x+XDLXvdlm2uo3Sya3QeUaFwMFOGPvNm4kaJCQy C0M1Wod3O28yCZEKC1KHlyfaQphnoaLzry9OlSA8gMIulVFq7dQSHZ2vJweR50Gt+Kmm 4ikpOrUnqCgbO+em5kSM0qxKx6G8z5HZZkQy9oGHCZ70v8rOQqyG46OHggtndKMp5ea8 l32E3AHDEs3tD33fH8ThRyHzatSUYehX4gcW0tld84T4XxK9PtcMSSkMq5mMi+ZxLJQb JHTw== 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 :delivered-to:arc-authentication-results; bh=DOfTOvOu2iuUJpaRxjIcNTnnX49bckGRFmaDiB/INRM=; b=K2feRTjfLIg6exmGbXt0smmA/atyOeKe3yl7mqwdyEIfk5B1K3sN77bOLToAPE5cxq YmSElR/oNc42llxNAB6HDWzhVhiKm6V4YhVR7EGmPjcYSR0bpylElTO1dYC+0jpyzgPl 1GmlBQ++lU8adjO1nQtybG4kIOIZ1tSNffWmAE1kb4fhdltTBriSeKC+cEnkm2qfdfhZ bivREDVm0L34XT9ZzY16KecGzdccwfkAtagZ7tkaGDxhJs2dvM+DcCP30gdpSI9NTJuf +e5R4i9neGIMU8+Lr62PbZ0wg817DqbsKRccMQMq6NPbPW+1fS/A1gAf73E2aMBx37u2 UJ8Q== ARC-Authentication-Results: i=1; mx.google.com; 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 39si1121604wrk.320.2017.06.13.14.09.03; Tue, 13 Jun 2017 14:09:03 -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; 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 166D3267029; Tue, 13 Jun 2017 23:07:58 +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 6C4DB26701F; Tue, 13 Jun 2017 23:07:54 +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=HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_PASS, T_RP_MATCHES_RCVD autolearn=disabled version=3.4.0 Received: from mezzanine.sirena.org.uk (mezzanine.sirena.org.uk [106.187.55.193]) by alsa0.perex.cz (Postfix) with ESMTP id EA358266F88 for ; Tue, 13 Jun 2017 23:07:51 +0200 (CEST) Received: from [2001:470:1f1d:6b5::3] (helo=debutante) by mezzanine.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1dKt2S-0006yM-Mz; Tue, 13 Jun 2017 21:07:49 +0000 Received: from broonie by debutante with local (Exim 4.89) (envelope-from ) id 1dKt2Q-0000Gw-7k; Tue, 13 Jun 2017 22:07:46 +0100 From: Mark Brown To: Kuninori Morimoto In-Reply-To: <87a85iov10.wl%kuninori.morimoto.gx@renesas.com> Message-Id: Date: Tue, 13 Jun 2017 22:07:46 +0100 X-SA-Exim-Connect-IP: 2001:470:1f1d:6b5::3 X-SA-Exim-Mail-From: broonie@sirena.org.uk X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Cc: linux-renesas-soc@vger.kernel.org, alsa-devel@alsa-project.org, Mark Brown , Simon Subject: [alsa-devel] Applied "ASoC: simple_card_utils: add asoc_simple_card_clk_xxx()" 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: simple_card_utils: add asoc_simple_card_clk_xxx() 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 891caea417469b4efdf506b6be1ef461b759c999 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Fri, 9 Jun 2017 00:43:18 +0000 Subject: [PATCH] ASoC: simple_card_utils: add asoc_simple_card_clk_xxx() Current simple-card-utils sets asoc_simple_dai::clk via asoc_simple_card_parse_clk(). Current simple card drivers are using it directly for clk_enable/disable. Encapsulation is one of simple card util's purpose. Let's encapsulate it. Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- include/sound/simple_card_utils.h | 2 ++ sound/soc/generic/simple-card-utils.c | 19 ++++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) -- 2.11.0 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h index 108cae459ed0..840d624148df 100644 --- a/include/sound/simple_card_utils.h +++ b/include/sound/simple_card_utils.h @@ -45,6 +45,8 @@ int asoc_simple_card_parse_clk(struct device *dev, struct device_node *dai_of_node, struct asoc_simple_dai *simple_dai, const char *name); +int asoc_simple_card_clk_enable(struct asoc_simple_dai *dai); +void asoc_simple_card_clk_disable(struct asoc_simple_dai *dai); #define asoc_simple_card_parse_cpu(node, dai_link, \ list_name, cells_name, is_single_link) \ diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c index d9d8b8a58348..beb4e3817d22 100644 --- a/sound/soc/generic/simple-card-utils.c +++ b/sound/soc/generic/simple-card-utils.c @@ -110,6 +110,22 @@ int asoc_simple_card_parse_card_name(struct snd_soc_card *card, } EXPORT_SYMBOL_GPL(asoc_simple_card_parse_card_name); +static void asoc_simple_card_clk_register(struct asoc_simple_dai *dai, + struct clk *clk) +{ + dai->clk = clk; +} + +int asoc_simple_card_clk_enable(struct asoc_simple_dai *dai) +{ + return clk_prepare_enable(dai->clk); +} + +void asoc_simple_card_clk_disable(struct asoc_simple_dai *dai) +{ + clk_disable_unprepare(dai->clk); +} + int asoc_simple_card_parse_clk(struct device *dev, struct device_node *node, struct device_node *dai_of_node, @@ -128,7 +144,8 @@ int asoc_simple_card_parse_clk(struct device *dev, clk = devm_get_clk_from_child(dev, node, NULL); if (!IS_ERR(clk)) { simple_dai->sysclk = clk_get_rate(clk); - simple_dai->clk = clk; + + asoc_simple_card_clk_register(simple_dai, clk); } else if (!of_property_read_u32(node, "system-clock-frequency", &val)) { simple_dai->sysclk = val; } else {