From patchwork Wed May 18 08:41: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: 9117111 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4F92EBF29F for ; Wed, 18 May 2016 08:44:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D0C0D20376 for ; Wed, 18 May 2016 08:44:26 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D05AE20320 for ; Wed, 18 May 2016 08:43:58 +0000 (UTC) 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 1b2x3g-0000z6-Nm; Wed, 18 May 2016 08:42:24 +0000 Received: from mail-wm0-x230.google.com ([2a00:1450:400c:c09::230]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1b2x3X-0000rf-LY for linux-arm-kernel@lists.infradead.org; Wed, 18 May 2016 08:42:17 +0000 Received: by mail-wm0-x230.google.com with SMTP id a17so67750566wme.0 for ; Wed, 18 May 2016 01:41:55 -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=nqeFwZZ5wjCKRXBZnYUUCRa2UnAqYScJJuKm1OIk7iw=; b=dvDuO4lPmJQCtpBhk/rW9YAwhJx7M8wjeaOtn3WJmZ8lNarl/oxynEjEPznGPywJ8T Yf/YcWn0TvvVPsuQ7KV4cNt0HHlE1AHIPF2v3/E8Dxu5spCPI9nKefJJe8d3ZeESWY5e AkCYCuGH2cMZMr+U3AXlXVnBw/9a5U2rYgdJE= 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=nqeFwZZ5wjCKRXBZnYUUCRa2UnAqYScJJuKm1OIk7iw=; b=bUVe1F9eDq3D7wu0lz1x5ZAglpIPNlpsQPbtDTANnjGP/iDdrLTGQdfTvjqp+usxSY NdfrmUuPLANCS3sxKSbjmXXNLU0kzLXKkRyXleQVqocSyLS6p/dgB7XedtUDkL92sW3O OouEI0pvc69Of9NFgoO95yTr5mhdDPpkWzWNjCe4j+4h0F4erBcXpppma/1XIdfVgczw kqcuVuQq23qyiVfmLmqX1nDNj5PR+8bZAWbmwxFmC1ZuDlslCfMUIaFfpx7/MQdGWsLP SM5NDjVGuZSF+80BDauxwIYBd3L7ew9ufC04zp5InHCU4Zm6HfwA+vSNLb7jCMVzVVkW s+xA== X-Gm-Message-State: AOPr4FX1FOOqTtKGj+PONY2e481QGPg+4YDzs+e1Kyno6YlOAGgov+FYTSxG49xaA4o3Aa+W X-Received: by 10.28.194.69 with SMTP id s66mr6216629wmf.88.1463560914108; Wed, 18 May 2016 01:41:54 -0700 (PDT) Received: from lmenx315.st.com. ([80.12.39.177]) by smtp.gmail.com with ESMTPSA id kz1sm7374554wjc.46.2016.05.18.01.41.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 May 2016 01:41:47 -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 02/11] drivers: clk: st: Add clock propagation for audio clocks Date: Wed, 18 May 2016 10:41:23 +0200 Message-Id: <1463560892-7209-3-git-send-email-gabriel.fernandez@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1463560892-7209-1-git-send-email-gabriel.fernandez@linaro.org> References: <1463560892-7209-1-git-send-email-gabriel.fernandez@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160518_014216_010260_24CC54C5 X-CRM114-Status: GOOD ( 14.69 ) X-Spam-Score: -2.7 (--) 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, 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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 | 1 + drivers/clk/st/clk-flexgen.c | 24 ++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/Documentation/devicetree/bindings/clock/st/st,flexgen.txt b/Documentation/devicetree/bindings/clock/st/st,flexgen.txt index b7ee5c7..15b33c7 100644 --- a/Documentation/devicetree/bindings/clock/st/st,flexgen.txt +++ b/Documentation/devicetree/bindings/clock/st/st,flexgen.txt @@ -60,6 +60,7 @@ This binding uses the common clock binding[2]. Required properties: - compatible : shall be: "st,flexgen" + "st,stih407-clkgend0", "st,flexgen" (enable clock propagation on parent) - #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..3ff51ec 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_d0 = { + .flags = CLK_SET_RATE_PARENT, +}; + +static const struct of_device_id flexgen_of_match[] = { + { + .compatible = "st,stih407-clkgend0", + .data = &clkgen_d0, + }, + {} +}; + 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;