aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTero Kristo <t-kristo@ti.com>2015-03-02 07:33:54 -0500
committerTero Kristo <t-kristo@ti.com>2015-06-02 05:30:59 -0400
commitef14db0977547b1982d4f6eaa305e1a22eb95778 (patch)
treeb5c82c7d4f0aaf659b0c07d34a469b869f9e2341
parent59245ce01a2e3ded836172266e3ac2e576a03333 (diff)
clk: ti: move interface clock implementation under drivers/clk
With the legacy clock support gone, the OMAP interface clock implementation can be moved under the clock driver. Some temporary header file tweaks are also needed to make this change work properly. Signed-off-by: Tero Kristo <t-kristo@ti.com>
-rw-r--r--arch/arm/mach-omap2/Makefile3
-rw-r--r--arch/arm/mach-omap2/clock.h11
-rw-r--r--drivers/clk/ti/Makefile2
-rw-r--r--drivers/clk/ti/clkt_iclk.c (renamed from arch/arm/mach-omap2/clkt_iclk.c)12
-rw-r--r--drivers/clk/ti/clock.h2
-rw-r--r--include/linux/clk/ti.h10
6 files changed, 17 insertions, 23 deletions
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 5bcd282f04b3..a2f51564e8d4 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -185,13 +185,12 @@ obj-$(CONFIG_SOC_DRA7XX) += clockdomains7xx_data.o
185obj-$(CONFIG_ARCH_OMAP2) += $(clock-common) clock2xxx.o 185obj-$(CONFIG_ARCH_OMAP2) += $(clock-common) clock2xxx.o
186obj-$(CONFIG_ARCH_OMAP2) += clkt2xxx_dpllcore.o 186obj-$(CONFIG_ARCH_OMAP2) += clkt2xxx_dpllcore.o
187obj-$(CONFIG_ARCH_OMAP2) += clkt2xxx_virt_prcm_set.o 187obj-$(CONFIG_ARCH_OMAP2) += clkt2xxx_virt_prcm_set.o
188obj-$(CONFIG_ARCH_OMAP2) += clkt2xxx_dpll.o clkt_iclk.o 188obj-$(CONFIG_ARCH_OMAP2) += clkt2xxx_dpll.o
189obj-$(CONFIG_SOC_OMAP2430) += clock2430.o 189obj-$(CONFIG_SOC_OMAP2430) += clock2430.o
190obj-$(CONFIG_ARCH_OMAP3) += $(clock-common) clock3xxx.o 190obj-$(CONFIG_ARCH_OMAP3) += $(clock-common) clock3xxx.o
191obj-$(CONFIG_ARCH_OMAP3) += clock34xx.o clkt34xx_dpll3m2.o 191obj-$(CONFIG_ARCH_OMAP3) += clock34xx.o clkt34xx_dpll3m2.o
192obj-$(CONFIG_ARCH_OMAP3) += clock3517.o clock36xx.o 192obj-$(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
195obj-$(CONFIG_ARCH_OMAP4) += $(clock-common) 194obj-$(CONFIG_ARCH_OMAP4) += $(clock-common)
196obj-$(CONFIG_ARCH_OMAP4) += dpll3xxx.o 195obj-$(CONFIG_ARCH_OMAP4) += dpll3xxx.o
197obj-$(CONFIG_SOC_AM33XX) += $(clock-common) dpll3xxx.o 196obj-$(CONFIG_SOC_AM33XX) += $(clock-common) dpll3xxx.o
diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h
index d7ed2446057c..ca8c42c70db5 100644
--- a/arch/arm/mach-omap2/clock.h
+++ b/arch/arm/mach-omap2/clock.h
@@ -198,16 +198,6 @@ int omap2_clksel_set_rate(struct clk_hw *hw, unsigned long rate,
198 unsigned long parent_rate); 198 unsigned long parent_rate);
199int omap2_clksel_set_parent(struct clk_hw *hw, u8 field_val); 199int omap2_clksel_set_parent(struct clk_hw *hw, u8 field_val);
200 200
201/* clkt_iclk.c public functions */
202extern void omap2_clkt_iclk_allow_idle(struct clk_hw_omap *clk);
203extern void omap2_clkt_iclk_deny_idle(struct clk_hw_omap *clk);
204
205void omap2_clk_dflt_find_companion(struct clk_hw_omap *clk,
206 void __iomem **other_reg,
207 u8 *other_bit);
208void omap2_clk_dflt_find_idlest(struct clk_hw_omap *clk,
209 void __iomem **idlest_reg,
210 u8 *idlest_bit, u8 *idlest_val);
211int omap2_clk_enable_autoidle_all(void); 201int omap2_clk_enable_autoidle_all(void);
212int omap2_clk_allow_idle(struct clk *clk); 202int omap2_clk_allow_idle(struct clk *clk);
213int omap2_clk_deny_idle(struct clk *clk); 203int omap2_clk_deny_idle(struct clk *clk);
@@ -231,7 +221,6 @@ extern const struct clksel_rate gpt_sys_rates[];
231extern const struct clksel_rate gfx_l3_rates[]; 221extern const struct clksel_rate gfx_l3_rates[];
232extern const struct clksel_rate dsp_ick_rates[]; 222extern const struct clksel_rate dsp_ick_rates[];
233 223
234extern const struct clk_hw_omap_ops clkhwops_iclk_wait;
235extern const struct clk_hw_omap_ops clkhwops_wait; 224extern const struct clk_hw_omap_ops clkhwops_wait;
236extern const struct clk_hw_omap_ops clkhwops_omap3430es2_ssi_wait; 225extern const struct clk_hw_omap_ops clkhwops_omap3430es2_ssi_wait;
237extern const struct clk_hw_omap_ops clkhwops_omap3430es2_dss_usbhost_wait; 226extern const struct clk_hw_omap_ops clkhwops_omap3430es2_dss_usbhost_wait;
diff --git a/drivers/clk/ti/Makefile b/drivers/clk/ti/Makefile
index c3ec3014fb2d..23cd72638970 100644
--- a/drivers/clk/ti/Makefile
+++ b/drivers/clk/ti/Makefile
@@ -1,7 +1,7 @@
1obj-y += clk.o autoidle.o clockdomain.o 1obj-y += clk.o autoidle.o clockdomain.o
2clk-common = dpll.o composite.o divider.o gate.o \ 2clk-common = dpll.o composite.o divider.o gate.o \
3 fixed-factor.o mux.o apll.o \ 3 fixed-factor.o mux.o apll.o \
4 clkt_dpll.o 4 clkt_dpll.o clkt_iclk.o
5obj-$(CONFIG_SOC_AM33XX) += $(clk-common) clk-33xx.o 5obj-$(CONFIG_SOC_AM33XX) += $(clk-common) clk-33xx.o
6obj-$(CONFIG_SOC_TI81XX) += $(clk-common) fapll.o clk-816x.o 6obj-$(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
diff --git a/arch/arm/mach-omap2/clkt_iclk.c b/drivers/clk/ti/clkt_iclk.c
index 55eb579aeae1..a03919df00ef 100644
--- a/arch/arm/mach-omap2/clkt_iclk.c
+++ b/drivers/clk/ti/clkt_iclk.c
@@ -13,6 +13,7 @@
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/clk-provider.h> 14#include <linux/clk-provider.h>
15#include <linux/io.h> 15#include <linux/io.h>
16#include <linux/clk/ti.h>
16 17
17#include "clock.h" 18#include "clock.h"
18 19
@@ -31,9 +32,9 @@ void omap2_clkt_iclk_allow_idle(struct clk_hw_omap *clk)
31 r = (__force void __iomem *) 32 r = (__force void __iomem *)
32 ((__force u32)clk->enable_reg ^ (CM_AUTOIDLE ^ CM_ICLKEN)); 33 ((__force u32)clk->enable_reg ^ (CM_AUTOIDLE ^ CM_ICLKEN));
33 34
34 v = omap2_clk_readl(clk, r); 35 v = ti_clk_ll_ops->clk_readl(r);
35 v |= (1 << clk->enable_bit); 36 v |= (1 << clk->enable_bit);
36 omap2_clk_writel(v, clk, r); 37 ti_clk_ll_ops->clk_writel(v, r);
37} 38}
38 39
39/* XXX */ 40/* XXX */
@@ -45,9 +46,9 @@ void omap2_clkt_iclk_deny_idle(struct clk_hw_omap *clk)
45 r = (__force void __iomem *) 46 r = (__force void __iomem *)
46 ((__force u32)clk->enable_reg ^ (CM_AUTOIDLE ^ CM_ICLKEN)); 47 ((__force u32)clk->enable_reg ^ (CM_AUTOIDLE ^ CM_ICLKEN));
47 48
48 v = omap2_clk_readl(clk, r); 49 v = ti_clk_ll_ops->clk_readl(r);
49 v &= ~(1 << clk->enable_bit); 50 v &= ~(1 << clk->enable_bit);
50 omap2_clk_writel(v, clk, r); 51 ti_clk_ll_ops->clk_writel(v, r);
51} 52}
52 53
53/* Public data */ 54/* Public data */
@@ -63,6 +64,3 @@ const struct clk_hw_omap_ops clkhwops_iclk_wait = {
63 .find_idlest = omap2_clk_dflt_find_idlest, 64 .find_idlest = omap2_clk_dflt_find_idlest,
64 .find_companion = omap2_clk_dflt_find_companion, 65 .find_companion = omap2_clk_dflt_find_companion,
65}; 66};
66
67
68
diff --git a/drivers/clk/ti/clock.h b/drivers/clk/ti/clock.h
index c75d4b44cbef..a7256a98201d 100644
--- a/drivers/clk/ti/clock.h
+++ b/drivers/clk/ti/clock.h
@@ -170,6 +170,8 @@ struct 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; 172extern const struct clk_hw_omap_ops clkhwops_omap4_dpllmx;
173extern const struct clk_hw_omap_ops clkhwops_iclk;
174extern const struct clk_hw_omap_ops clkhwops_iclk_wait;
173 175
174u8 omap2_init_dpll_parent(struct clk_hw *hw); 176u8 omap2_init_dpll_parent(struct clk_hw *hw);
175 177
diff --git a/include/linux/clk/ti.h b/include/linux/clk/ti.h
index ee59e076340f..79e143dfc793 100644
--- a/include/linux/clk/ti.h
+++ b/include/linux/clk/ti.h
@@ -296,6 +296,14 @@ int omap3_dpll4_set_rate_and_parent(struct clk_hw *hw, unsigned long rate,
296int omap2_dflt_clk_enable(struct clk_hw *hw); 296int omap2_dflt_clk_enable(struct clk_hw *hw);
297void omap2_dflt_clk_disable(struct clk_hw *hw); 297void omap2_dflt_clk_disable(struct clk_hw *hw);
298int omap2_dflt_clk_is_enabled(struct clk_hw *hw); 298int omap2_dflt_clk_is_enabled(struct clk_hw *hw);
299void omap2_clkt_iclk_allow_idle(struct clk_hw_omap *clk);
300void omap2_clkt_iclk_deny_idle(struct clk_hw_omap *clk);
301void omap2_clk_dflt_find_companion(struct clk_hw_omap *clk,
302 void __iomem **other_reg,
303 u8 *other_bit);
304void omap2_clk_dflt_find_idlest(struct clk_hw_omap *clk,
305 void __iomem **idlest_reg,
306 u8 *idlest_bit, u8 *idlest_val);
299void omap3_clk_lock_dpll5(void); 307void omap3_clk_lock_dpll5(void);
300unsigned long omap2_dpllcore_recalc(struct clk_hw *hw, 308unsigned long omap2_dpllcore_recalc(struct clk_hw *hw,
301 unsigned long parent_rate); 309 unsigned long parent_rate);
@@ -358,8 +366,6 @@ extern const struct clk_hw_omap_ops clkhwops_wait;
358extern const struct clk_hw_omap_ops clkhwops_omap3430es2_dss_usbhost_wait; 366extern const struct clk_hw_omap_ops clkhwops_omap3430es2_dss_usbhost_wait;
359extern const struct clk_hw_omap_ops clkhwops_am35xx_ipss_module_wait; 367extern const struct clk_hw_omap_ops clkhwops_am35xx_ipss_module_wait;
360extern const struct clk_hw_omap_ops clkhwops_am35xx_ipss_wait; 368extern const struct clk_hw_omap_ops clkhwops_am35xx_ipss_wait;
361extern const struct clk_hw_omap_ops clkhwops_iclk;
362extern const struct clk_hw_omap_ops clkhwops_iclk_wait;
363extern const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_ssi_wait; 369extern const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_ssi_wait;
364extern const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_dss_usbhost_wait; 370extern const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_dss_usbhost_wait;
365extern const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_hsotgusb_wait; 371extern const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_hsotgusb_wait;