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: 9157641 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 E43E860467 for ; Mon, 6 Jun 2016 09:30:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D21E42521F for ; Mon, 6 Jun 2016 09:30:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C6A7A26E5D; Mon, 6 Jun 2016 09:30:42 +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 16FB22654B for ; Mon, 6 Jun 2016 09:30:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752740AbcFFJag (ORCPT ); Mon, 6 Jun 2016 05:30:36 -0400 Received: from mail-wm0-f47.google.com ([74.125.82.47]:35115 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752122AbcFFJ1D (ORCPT ); Mon, 6 Jun 2016 05:27:03 -0400 Received: by mail-wm0-f47.google.com with SMTP id c74so36271517wme.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=J6RNW5rZTjvM/1UuE0ac71UnNwNq6UEL4iHCpqEcqAv4v+DWrn1JZh2jQigl3sz254 ZkgX08zu0299S5iWtNoxqQ5bIYTPCcRBqBbQLNBk/3LscylO+Z+q2WN4VFKhPaNzDI/R qV+H+HUbAs4KlXwlVoCO20Cv0FHQ5izwVsIVQPxZZYUSCpacECbeqwkabYDBy4RbZKe+ YFSF64ilFMQBS9HL//hDe0cD+pybXB6o0OjlODKyOVpHfiM8DbNrNO8ljaZKzWzEM0LB my7UZFHLiaSD62mK+6K3LEHOyQZda48/uCIqlXilOUIczSENsa+ut5GZUrn+fXq5q82Q mlSQ== X-Gm-Message-State: ALyK8tIKY1gFjMFxevWsgd8boBmNdZVnSukzUJF6ndnR/MJ/yg1fuMaIAMo8+QCqiOOuvWcr 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 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 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> Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.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 | 2 ++ drivers/clk/st/clk-flexgen.c | 24 ++++++++++++++++++++++ 2 files changed, 26 insertions(+) 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;