From: Maxime Ripard <maxime.ripard@free-electrons.com>
To: Mike Turquette <mturquette@linaro.org>
Cc: Emilio Lopez <emilio@elopez.com.ar>,
kevin.z.m.zh@gmail.com, sunny@allwinnertech.com,
shuge@allwinnertech.com, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com,
Maxime Ripard <maxime.ripard@free-electrons.com>
Subject: [PATCHv3 2/4] clk: sunxi: Allow to specify the divider width from the dividers data
Date: Mon, 5 Aug 2013 22:42:59 +0200 [thread overview]
Message-ID: <1375735381-18214-3-git-send-email-maxime.ripard@free-electrons.com> (raw)
In-Reply-To: <1375735381-18214-1-git-send-email-maxime.ripard@free-electrons.com>
The divider width used to be hardcoded. Some A31 dividers are no longer
with the hardcoded width, so we need to make it specific to each divider
and set it in the dividers data.
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Emilio López <emilio@elopez.com.ar>
---
drivers/clk/sunxi/clk-sunxi.c | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)
diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c
index 9a03ede..cd07169 100644
--- a/drivers/clk/sunxi/clk-sunxi.c
+++ b/drivers/clk/sunxi/clk-sunxi.c
@@ -278,26 +278,28 @@ static void __init sunxi_mux_clk_setup(struct device_node *node,
* sunxi_divider_clk_setup() - Setup function for simple divider clocks
*/
-#define SUNXI_DIVISOR_WIDTH 2
-
struct div_data {
- u8 shift;
- u8 pow;
+ u8 shift;
+ u8 pow;
+ u8 width;
};
static const __initconst struct div_data sun4i_axi_data = {
- .shift = 0,
- .pow = 0,
+ .shift = 0,
+ .pow = 0,
+ .width = 2,
};
static const __initconst struct div_data sun4i_ahb_data = {
- .shift = 4,
- .pow = 1,
+ .shift = 4,
+ .pow = 1,
+ .width = 2,
};
static const __initconst struct div_data sun4i_apb0_data = {
- .shift = 8,
- .pow = 1,
+ .shift = 8,
+ .pow = 1,
+ .width = 2,
};
static void __init sunxi_divider_clk_setup(struct device_node *node,
@@ -313,7 +315,7 @@ static void __init sunxi_divider_clk_setup(struct device_node *node,
clk_parent = of_clk_get_parent_name(node, 0);
clk = clk_register_divider(NULL, clk_name, clk_parent, 0,
- reg, data->shift, SUNXI_DIVISOR_WIDTH,
+ reg, data->shift, data->width,
data->pow ? CLK_DIVIDER_POWER_OF_TWO : 0,
&clk_lock);
if (clk) {
--
1.8.3.4
next prev parent reply other threads:[~2013-08-05 20:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-05 20:42 [PATCHv3 0/4] Add support for the Allwinner A31 clocks Maxime Ripard
2013-08-05 20:42 ` [PATCHv3 1/4] clk: sunxi: Rename the structure to prepare the addition of sun6i Maxime Ripard
2013-08-05 20:42 ` Maxime Ripard [this message]
2013-08-05 20:43 ` [PATCHv3 3/4] clk: sunxi: Add A31 clocks support Maxime Ripard
2013-08-12 14:14 ` Mark Rutland
2013-08-12 20:44 ` Maxime Ripard
2013-08-19 20:14 ` Emilio López
2013-08-20 6:25 ` Maxime Ripard
2013-08-05 20:43 ` [PATCHv3 4/4] ARM: sun6i: Enable clock support in the DTSI Maxime Ripard
2013-08-12 8:41 ` [PATCHv3 0/4] Add support for the Allwinner A31 clocks Maxime Ripard
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=1375735381-18214-3-git-send-email-maxime.ripard@free-electrons.com \
--to=maxime.ripard@free-electrons.com \
--cc=emilio@elopez.com.ar \
--cc=kevin.z.m.zh@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sunxi@googlegroups.com \
--cc=mturquette@linaro.org \
--cc=shuge@allwinnertech.com \
--cc=sunny@allwinnertech.com \
/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
all inboxes | Powered by JetHome®