From patchwork Wed Feb 14 13:29:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 10218805 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1FC47601C2 for ; Wed, 14 Feb 2018 13:30:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E4E628FDF for ; Wed, 14 Feb 2018 13:30:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0255A28FE0; Wed, 14 Feb 2018 13:30:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4E054284C9 for ; Wed, 14 Feb 2018 13:30:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030340AbeBNN3Z (ORCPT ); Wed, 14 Feb 2018 08:29:25 -0500 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:35456 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030326AbeBNN3V (ORCPT ); Wed, 14 Feb 2018 08:29:21 -0500 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=sslDFijdEv7FU68Scie3o0KLbQOqk07YwzT+5KPHOs8=; b=ett4htoTZ71Z yH1Z/Qn0d0CxbmivQtjYp7J2x3vtzN/cZTgiwu0pmHTh4O9znEVtaVdkLUnf3S29zAHvMl7NrK4nY oyDYmIxu2EPDKjj7c/QjT4QsuWrBJSSganpUoBR3WY9hRd2Kt6/foogDVVsz6HHckM1alxXmqewFn unb3g=; 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 1elx7g-0004ph-5w; Wed, 14 Feb 2018 13:29:20 +0000 Received: from broonie by debutante with local (Exim 4.90_1) (envelope-from ) id 1elx7f-00070w-No; Wed, 14 Feb 2018 13:29:19 +0000 From: Mark Brown To: Sylwester Nawrocki Cc: Krzysztof Kozlowski , Mark Brown , broonie@kernel.org, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org, b.zolnierkie@samsung.com, sbkim73@samsung.com, jcsing.lee@samsung.com, lgirdwood@gmail.com, krzk@kernel.org, linux-kernel@vger.kernel.org, robh+dt@kernel.org, m.szyprowski@samsung.com, alsa-devel@alsa-project.org Subject: Applied "ASoC: samsung: i2s: Ensure names of supplied clocks are unique" to the asoc tree In-Reply-To: <20180212161538.22669-3-s.nawrocki@samsung.com> Message-Id: Date: Wed, 14 Feb 2018 13:29:19 +0000 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The patch ASoC: samsung: i2s: Ensure names of supplied clocks are unique has been applied to the asoc tree at https://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 aa274c5cfd13381372d2dace32b7354ccba7d2ab Mon Sep 17 00:00:00 2001 From: Sylwester Nawrocki Date: Mon, 12 Feb 2018 17:15:33 +0100 Subject: [PATCH] ASoC: samsung: i2s: Ensure names of supplied clocks are unique In order to support multiple instances of the I2S IP block the platform device name is prepended to each clock registered by the driver. The clock-output-names property is now not used, this should not cause any issues as, for example, CDCLK clock is referenced through DT 'clocks' property, not by name. This change allows to have both I2S0 and I2S1 enabled simultaneously on exynos5433 and working properly when #clock-cells property is specified in respective DT nodes. Signed-off-by: Sylwester Nawrocki Acked-by: Krzysztof Kozlowski Signed-off-by: Mark Brown --- sound/soc/samsung/i2s.c | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index aeba0ae890ea..5088d12faeda 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -1193,11 +1193,13 @@ static void i2s_unregister_clock_provider(struct platform_device *pdev) static int i2s_register_clock_provider(struct platform_device *pdev) { - struct device *dev = &pdev->dev; - struct i2s_dai *i2s = dev_get_drvdata(dev); + const char * const i2s_clk_desc[] = { "cdclk", "rclk_src", "prescaler" }; const char *clk_name[2] = { "i2s_opclk0", "i2s_opclk1" }; const char *p_names[2] = { NULL }; + struct device *dev = &pdev->dev; + struct i2s_dai *i2s = dev_get_drvdata(dev); const struct samsung_i2s_variant_regs *reg_info = i2s->variant_regs; + const char *i2s_clk_name[ARRAY_SIZE(i2s_clk_desc)]; struct clk *rclksrc; int ret, i; @@ -1214,30 +1216,38 @@ static int i2s_register_clock_provider(struct platform_device *pdev) clk_put(rclksrc); } + for (i = 0; i < ARRAY_SIZE(i2s_clk_desc); i++) { + i2s_clk_name[i] = devm_kasprintf(dev, GFP_KERNEL, "%s_%s", + dev_name(dev), i2s_clk_desc[i]); + if (!i2s_clk_name[i]) + return -ENOMEM; + } + if (!(i2s->quirks & QUIRK_NO_MUXPSR)) { /* Activate the prescaler */ u32 val = readl(i2s->addr + I2SPSR); writel(val | PSR_PSREN, i2s->addr + I2SPSR); i2s->clk_table[CLK_I2S_RCLK_SRC] = clk_register_mux(dev, - "i2s_rclksrc", p_names, ARRAY_SIZE(p_names), + i2s_clk_name[CLK_I2S_RCLK_SRC], p_names, + ARRAY_SIZE(p_names), CLK_SET_RATE_NO_REPARENT | CLK_SET_RATE_PARENT, i2s->addr + I2SMOD, reg_info->rclksrc_off, 1, 0, i2s->lock); i2s->clk_table[CLK_I2S_RCLK_PSR] = clk_register_divider(dev, - "i2s_presc", "i2s_rclksrc", + i2s_clk_name[CLK_I2S_RCLK_PSR], + i2s_clk_name[CLK_I2S_RCLK_SRC], CLK_SET_RATE_PARENT, i2s->addr + I2SPSR, 8, 6, 0, i2s->lock); - p_names[0] = "i2s_presc"; + p_names[0] = i2s_clk_name[CLK_I2S_RCLK_PSR]; i2s->clk_data.clk_num = 2; } - of_property_read_string_index(dev->of_node, - "clock-output-names", 0, &clk_name[0]); - i2s->clk_table[CLK_I2S_CDCLK] = clk_register_gate(dev, clk_name[0], - p_names[0], CLK_SET_RATE_PARENT, + i2s->clk_table[CLK_I2S_CDCLK] = clk_register_gate(dev, + i2s_clk_name[CLK_I2S_CDCLK], p_names[0], + CLK_SET_RATE_PARENT, i2s->addr + I2SMOD, reg_info->cdclkcon_off, CLK_GATE_SET_TO_DISABLE, i2s->lock);