From patchwork Thu Jun 16 09:20:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabriel Fernandez X-Patchwork-Id: 70156 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp161327qgy; Thu, 16 Jun 2016 02:22:52 -0700 (PDT) X-Received: by 10.36.211.205 with SMTP id n196mr5844992itg.65.1466068972366; Thu, 16 Jun 2016 02:22:52 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id ai10si7768857pad.165.2016.06.16.02.22.52 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Jun 2016 02:22:52 -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 1bDTUq-0000h4-KZ; Thu, 16 Jun 2016 09:21:56 +0000 Received: from mail-wm0-x22b.google.com ([2a00:1450:400c:c09::22b]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1bDTUD-0008JR-6K for linux-arm-kernel@lists.infradead.org; Thu, 16 Jun 2016 09:21:18 +0000 Received: by mail-wm0-x22b.google.com with SMTP id m124so59965611wme.1 for ; Thu, 16 Jun 2016 02:20:56 -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=VcLZXnNQxiD19Qd611GD9n9OmJ1UnZXxK6SdGqmO13KCYW/tm+chy4u47AeDoV6JO6 u4J/HIL5FqKuu9P6g0lOg5icP+oqRaijDYNc/fXHGIjYbmEvhjmg6VoT8y6IbEYceeSc q+ph2hYDU3tl5/NsUeGceM/KJx4LcMicL1vMU= 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=mynHOo7Id1/KB7UWPp0goU3JtvIt/o7HLj98NF9PXA24DiwC5DqN7KnwF41tvsFBjf YAeYCDswNcs4p4XdrxnhONTocRrOcA5sSUDYAb2dD3dS2I+8BEi5o1/JL07HD9XTeOIK WzPEf0Rozap9anNRvOhb1mA5t7HjUfGvrzbuFiM6VnDPoj856X4JtGuOChww+kMtCJZz 6/CJnq6QtK5951LOLuBphiJQjX1lzBAt1Jos2b9o/QTGxcIgrnK0QLtffPoYvTYRxyJP WnLWHZM2VhDjf7hF4IRoFo9onZGuk+UGJP/vqt6bLGIx0FzHYqECQ9U3dGis+6oBg69m NNkQ== X-Gm-Message-State: ALyK8tI3qdkjEjPoI5dFUG5Do0yWEB90KpDCmllsKYDym5qpKMGMJGxfg1fjZHdDe9COAeA5 X-Received: by 10.28.26.67 with SMTP id a64mr13765145wma.70.1466068855304; Thu, 16 Jun 2016 02:20:55 -0700 (PDT) Received: from lmenx315.st.com. ([80.12.42.230]) by smtp.gmail.com with ESMTPSA id db6sm42619757wjb.2.2016.06.16.02.20.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 16 Jun 2016 02:20:54 -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: [RESEND PATCH v2 04/13] drivers: clk: st: Add clock propagation for audio clocks Date: Thu, 16 Jun 2016 11:20:24 +0200 Message-Id: <1466068833-5055-5-git-send-email-gabriel.fernandez@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1466068833-5055-1-git-send-email-gabriel.fernandez@linaro.org> References: <1466068833-5055-1-git-send-email-gabriel.fernandez@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160616_022117_561280_A67C60F3 X-CRM114-Status: GOOD ( 13.31 ) 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:22b 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;