linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: heiko@sntech.de (Heiko Stübner)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 02/14] clk: composite: allow read-only clocks
Date: Thu, 03 Jul 2014 01:57:30 +0200	[thread overview]
Message-ID: <1461225.1d2kt5TZOy@diego> (raw)
In-Reply-To: <156042792.J76K6jxIGl@diego>

This allows readl-only composite clocks by making mux_ops->set_parent and
divider_ops->round_rate/set_rate optional.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Acked-By: Max Schwarz <max.schwarz@online.de>
Tested-By: Max Schwarz <max.schwarz@online.de>
---
 drivers/clk/clk-composite.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/clk/clk-composite.c b/drivers/clk/clk-composite.c
index 9548bfc..faf7c32 100644
--- a/drivers/clk/clk-composite.c
+++ b/drivers/clk/clk-composite.c
@@ -207,7 +207,7 @@ struct clk *clk_register_composite(struct device *dev, const char *name,
 	clk_composite_ops = &composite->ops;
 
 	if (mux_hw && mux_ops) {
-		if (!mux_ops->get_parent || !mux_ops->set_parent) {
+		if (!mux_ops->get_parent) {
 			clk = ERR_PTR(-EINVAL);
 			goto err;
 		}
@@ -215,7 +215,8 @@ struct clk *clk_register_composite(struct device *dev, const char *name,
 		composite->mux_hw = mux_hw;
 		composite->mux_ops = mux_ops;
 		clk_composite_ops->get_parent = clk_composite_get_parent;
-		clk_composite_ops->set_parent = clk_composite_set_parent;
+		if (mux_ops->set_parent)
+			clk_composite_ops->set_parent = clk_composite_set_parent;
 		if (mux_ops->determine_rate)
 			clk_composite_ops->determine_rate = clk_composite_determine_rate;
 	}
@@ -232,10 +233,6 @@ struct clk *clk_register_composite(struct device *dev, const char *name,
 			if (rate_ops->set_rate) {
 				clk_composite_ops->set_rate = clk_composite_set_rate;
 			}
-		} else {
-			WARN(rate_ops->set_rate,
-				"%s: missing round_rate op is required\n",
-				__func__);
 		}
 
 		composite->rate_hw = rate_hw;
-- 
1.9.0

  parent reply	other threads:[~2014-07-02 23:57 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-02 23:53 [PATCH v5 00/14] Clock support for rk3066,rk3188 and rk3288 Heiko Stübner
2014-07-02 23:56 ` [PATCH v5 01/14] clk: composite: support determine_rate using rate_ops->round_rate + mux_ops->set_parent Heiko Stübner
2014-07-18 13:55   ` Gabriel Fernandez
2014-07-18 16:00     ` Heiko Stübner
2014-07-02 23:57 ` Heiko Stübner [this message]
2014-07-02 23:58 ` [PATCH v5 03/14] clk: composite: improve rate_hw sanity check logic Heiko Stübner
2014-07-02 23:58 ` [PATCH v5 04/14] clk: rockchip: add basic infrastructure for clock branches Heiko Stübner
2014-07-02 23:59 ` [PATCH v5 05/14] clk: rockchip: add clock type for pll clocks and pll used on rk3066 Heiko Stübner
2014-07-02 23:59 ` [PATCH v5 06/14] clk: rockchip: add reset controller Heiko Stübner
2014-07-03  0:00 ` [PATCH v5 07/14] dt-bindings: add documentation for rk3188 clock and reset unit Heiko Stübner
2014-07-03  0:01 ` [PATCH v5 08/14] clk: rockchip: add clock driver for rk3188 and rk3066 clocks Heiko Stübner
2014-07-03  0:02 ` [PATCH v5 09/14] dt-bindings: add documentation for rk3288 cru Heiko Stübner
2014-07-03  0:02 ` [PATCH v5 10/14] clk: rockchip: add clock controller for rk3288 Heiko Stübner
2014-07-03  0:02 ` [PATCH v5 11/14] ARM: rockchip: Select ARCH_HAS_RESET_CONTROLLER Heiko Stübner
2014-07-03  0:03 ` [PATCH v5 12/14] ARM: dts: rockchip: add cru nodes and update device clocks to use it Heiko Stübner
2014-07-03  0:03 ` [PATCH v5 13/14] ARM: dts: rockchip: move oscillator input clock into main dtsi Heiko Stübner
2014-07-03  0:04 ` [PATCH v5 14/14] arm: dts: rockchip: remove obsolete clock gate definitions Heiko Stübner
2014-07-13 19:46 ` [PATCH v5 00/14] Clock support for rk3066,rk3188 and rk3288 Mike Turquette
2014-07-14  3:12   ` Olof Johansson
2014-07-14  8:07     ` Heiko Stübner
2014-07-22 15:45       ` Heiko Stübner
2014-07-24  2:44         ` Mike Turquette

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1461225.1d2kt5TZOy@diego \
    --to=heiko@sntech.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).