* [PATCH] clk: sunxi: Fix factor clocks usage for sun9i core clocks
@ 2014-11-27 9:29 Chen-Yu Tsai
2014-11-30 21:29 ` Maxime Ripard
0 siblings, 1 reply; 4+ messages in thread
From: Chen-Yu Tsai @ 2014-11-27 9:29 UTC (permalink / raw)
To: linux-arm-kernel
The sunxi factor clocks usage was changed in
clk: sunxi: Give sunxi_factors_register a registers parameter
However the sun9i core clocks were not fixed up in that patch,
resulting in breakage. This patch fixes that.
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Cc: Hans de Goede <hdegoede@redhat.com>
---
This patch is for 3.20.
A bit of boiler plate code for each clock provider.
Maybe we should add a local helper or something?
---
drivers/clk/sunxi/clk-sun9i-core.c | 62 ++++++++++++++++++++++++++++++++++----
1 file changed, 56 insertions(+), 6 deletions(-)
diff --git a/drivers/clk/sunxi/clk-sun9i-core.c b/drivers/clk/sunxi/clk-sun9i-core.c
index 3cb9036..9b5e7a1 100644
--- a/drivers/clk/sunxi/clk-sun9i-core.c
+++ b/drivers/clk/sunxi/clk-sun9i-core.c
@@ -89,7 +89,17 @@ static DEFINE_SPINLOCK(sun9i_a80_pll4_lock);
static void __init sun9i_a80_pll4_setup(struct device_node *node)
{
- sunxi_factors_register(node, &sun9i_a80_pll4_data, &sun9i_a80_pll4_lock);
+ void __iomem *reg;
+
+ reg = of_io_request_and_map(node, 0, of_node_full_name(node));
+ if (!reg) {
+ pr_err("Could not get registers for a80-pll4-clk: %s\n",
+ node->name);
+ return;
+ }
+
+ sunxi_factors_register(node, &sun9i_a80_pll4_data,
+ &sun9i_a80_pll4_lock, reg);
}
CLK_OF_DECLARE(sun9i_a80_pll4, "allwinner,sun9i-a80-pll4-clk", sun9i_a80_pll4_setup);
@@ -139,8 +149,18 @@ static DEFINE_SPINLOCK(sun9i_a80_gt_lock);
static void __init sun9i_a80_gt_setup(struct device_node *node)
{
- struct clk *gt = sunxi_factors_register(node, &sun9i_a80_gt_data,
- &sun9i_a80_gt_lock);
+ void __iomem *reg;
+ struct clk *gt;
+
+ reg = of_io_request_and_map(node, 0, of_node_full_name(node));
+ if (!reg) {
+ pr_err("Could not get registers for a80-gt-clk: %s\n",
+ node->name);
+ return;
+ }
+
+ gt = sunxi_factors_register(node, &sun9i_a80_gt_data,
+ &sun9i_a80_gt_lock, reg);
/* The GT bus clock needs to be always enabled */
__clk_get(gt);
@@ -194,7 +214,17 @@ static DEFINE_SPINLOCK(sun9i_a80_ahb_lock);
static void __init sun9i_a80_ahb_setup(struct device_node *node)
{
- sunxi_factors_register(node, &sun9i_a80_ahb_data, &sun9i_a80_ahb_lock);
+ void __iomem *reg;
+
+ reg = of_io_request_and_map(node, 0, of_node_full_name(node));
+ if (!reg) {
+ pr_err("Could not get registers for a80-ahb-clk: %s\n",
+ node->name);
+ return;
+ }
+
+ sunxi_factors_register(node, &sun9i_a80_ahb_data,
+ &sun9i_a80_ahb_lock, reg);
}
CLK_OF_DECLARE(sun9i_a80_ahb, "allwinner,sun9i-a80-ahb-clk", sun9i_a80_ahb_setup);
@@ -210,7 +240,17 @@ static DEFINE_SPINLOCK(sun9i_a80_apb0_lock);
static void __init sun9i_a80_apb0_setup(struct device_node *node)
{
- sunxi_factors_register(node, &sun9i_a80_apb0_data, &sun9i_a80_apb0_lock);
+ void __iomem *reg;
+
+ reg = of_io_request_and_map(node, 0, of_node_full_name(node));
+ if (!reg) {
+ pr_err("Could not get registers for a80-apb0-clk: %s\n",
+ node->name);
+ return;
+ }
+
+ sunxi_factors_register(node, &sun9i_a80_apb0_data,
+ &sun9i_a80_apb0_lock, reg);
}
CLK_OF_DECLARE(sun9i_a80_apb0, "allwinner,sun9i-a80-apb0-clk", sun9i_a80_apb0_setup);
@@ -266,6 +306,16 @@ static DEFINE_SPINLOCK(sun9i_a80_apb1_lock);
static void __init sun9i_a80_apb1_setup(struct device_node *node)
{
- sunxi_factors_register(node, &sun9i_a80_apb1_data, &sun9i_a80_apb1_lock);
+ void __iomem *reg;
+
+ reg = of_io_request_and_map(node, 0, of_node_full_name(node));
+ if (!reg) {
+ pr_err("Could not get registers for a80-apb1-clk: %s\n",
+ node->name);
+ return;
+ }
+
+ sunxi_factors_register(node, &sun9i_a80_apb1_data,
+ &sun9i_a80_apb1_lock, reg);
}
CLK_OF_DECLARE(sun9i_a80_apb1, "allwinner,sun9i-a80-apb1-clk", sun9i_a80_apb1_setup);
--
2.1.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] clk: sunxi: Fix factor clocks usage for sun9i core clocks
2014-11-27 9:29 [PATCH] clk: sunxi: Fix factor clocks usage for sun9i core clocks Chen-Yu Tsai
@ 2014-11-30 21:29 ` Maxime Ripard
2014-12-01 3:30 ` Chen-Yu Tsai
0 siblings, 1 reply; 4+ messages in thread
From: Maxime Ripard @ 2014-11-30 21:29 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
On Thu, Nov 27, 2014 at 05:29:30PM +0800, Chen-Yu Tsai wrote:
> The sunxi factor clocks usage was changed in
>
> clk: sunxi: Give sunxi_factors_register a registers parameter
>
> However the sun9i core clocks were not fixed up in that patch,
> resulting in breakage. This patch fixes that.
>
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> Cc: Hans de Goede <hdegoede@redhat.com>
Applied, thanks!
> This patch is for 3.20.
>
> A bit of boiler plate code for each clock provider.
> Maybe we should add a local helper or something?
Well, isn't that expected since we actually just moved it out?
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141130/4bfba96a/attachment.sig>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] clk: sunxi: Fix factor clocks usage for sun9i core clocks
2014-11-30 21:29 ` Maxime Ripard
@ 2014-12-01 3:30 ` Chen-Yu Tsai
2014-12-01 10:49 ` Maxime Ripard
0 siblings, 1 reply; 4+ messages in thread
From: Chen-Yu Tsai @ 2014-12-01 3:30 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Dec 1, 2014 at 5:29 AM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> Hi,
>
> On Thu, Nov 27, 2014 at 05:29:30PM +0800, Chen-Yu Tsai wrote:
>> The sunxi factor clocks usage was changed in
>>
>> clk: sunxi: Give sunxi_factors_register a registers parameter
>>
>> However the sun9i core clocks were not fixed up in that patch,
>> resulting in breakage. This patch fixes that.
>>
>> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
>> Cc: Hans de Goede <hdegoede@redhat.com>
>
> Applied, thanks!
Thanks. Note that I'm tracking patches you've merged for 3.20
in my own sunxi-next branch on github.
>> This patch is for 3.20.
>>
>> A bit of boiler plate code for each clock provider.
>> Maybe we should add a local helper or something?
>
> Well, isn't that expected since we actually just moved it out?
I'll look into making a nice macro for this.
ChenYu
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] clk: sunxi: Fix factor clocks usage for sun9i core clocks
2014-12-01 3:30 ` Chen-Yu Tsai
@ 2014-12-01 10:49 ` Maxime Ripard
0 siblings, 0 replies; 4+ messages in thread
From: Maxime Ripard @ 2014-12-01 10:49 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Dec 01, 2014 at 11:30:54AM +0800, Chen-Yu Tsai wrote:
> >> This patch is for 3.20.
> >>
> >> A bit of boiler plate code for each clock provider.
> >> Maybe we should add a local helper or something?
> >
> > Well, isn't that expected since we actually just moved it out?
>
> I'll look into making a nice macro for this.
Please don't. We removed it from the common code for a reason, there's
no point in putting it back.
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141201/a0d30058/attachment.sig>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-12-01 10:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-27 9:29 [PATCH] clk: sunxi: Fix factor clocks usage for sun9i core clocks Chen-Yu Tsai
2014-11-30 21:29 ` Maxime Ripard
2014-12-01 3:30 ` Chen-Yu Tsai
2014-12-01 10:49 ` Maxime Ripard
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.