From patchwork Mon Jun 6 09:26:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabriel Fernandez X-Patchwork-Id: 69394 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp1388069qgf; Mon, 6 Jun 2016 02:28:48 -0700 (PDT) X-Received: by 10.66.2.168 with SMTP id 8mr23749007pav.152.1465205328420; Mon, 06 Jun 2016 02:28:48 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id zq1si25606297pac.130.2016.06.06.02.28.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Jun 2016 02:28:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1b9qp3-0001oR-60; Mon, 06 Jun 2016 09:27:49 +0000 Received: from mail-wm0-x236.google.com ([2a00:1450:400c:c09::236]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1b9qod-0001Te-0J for linux-arm-kernel@lists.infradead.org; Mon, 06 Jun 2016 09:27:24 +0000 Received: by mail-wm0-x236.google.com with SMTP id c74so36271496wme.0 for ; Mon, 06 Jun 2016 02:27:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Mz2/wK2vmjXVAei4bOSaNqqtGr4Fk5pJqthQTTkva0g=; b=exu0magLawKucAzwH9vZ5PwbcUJB5QIB44wWkfwQjqyNjI0RIgbUnz3QuZH4ms9ayP 58hVjS2qULj3WqWgWkFqi3nPsNU1LhAGndtDejZdcUToFxMU82cYnq11JwlsJO341AU6 q0kGUvYnmismhyQhaL5WvIm6b6ePihdBohtw0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Mz2/wK2vmjXVAei4bOSaNqqtGr4Fk5pJqthQTTkva0g=; b=hAiDNI3tnamV6AH5TOrlq7nQJco4dXnwOw2QEnz4fm0Hxv2cSRRH4r7goDNNQ7Pfw5 OWZ0ES/XPMcHWyT9E3/B9ZIwFmXicXaFy++l9Psh0gYvbkwXbRodJlcuhh3GwwyYKuCy joNqPh0r/WH0Met9GfwowBY5LvOzB+P3kXqDAPey/epMeEkEWTwkcekJaj6nMP14EjK2 7wq3fCxJ7roJ//qMu32ep49Xaxtz4bE3VNy9BFWEP0+dDPahH8nl9TXEL+/JfCn0QBK+ yOU5+kbrhQwl/DXZAa4mALB8Gz0vAICHcJbEQnqrAcsmGBnHxIkxb5eHqa4Fig9AYtEJ 1VbQ== X-Gm-Message-State: ALyK8tK54tSN4l3UjcpOr851WVYkkSp1tFH7yeNRxdNl+K2g5NG4SA7A+u1592DJMaUqWxHR X-Received: by 10.28.186.132 with SMTP id k126mr11067987wmf.103.1465205221565; Mon, 06 Jun 2016 02:27:01 -0700 (PDT) Received: from lmenx315.st.com. ([80.12.59.101]) by smtp.gmail.com with ESMTPSA id s125sm13149091wms.14.2016.06.06.02.26.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 06 Jun 2016 02:27:00 -0700 (PDT) From: Gabriel Fernandez To: Rob Herring , Mark Rutland , Ian Campbell , Kumar Gala , Srinivas Kandagatla , Maxime Coquelin , Patrice Chotard , Russell King , Michael Turquette , Stephen Boyd , Olivier Bideau , Gabriel Fernandez , Geert Uytterhoeven , Sebastian Hesselbarth , Andrzej Hajda , Pankaj Dev , Dinh Nguyen , Arnd Bergmann , Thierry Reding Subject: [PATCH v2 04/13] drivers: clk: st: Add clock propagation for audio clocks Date: Mon, 6 Jun 2016 11:26:23 +0200 Message-Id: <1465205192-7888-5-git-send-email-gabriel.fernandez@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1465205192-7888-1-git-send-email-gabriel.fernandez@linaro.org> References: <1465205192-7888-1-git-send-email-gabriel.fernandez@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160606_022723_389849_9F7AB930 X-CRM114-Status: GOOD ( 14.49 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:236 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, kernel@stlinux.com, vincent.abriou@st.com, arnaud.pouliquen@st.com, linux-kernel@vger.kernel.org, gabriel.fernandez@st.com, Peter Griffin , Lee Jones , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, benjamin.gaignard@st.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org This patch allows fine tuning of the quads FS for audio clocks accuracy. Signed-off-by: Olivier Bideau Signed-off-by: Gabriel Fernandez --- .../devicetree/bindings/clock/st/st,flexgen.txt | 2 ++ drivers/clk/st/clk-flexgen.c | 24 ++++++++++++++++++++++ 2 files changed, 26 insertions(+) -- 1.9.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/Documentation/devicetree/bindings/clock/st/st,flexgen.txt b/Documentation/devicetree/bindings/clock/st/st,flexgen.txt index b7ee5c7..d68f6a5f 100644 --- a/Documentation/devicetree/bindings/clock/st/st,flexgen.txt +++ b/Documentation/devicetree/bindings/clock/st/st,flexgen.txt @@ -60,6 +60,8 @@ This binding uses the common clock binding[2]. Required properties: - compatible : shall be: "st,flexgen" + "st,flexgen-audio", "st,flexgen" (enable clock propagation on parent for + audio use case) - #clock-cells : from common clock binding; shall be set to 1 (multiple clock outputs). diff --git a/drivers/clk/st/clk-flexgen.c b/drivers/clk/st/clk-flexgen.c index 627267c..33d6ced 100644 --- a/drivers/clk/st/clk-flexgen.c +++ b/drivers/clk/st/clk-flexgen.c @@ -15,6 +15,10 @@ #include #include +struct clkgen_data { + unsigned long flags; +}; + struct flexgen { struct clk_hw hw; @@ -259,6 +263,18 @@ static const char ** __init flexgen_get_parents(struct device_node *np, return parents; } +static const struct clkgen_data clkgen_audio = { + .flags = CLK_SET_RATE_PARENT, +}; + +static const struct of_device_id flexgen_of_match[] = { + { + .compatible = "st,flexgen-audio", + .data = &clkgen_audio, + }, + {} +}; + static void __init st_of_flexgen_setup(struct device_node *np) { struct device_node *pnode; @@ -267,6 +283,8 @@ static void __init st_of_flexgen_setup(struct device_node *np) const char **parents; int num_parents, i; spinlock_t *rlock = NULL; + const struct of_device_id *match; + struct clkgen_data *data = NULL; unsigned long flex_flags = 0; int ret; @@ -282,6 +300,12 @@ static void __init st_of_flexgen_setup(struct device_node *np) if (!parents) return; + match = of_match_node(flexgen_of_match, np); + if (match) { + data = (struct clkgen_data *)match->data; + flex_flags = data->flags; + } + clk_data = kzalloc(sizeof(*clk_data), GFP_KERNEL); if (!clk_data) goto err;