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: 9180201 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 F32636075D for ; Thu, 16 Jun 2016 09:23:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DEBB726CFB for ; Thu, 16 Jun 2016 09:23:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D2FE628308; Thu, 16 Jun 2016 09:23:20 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id 4CE7F26CFB for ; Thu, 16 Jun 2016 09:23:19 +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 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-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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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;