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: 68019 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp2512536qge; Wed, 18 May 2016 01:42:12 -0700 (PDT) X-Received: by 10.98.11.7 with SMTP id t7mr8956186pfi.159.1463560932342; Wed, 18 May 2016 01:42:12 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fk7si10812327pab.97.2016.05.18.01.42.12; Wed, 18 May 2016 01:42:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752855AbcERImB (ORCPT + 29 others); Wed, 18 May 2016 04:42:01 -0400 Received: from mail-wm0-f46.google.com ([74.125.82.46]:35963 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752830AbcERIlz (ORCPT ); Wed, 18 May 2016 04:41:55 -0400 Received: by mail-wm0-f46.google.com with SMTP id n129so173523591wmn.1 for ; Wed, 18 May 2016 01:41:54 -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=OIA5Wwc9cChtJ8st9lyfiajklQgGClt4Z8tRdt+AX99EKkMK6wbNPZpHRbdcYw8mCj tnA12hZNskw62hwyX20PZHwAbTj2Gct/b2WzpkYp3G0sCQMDFOIxTFSlA2qXINZpoJhS tVtQpsBASIJwMm37RTnZWBf4nW3qO2JLIegLKoCClRbXdHbMOO28mbFf3XuKM59gfdLf WRuloIc9h5qNj2r/TNAxyHlhkXn9d7DM7YJKbCqvVz15nh3ResJDo6kZe/VEO+0+kpGF 5cU3R+QeHH0KIl6B5D5WJc1Qa46KpPJ6MngRIt+eJa3x/T1G/7V0EMLrHcQtIRNCP3x0 MH1A== X-Gm-Message-State: AOPr4FWTa4tk+5LjtP3217ANGOtaqmr/1M0rsubKwA0qZjuZC72OFwNApUMrPVL5w46/V6l6 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 Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@stlinux.com, linux-clk@vger.kernel.org, Lee Jones , Peter Griffin , , , 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 | 1 + drivers/clk/st/clk-flexgen.c | 24 ++++++++++++++++++++++ 2 files changed, 25 insertions(+) -- 1.9.1 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;