aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTero Kristo <t-kristo@ti.com>2015-03-02 04:07:35 -0500
committerTero Kristo <t-kristo@ti.com>2015-06-02 05:30:58 -0400
commit59245ce01a2e3ded836172266e3ac2e576a03333 (patch)
tree6cead85bf1fbf726bfcceab3ab98d9eb8c341c44
parentb138b0283d35bed0cd3353d7e39add8ac493eb37 (diff)
clk: ti: move OMAP4+ DPLL implementation under drivers/clk
With the legacy clock support gone, the OMAP4 specific DPLL implementations can be moved under the clock driver. Change some of the function prototypes to be static at the same time, and remove some exports from the global TI clock driver header. Signed-off-by: Tero Kristo <t-kristo@ti.com>
-rw-r--r--arch/arm/mach-omap2/Makefile6
-rw-r--r--arch/arm/mach-omap2/clock.h4
-rw-r--r--drivers/clk/ti/Makefile6
-rw-r--r--drivers/clk/ti/clock.h14
-rw-r--r--drivers/clk/ti/dpll44xx.c (renamed from arch/arm/mach-omap2/dpll44xx.c)23
-rw-r--r--include/linux/clk/ti.h13
6 files changed, 33 insertions, 33 deletions
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index fcb5d47f88ca..5bcd282f04b3 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -193,12 +193,12 @@ obj-$(CONFIG_ARCH_OMAP3) += clock3517.o clock36xx.o
193obj-$(CONFIG_ARCH_OMAP3) += dpll3xxx.o 193obj-$(CONFIG_ARCH_OMAP3) += dpll3xxx.o
194obj-$(CONFIG_ARCH_OMAP3) += clkt_iclk.o 194obj-$(CONFIG_ARCH_OMAP3) += clkt_iclk.o
195obj-$(CONFIG_ARCH_OMAP4) += $(clock-common) 195obj-$(CONFIG_ARCH_OMAP4) += $(clock-common)
196obj-$(CONFIG_ARCH_OMAP4) += dpll3xxx.o dpll44xx.o 196obj-$(CONFIG_ARCH_OMAP4) += dpll3xxx.o
197obj-$(CONFIG_SOC_AM33XX) += $(clock-common) dpll3xxx.o 197obj-$(CONFIG_SOC_AM33XX) += $(clock-common) dpll3xxx.o
198obj-$(CONFIG_SOC_OMAP5) += $(clock-common) 198obj-$(CONFIG_SOC_OMAP5) += $(clock-common)
199obj-$(CONFIG_SOC_OMAP5) += dpll3xxx.o dpll44xx.o 199obj-$(CONFIG_SOC_OMAP5) += dpll3xxx.o
200obj-$(CONFIG_SOC_DRA7XX) += $(clock-common) 200obj-$(CONFIG_SOC_DRA7XX) += $(clock-common)
201obj-$(CONFIG_SOC_DRA7XX) += dpll3xxx.o dpll44xx.o 201obj-$(CONFIG_SOC_DRA7XX) += dpll3xxx.o
202obj-$(CONFIG_SOC_AM43XX) += $(clock-common) dpll3xxx.o 202obj-$(CONFIG_SOC_AM43XX) += $(clock-common) dpll3xxx.o
203 203
204# OMAP2 clock rate set data (old "OPP" data) 204# OMAP2 clock rate set data (old "OPP" data)
diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h
index ac21856d245d..d7ed2446057c 100644
--- a/arch/arm/mach-omap2/clock.h
+++ b/arch/arm/mach-omap2/clock.h
@@ -183,8 +183,6 @@ struct clksel {
183u32 omap3_dpll_autoidle_read(struct clk_hw_omap *clk); 183u32 omap3_dpll_autoidle_read(struct clk_hw_omap *clk);
184void omap3_dpll_allow_idle(struct clk_hw_omap *clk); 184void omap3_dpll_allow_idle(struct clk_hw_omap *clk);
185void omap3_dpll_deny_idle(struct clk_hw_omap *clk); 185void omap3_dpll_deny_idle(struct clk_hw_omap *clk);
186void omap4_dpllmx_allow_gatectrl(struct clk_hw_omap *clk);
187void omap4_dpllmx_deny_gatectrl(struct clk_hw_omap *clk);
188 186
189void __init omap2_clk_disable_clkdm_control(void); 187void __init omap2_clk_disable_clkdm_control(void);
190 188
@@ -204,8 +202,6 @@ int omap2_clksel_set_parent(struct clk_hw *hw, u8 field_val);
204extern void omap2_clkt_iclk_allow_idle(struct clk_hw_omap *clk); 202extern void omap2_clkt_iclk_allow_idle(struct clk_hw_omap *clk);
205extern void omap2_clkt_iclk_deny_idle(struct clk_hw_omap *clk); 203extern void omap2_clkt_iclk_deny_idle(struct clk_hw_omap *clk);
206 204
207unsigned long omap2_get_dpll_rate(struct clk_hw_omap *clk);
208
209void omap2_clk_dflt_find_companion(struct clk_hw_omap *clk, 205void omap2_clk_dflt_find_companion(struct clk_hw_omap *clk,
210 void __iomem **other_reg, 206 void __iomem **other_reg,
211 u8 *other_bit); 207 u8 *other_bit);
diff --git a/drivers/clk/ti/Makefile b/drivers/clk/ti/Makefile
index 62dae2ad3c69..c3ec3014fb2d 100644
--- a/drivers/clk/ti/Makefile
+++ b/drivers/clk/ti/Makefile
@@ -7,10 +7,10 @@ obj-$(CONFIG_SOC_TI81XX) += $(clk-common) fapll.o clk-816x.o
7obj-$(CONFIG_ARCH_OMAP2) += $(clk-common) interface.o clk-2xxx.o 7obj-$(CONFIG_ARCH_OMAP2) += $(clk-common) interface.o clk-2xxx.o
8obj-$(CONFIG_ARCH_OMAP3) += $(clk-common) interface.o \ 8obj-$(CONFIG_ARCH_OMAP3) += $(clk-common) interface.o \
9 clk-3xxx.o 9 clk-3xxx.o
10obj-$(CONFIG_ARCH_OMAP4) += $(clk-common) clk-44xx.o 10obj-$(CONFIG_ARCH_OMAP4) += $(clk-common) clk-44xx.o dpll44xx.o
11obj-$(CONFIG_SOC_OMAP5) += $(clk-common) clk-54xx.o 11obj-$(CONFIG_SOC_OMAP5) += $(clk-common) clk-54xx.o dpll44xx.o
12obj-$(CONFIG_SOC_DRA7XX) += $(clk-common) clk-7xx.o \ 12obj-$(CONFIG_SOC_DRA7XX) += $(clk-common) clk-7xx.o \
13 clk-dra7-atl.o 13 clk-dra7-atl.o dpll44xx.o
14obj-$(CONFIG_SOC_AM43XX) += $(clk-common) clk-43xx.o 14obj-$(CONFIG_SOC_AM43XX) += $(clk-common) clk-43xx.o
15 15
16ifdef CONFIG_ATAGS 16ifdef CONFIG_ATAGS
diff --git a/drivers/clk/ti/clock.h b/drivers/clk/ti/clock.h
index 05ed10a81ace..c75d4b44cbef 100644
--- a/drivers/clk/ti/clock.h
+++ b/drivers/clk/ti/clock.h
@@ -169,6 +169,20 @@ void ti_clk_patch_legacy_clks(struct ti_clk **patch);
169struct clk *ti_clk_register_clk(struct ti_clk *setup); 169struct clk *ti_clk_register_clk(struct ti_clk *setup);
170int ti_clk_register_legacy_clks(struct ti_clk_alias *clks); 170int ti_clk_register_legacy_clks(struct ti_clk_alias *clks);
171 171
172extern const struct clk_hw_omap_ops clkhwops_omap4_dpllmx;
173
172u8 omap2_init_dpll_parent(struct clk_hw *hw); 174u8 omap2_init_dpll_parent(struct clk_hw *hw);
173 175
176unsigned long omap4_dpll_regm4xen_recalc(struct clk_hw *hw,
177 unsigned long parent_rate);
178long omap4_dpll_regm4xen_round_rate(struct clk_hw *hw,
179 unsigned long target_rate,
180 unsigned long *parent_rate);
181long omap4_dpll_regm4xen_determine_rate(struct clk_hw *hw,
182 unsigned long rate,
183 unsigned long min_rate,
184 unsigned long max_rate,
185 unsigned long *best_parent_rate,
186 struct clk_hw **best_parent_clk);
187
174#endif 188#endif
diff --git a/arch/arm/mach-omap2/dpll44xx.c b/drivers/clk/ti/dpll44xx.c
index f231be05b9a6..ef1a5b43d01f 100644
--- a/arch/arm/mach-omap2/dpll44xx.c
+++ b/drivers/clk/ti/dpll44xx.c
@@ -14,6 +14,7 @@
14#include <linux/clk.h> 14#include <linux/clk.h>
15#include <linux/io.h> 15#include <linux/io.h>
16#include <linux/bitops.h> 16#include <linux/bitops.h>
17#include <linux/clk/ti.h>
17 18
18#include "clock.h" 19#include "clock.h"
19 20
@@ -29,14 +30,14 @@
29/* 30/*
30 * Bitfield declarations 31 * Bitfield declarations
31 */ 32 */
32#define OMAP4430_DPLL_CLKOUT_GATE_CTRL_MASK (1 << 8) 33#define OMAP4430_DPLL_CLKOUT_GATE_CTRL_MASK BIT(8)
33#define OMAP4430_DPLL_CLKOUTX2_GATE_CTRL_MASK (1 << 10) 34#define OMAP4430_DPLL_CLKOUTX2_GATE_CTRL_MASK BIT(10)
34#define OMAP4430_DPLL_REGM4XEN_MASK (1 << 11) 35#define OMAP4430_DPLL_REGM4XEN_MASK BIT(11)
35 36
36/* Static rate multiplier for OMAP4 REGM4XEN clocks */ 37/* Static rate multiplier for OMAP4 REGM4XEN clocks */
37#define OMAP4430_REGM4XEN_MULT 4 38#define OMAP4430_REGM4XEN_MULT 4
38 39
39void omap4_dpllmx_allow_gatectrl(struct clk_hw_omap *clk) 40static void omap4_dpllmx_allow_gatectrl(struct clk_hw_omap *clk)
40{ 41{
41 u32 v; 42 u32 v;
42 u32 mask; 43 u32 mask;
@@ -48,13 +49,13 @@ void omap4_dpllmx_allow_gatectrl(struct clk_hw_omap *clk)
48 OMAP4430_DPLL_CLKOUTX2_GATE_CTRL_MASK : 49 OMAP4430_DPLL_CLKOUTX2_GATE_CTRL_MASK :
49 OMAP4430_DPLL_CLKOUT_GATE_CTRL_MASK; 50 OMAP4430_DPLL_CLKOUT_GATE_CTRL_MASK;
50 51
51 v = omap2_clk_readl(clk, clk->clksel_reg); 52 v = ti_clk_ll_ops->clk_readl(clk->clksel_reg);
52 /* Clear the bit to allow gatectrl */ 53 /* Clear the bit to allow gatectrl */
53 v &= ~mask; 54 v &= ~mask;
54 omap2_clk_writel(v, clk, clk->clksel_reg); 55 ti_clk_ll_ops->clk_writel(v, clk->clksel_reg);
55} 56}
56 57
57void omap4_dpllmx_deny_gatectrl(struct clk_hw_omap *clk) 58static void omap4_dpllmx_deny_gatectrl(struct clk_hw_omap *clk)
58{ 59{
59 u32 v; 60 u32 v;
60 u32 mask; 61 u32 mask;
@@ -66,10 +67,10 @@ void omap4_dpllmx_deny_gatectrl(struct clk_hw_omap *clk)
66 OMAP4430_DPLL_CLKOUTX2_GATE_CTRL_MASK : 67 OMAP4430_DPLL_CLKOUTX2_GATE_CTRL_MASK :
67 OMAP4430_DPLL_CLKOUT_GATE_CTRL_MASK; 68 OMAP4430_DPLL_CLKOUT_GATE_CTRL_MASK;
68 69
69 v = omap2_clk_readl(clk, clk->clksel_reg); 70 v = ti_clk_ll_ops->clk_readl(clk->clksel_reg);
70 /* Set the bit to deny gatectrl */ 71 /* Set the bit to deny gatectrl */
71 v |= mask; 72 v |= mask;
72 omap2_clk_writel(v, clk, clk->clksel_reg); 73 ti_clk_ll_ops->clk_writel(v, clk->clksel_reg);
73} 74}
74 75
75const struct clk_hw_omap_ops clkhwops_omap4_dpllmx = { 76const struct clk_hw_omap_ops clkhwops_omap4_dpllmx = {
@@ -112,7 +113,7 @@ static void omap4_dpll_lpmode_recalc(struct dpll_data *dd)
112 * upon success, or 0 upon error. 113 * upon success, or 0 upon error.
113 */ 114 */
114unsigned long omap4_dpll_regm4xen_recalc(struct clk_hw *hw, 115unsigned long omap4_dpll_regm4xen_recalc(struct clk_hw *hw,
115 unsigned long parent_rate) 116 unsigned long parent_rate)
116{ 117{
117 struct clk_hw_omap *clk = to_clk_hw_omap(hw); 118 struct clk_hw_omap *clk = to_clk_hw_omap(hw);
118 u32 v; 119 u32 v;
@@ -127,7 +128,7 @@ unsigned long omap4_dpll_regm4xen_recalc(struct clk_hw *hw,
127 rate = omap2_get_dpll_rate(clk); 128 rate = omap2_get_dpll_rate(clk);
128 129
129 /* regm4xen adds a multiplier of 4 to DPLL calculations */ 130 /* regm4xen adds a multiplier of 4 to DPLL calculations */
130 v = omap2_clk_readl(clk, dd->control_reg); 131 v = ti_clk_ll_ops->clk_readl(dd->control_reg);
131 if (v & OMAP4430_DPLL_REGM4XEN_MASK) 132 if (v & OMAP4430_DPLL_REGM4XEN_MASK)
132 rate *= OMAP4430_REGM4XEN_MULT; 133 rate *= OMAP4430_REGM4XEN_MULT;
133 134
diff --git a/include/linux/clk/ti.h b/include/linux/clk/ti.h
index 886b2e9d2204..ee59e076340f 100644
--- a/include/linux/clk/ti.h
+++ b/include/linux/clk/ti.h
@@ -275,17 +275,6 @@ long omap3_noncore_dpll_determine_rate(struct clk_hw *hw,
275 unsigned long max_rate, 275 unsigned long max_rate,
276 unsigned long *best_parent_rate, 276 unsigned long *best_parent_rate,
277 struct clk_hw **best_parent_clk); 277 struct clk_hw **best_parent_clk);
278unsigned long omap4_dpll_regm4xen_recalc(struct clk_hw *hw,
279 unsigned long parent_rate);
280long omap4_dpll_regm4xen_round_rate(struct clk_hw *hw,
281 unsigned long target_rate,
282 unsigned long *parent_rate);
283long omap4_dpll_regm4xen_determine_rate(struct clk_hw *hw,
284 unsigned long rate,
285 unsigned long min_rate,
286 unsigned long max_rate,
287 unsigned long *best_parent_rate,
288 struct clk_hw **best_parent_clk);
289unsigned long omap3_dpll_recalc(struct clk_hw *hw, unsigned long parent_rate); 278unsigned long omap3_dpll_recalc(struct clk_hw *hw, unsigned long parent_rate);
290long omap2_dpll_round_rate(struct clk_hw *hw, unsigned long target_rate, 279long omap2_dpll_round_rate(struct clk_hw *hw, unsigned long target_rate,
291 unsigned long *parent_rate); 280 unsigned long *parent_rate);
@@ -314,6 +303,7 @@ int omap2_reprogram_dpllcore(struct clk_hw *clk, unsigned long rate,
314 unsigned long parent_rate); 303 unsigned long parent_rate);
315void omap2xxx_clkt_dpllcore_init(struct clk_hw *hw); 304void omap2xxx_clkt_dpllcore_init(struct clk_hw *hw);
316void omap2xxx_clkt_vps_init(void); 305void omap2xxx_clkt_vps_init(void);
306unsigned long omap2_get_dpll_rate(struct clk_hw_omap *clk);
317 307
318void __iomem *ti_clk_get_reg_addr(struct device_node *node, int index); 308void __iomem *ti_clk_get_reg_addr(struct device_node *node, int index);
319void ti_dt_clocks_register(struct ti_dt_clk *oclks); 309void ti_dt_clocks_register(struct ti_dt_clk *oclks);
@@ -364,7 +354,6 @@ static inline void of_ti_clk_deny_autoidle_all(void) { }
364extern const struct clk_hw_omap_ops clkhwops_omap2xxx_dpll; 354extern const struct clk_hw_omap_ops clkhwops_omap2xxx_dpll;
365extern const struct clk_hw_omap_ops clkhwops_omap2430_i2chs_wait; 355extern const struct clk_hw_omap_ops clkhwops_omap2430_i2chs_wait;
366extern const struct clk_hw_omap_ops clkhwops_omap3_dpll; 356extern const struct clk_hw_omap_ops clkhwops_omap3_dpll;
367extern const struct clk_hw_omap_ops clkhwops_omap4_dpllmx;
368extern const struct clk_hw_omap_ops clkhwops_wait; 357extern const struct clk_hw_omap_ops clkhwops_wait;
369extern const struct clk_hw_omap_ops clkhwops_omap3430es2_dss_usbhost_wait; 358extern const struct clk_hw_omap_ops clkhwops_omap3430es2_dss_usbhost_wait;
370extern const struct clk_hw_omap_ops clkhwops_am35xx_ipss_module_wait; 359extern const struct clk_hw_omap_ops clkhwops_am35xx_ipss_module_wait;