From: mturquette@linaro.org (Mike Turquette)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] clk: composite: rename 'div' references to 'rate'
Date: Wed, 10 Apr 2013 15:02:55 -0700 [thread overview]
Message-ID: <1365631378-16103-2-git-send-email-mturquette@linaro.org> (raw)
In-Reply-To: <1365631378-16103-1-git-send-email-mturquette@linaro.org>
Rename all div_hw and div_ops related variables and functions to use
rate_hw, rate_ops, etc. This is to make the rate-change portion of the
composite clk implementation more generic. A patch following this one
will allow for fixed-rate clocks to reuse this infrastructure.
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Cc: Prashant Gaikwad <pgaikwad@nvidia.com>
Cc: Emilio L?pez <emilio@elopez.com.ar>
Cc: Gregory CLEMENT <gregory.clement@free-electrons.com>
---
drivers/clk/clk-composite.c | 40 ++++++++++++++++++++--------------------
include/linux/clk-provider.h | 14 +++++++-------
2 files changed, 27 insertions(+), 27 deletions(-)
diff --git a/drivers/clk/clk-composite.c b/drivers/clk/clk-composite.c
index 097dee4..6f4728c 100644
--- a/drivers/clk/clk-composite.c
+++ b/drivers/clk/clk-composite.c
@@ -47,36 +47,36 @@ static unsigned long clk_composite_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate)
{
struct clk_composite *composite = to_clk_composite(hw);
- const struct clk_ops *div_ops = composite->div_ops;
- struct clk_hw *div_hw = composite->div_hw;
+ const struct clk_ops *rate_ops = composite->rate_ops;
+ struct clk_hw *rate_hw = composite->rate_hw;
- div_hw->clk = hw->clk;
+ rate_hw->clk = hw->clk;
- return div_ops->recalc_rate(div_hw, parent_rate);
+ return rate_ops->recalc_rate(rate_hw, parent_rate);
}
static long clk_composite_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long *prate)
{
struct clk_composite *composite = to_clk_composite(hw);
- const struct clk_ops *div_ops = composite->div_ops;
- struct clk_hw *div_hw = composite->div_hw;
+ const struct clk_ops *rate_ops = composite->rate_ops;
+ struct clk_hw *rate_hw = composite->rate_hw;
- div_hw->clk = hw->clk;
+ rate_hw->clk = hw->clk;
- return div_ops->round_rate(div_hw, rate, prate);
+ return rate_ops->round_rate(rate_hw, rate, prate);
}
static int clk_composite_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate)
{
struct clk_composite *composite = to_clk_composite(hw);
- const struct clk_ops *div_ops = composite->div_ops;
- struct clk_hw *div_hw = composite->div_hw;
+ const struct clk_ops *rate_ops = composite->rate_ops;
+ struct clk_hw *rate_hw = composite->rate_hw;
- div_hw->clk = hw->clk;
+ rate_hw->clk = hw->clk;
- return div_ops->set_rate(div_hw, rate, parent_rate);
+ return rate_ops->set_rate(rate_hw, rate, parent_rate);
}
static int clk_composite_is_enabled(struct clk_hw *hw)
@@ -115,7 +115,7 @@ static void clk_composite_disable(struct clk_hw *hw)
struct clk *clk_register_composite(struct device *dev, const char *name,
const char **parent_names, int num_parents,
struct clk_hw *mux_hw, const struct clk_ops *mux_ops,
- struct clk_hw *div_hw, const struct clk_ops *div_ops,
+ struct clk_hw *rate_hw, const struct clk_ops *rate_ops,
struct clk_hw *gate_hw, const struct clk_ops *gate_ops,
unsigned long flags)
{
@@ -149,15 +149,15 @@ struct clk *clk_register_composite(struct device *dev, const char *name,
clk_composite_ops->set_parent = clk_composite_set_parent;
}
- if (div_hw && div_ops) {
- if (!div_ops->recalc_rate || !div_ops->round_rate ||
- !div_ops->set_rate) {
+ if (rate_hw && rate_ops) {
+ if (!rate_ops->recalc_rate || !rate_ops->round_rate ||
+ !rate_ops->set_rate) {
clk = ERR_PTR(-EINVAL);
goto err;
}
- composite->div_hw = div_hw;
- composite->div_ops = div_ops;
+ composite->rate_hw = rate_hw;
+ composite->rate_ops = rate_ops;
clk_composite_ops->recalc_rate = clk_composite_recalc_rate;
clk_composite_ops->round_rate = clk_composite_round_rate;
clk_composite_ops->set_rate = clk_composite_set_rate;
@@ -187,8 +187,8 @@ struct clk *clk_register_composite(struct device *dev, const char *name,
if (composite->mux_hw)
composite->mux_hw->clk = clk;
- if (composite->div_hw)
- composite->div_hw->clk = clk;
+ if (composite->rate_hw)
+ composite->rate_hw->clk = clk;
if (composite->gate_hw)
composite->gate_hw->clk = clk;
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 9fdfae7..f5ba8c5 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -352,11 +352,11 @@ struct clk *clk_register_fixed_factor(struct device *dev, const char *name,
* struct clk_composite - aggregate clock of mux, divider and gate clocks
*
* @hw: handle between common and hardware-specific interfaces
- * @mux_hw: handle between composite and hardware-specifix mux clock
- * @div_hw: handle between composite and hardware-specifix divider clock
- * @gate_hw: handle between composite and hardware-specifix gate clock
+ * @mux_hw: handle between composite and hardware-specific mux clock
+ * @rate_hw: handle between composite and hardware-specific rateider clock
+ * @gate_hw: handle between composite and hardware-specific gate clock
* @mux_ops: clock ops for mux
- * @div_ops: clock ops for divider
+ * @rate_ops: clock ops for rateider
* @gate_ops: clock ops for gate
*/
struct clk_composite {
@@ -364,18 +364,18 @@ struct clk_composite {
struct clk_ops ops;
struct clk_hw *mux_hw;
- struct clk_hw *div_hw;
+ struct clk_hw *rate_hw;
struct clk_hw *gate_hw;
const struct clk_ops *mux_ops;
- const struct clk_ops *div_ops;
+ const struct clk_ops *rate_ops;
const struct clk_ops *gate_ops;
};
struct clk *clk_register_composite(struct device *dev, const char *name,
const char **parent_names, int num_parents,
struct clk_hw *mux_hw, const struct clk_ops *mux_ops,
- struct clk_hw *div_hw, const struct clk_ops *div_ops,
+ struct clk_hw *rate_hw, const struct clk_ops *rate_ops,
struct clk_hw *gate_hw, const struct clk_ops *gate_ops,
unsigned long flags);
--
1.7.10.4
next prev parent reply other threads:[~2013-04-10 22:02 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-09 13:48 [PATCH 0/3] sunxi: unify main oscillator and its gate Emilio López
2013-04-09 13:48 ` [PATCH 1/3] clk: composite: Add fixed-rate support Emilio López
2013-04-09 15:41 ` Gregory CLEMENT
2013-04-09 16:04 ` Emilio López
2013-04-10 22:02 ` [PATCH 0/3] fixed-rate and fixed-factor clocks in composite clock Mike Turquette
2013-04-10 22:02 ` Mike Turquette [this message]
2013-04-11 11:40 ` [PATCH 1/3] clk: composite: rename 'div' references to 'rate' Prashant Gaikwad
2013-04-11 17:56 ` Mike Turquette
2013-04-10 22:02 ` [PATCH 2/3] clk: composite: allow fixed rates & fixed dividers Mike Turquette
2013-04-11 11:47 ` Prashant Gaikwad
2013-04-11 17:56 ` Mike Turquette
2013-04-10 22:02 ` [PATCH v2 3/3] clk: sunxi: Unify oscillator clock Mike Turquette
2013-04-11 0:07 ` Emilio López
2013-04-12 18:40 ` Mike Turquette
2013-04-11 18:31 ` [PATCH v2 1/2] clk: composite: rename 'div' references to 'rate' Mike Turquette
2013-04-11 18:31 ` [PATCH v2 2/2] clk: composite: allow fixed rates & fixed dividers Mike Turquette
2013-04-09 13:48 ` [PATCH 2/3] clk: sunxi: Unify oscillator clock Emilio López
2013-04-09 13:48 ` [PATCH 3/3] ARM: sunxi: unify osc24M_fixed and osc24M Emilio López
2013-04-15 8:45 ` Maxime Ripard
2013-04-09 14:56 ` [PATCH 0/3] sunxi: unify main oscillator and its gate Gregory CLEMENT
2013-04-09 15:04 ` Emilio López
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=1365631378-16103-2-git-send-email-mturquette@linaro.org \
--to=mturquette@linaro.org \
--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).