diff options
author | Rob Herring <robh@kernel.org> | 2014-03-01 23:05:44 -0500 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2014-06-24 15:21:22 -0400 |
commit | a54c959d8be9d057b1a192e34a378b74dd81c5f6 (patch) | |
tree | 480857c798d96a8e859ee7d010a21a32733a3d32 | |
parent | 2e45278592de32a47aa12ab09c2fcc5535aa0271 (diff) |
clk: versatile: add versatile OSC support
Versatile platforms share the same OSC programming model as Integrator
platforms. Add the necessary parameters and init functions for Versatile.
Renaming the file to clk-versatile.c as versatile is used as the family
name for ARM, Ltd. boards.
Signed-off-by: Rob Herring <robh@kernel.org>
Acked-by: Mike Turquette <mturquette@linaro.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r-- | drivers/clk/versatile/Makefile | 3 | ||||
-rw-r--r-- | drivers/clk/versatile/clk-versatile.c (renamed from drivers/clk/versatile/clk-integrator.c) | 38 |
2 files changed, 36 insertions, 5 deletions
diff --git a/drivers/clk/versatile/Makefile b/drivers/clk/versatile/Makefile index fd449f9b006d..162e519cb0f9 100644 --- a/drivers/clk/versatile/Makefile +++ b/drivers/clk/versatile/Makefile | |||
@@ -1,6 +1,5 @@ | |||
1 | # Makefile for Versatile-specific clocks | 1 | # Makefile for Versatile-specific clocks |
2 | obj-$(CONFIG_ICST) += clk-icst.o | 2 | obj-$(CONFIG_ICST) += clk-icst.o clk-versatile.o |
3 | obj-$(CONFIG_ARCH_INTEGRATOR) += clk-integrator.o | ||
4 | obj-$(CONFIG_INTEGRATOR_IMPD1) += clk-impd1.o | 3 | obj-$(CONFIG_INTEGRATOR_IMPD1) += clk-impd1.o |
5 | obj-$(CONFIG_ARCH_REALVIEW) += clk-realview.o | 4 | obj-$(CONFIG_ARCH_REALVIEW) += clk-realview.o |
6 | obj-$(CONFIG_ARCH_VEXPRESS) += clk-vexpress.o | 5 | obj-$(CONFIG_ARCH_VEXPRESS) += clk-vexpress.o |
diff --git a/drivers/clk/versatile/clk-integrator.c b/drivers/clk/versatile/clk-versatile.c index 734c4b8fe6ab..a76981e88cb6 100644 --- a/drivers/clk/versatile/clk-integrator.c +++ b/drivers/clk/versatile/clk-versatile.c | |||
@@ -1,5 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Clock driver for the ARM Integrator/AP and Integrator/CP boards | 2 | * Clock driver for the ARM Integrator/AP, Integrator/CP, Versatile AB and |
3 | * Versatile PB boards. | ||
3 | * Copyright (C) 2012 Linus Walleij | 4 | * Copyright (C) 2012 Linus Walleij |
4 | * | 5 | * |
5 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
@@ -17,6 +18,9 @@ | |||
17 | 18 | ||
18 | #define INTEGRATOR_HDR_LOCK_OFFSET 0x14 | 19 | #define INTEGRATOR_HDR_LOCK_OFFSET 0x14 |
19 | 20 | ||
21 | #define VERSATILE_SYS_OSCCLCD_OFFSET 0x1c | ||
22 | #define VERSATILE_SYS_LOCK_OFFSET 0x20 | ||
23 | |||
20 | /* Base offset for the core module */ | 24 | /* Base offset for the core module */ |
21 | static void __iomem *cm_base; | 25 | static void __iomem *cm_base; |
22 | 26 | ||
@@ -37,11 +41,27 @@ static const struct clk_icst_desc __initdata cm_auxosc_desc = { | |||
37 | .lock_offset = INTEGRATOR_HDR_LOCK_OFFSET, | 41 | .lock_offset = INTEGRATOR_HDR_LOCK_OFFSET, |
38 | }; | 42 | }; |
39 | 43 | ||
40 | static void __init of_integrator_cm_osc_setup(struct device_node *np) | 44 | static const struct icst_params versatile_auxosc_params = { |
45 | .vco_max = ICST307_VCO_MAX, | ||
46 | .vco_min = ICST307_VCO_MIN, | ||
47 | .vd_min = 4 + 8, | ||
48 | .vd_max = 511 + 8, | ||
49 | .rd_min = 1 + 2, | ||
50 | .rd_max = 127 + 2, | ||
51 | .s2div = icst307_s2div, | ||
52 | .idx2s = icst307_idx2s, | ||
53 | }; | ||
54 | |||
55 | static const struct clk_icst_desc versatile_auxosc_desc __initconst = { | ||
56 | .params = &versatile_auxosc_params, | ||
57 | .vco_offset = VERSATILE_SYS_OSCCLCD_OFFSET, | ||
58 | .lock_offset = VERSATILE_SYS_LOCK_OFFSET, | ||
59 | }; | ||
60 | static void __init cm_osc_setup(struct device_node *np, | ||
61 | const struct clk_icst_desc *desc) | ||
41 | { | 62 | { |
42 | struct clk *clk = ERR_PTR(-EINVAL); | 63 | struct clk *clk = ERR_PTR(-EINVAL); |
43 | const char *clk_name = np->name; | 64 | const char *clk_name = np->name; |
44 | const struct clk_icst_desc *desc = &cm_auxosc_desc; | ||
45 | const char *parent_name; | 65 | const char *parent_name; |
46 | 66 | ||
47 | if (!cm_base) { | 67 | if (!cm_base) { |
@@ -65,5 +85,17 @@ static void __init of_integrator_cm_osc_setup(struct device_node *np) | |||
65 | if (!IS_ERR(clk)) | 85 | if (!IS_ERR(clk)) |
66 | of_clk_add_provider(np, of_clk_src_simple_get, clk); | 86 | of_clk_add_provider(np, of_clk_src_simple_get, clk); |
67 | } | 87 | } |
88 | |||
89 | static void __init of_integrator_cm_osc_setup(struct device_node *np) | ||
90 | { | ||
91 | cm_osc_setup(np, &cm_auxosc_desc); | ||
92 | } | ||
68 | CLK_OF_DECLARE(integrator_cm_auxosc_clk, | 93 | CLK_OF_DECLARE(integrator_cm_auxosc_clk, |
69 | "arm,integrator-cm-auxosc", of_integrator_cm_osc_setup); | 94 | "arm,integrator-cm-auxosc", of_integrator_cm_osc_setup); |
95 | |||
96 | static void __init of_versatile_cm_osc_setup(struct device_node *np) | ||
97 | { | ||
98 | cm_osc_setup(np, &versatile_auxosc_desc); | ||
99 | } | ||
100 | CLK_OF_DECLARE(versatile_cm_auxosc_clk, | ||
101 | "arm,versatile-cm-auxosc", of_versatile_cm_osc_setup); | ||