aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTero Kristo <t-kristo@ti.com>2015-03-04 14:02:05 -0500
committerTero Kristo <t-kristo@ti.com>2015-06-02 05:31:45 -0400
commita3314e9cf69c1d4052017e559ea69a042ccd83e2 (patch)
treeac59f0bda8126dbc79b5ec0fb8edc9dca8c66fda
parentc9a58b0a848e4b88d2dd4690ef19bae8696649eb (diff)
clk: ti: move some public definitions to private header
Several exported TI clock driver features are no longer needed outside the clock driver itself, thus move all of these to the driver private header file. Also, update some of the driver files to actually include this header. Signed-off-by: Tero Kristo <t-kristo@ti.com>
-rw-r--r--drivers/clk/ti/apll.c2
-rw-r--r--drivers/clk/ti/autoidle.c2
-rw-r--r--drivers/clk/ti/clk-43xx.c2
-rw-r--r--drivers/clk/ti/clk-44xx.c2
-rw-r--r--drivers/clk/ti/clk-54xx.c2
-rw-r--r--drivers/clk/ti/clk-7xx.c3
-rw-r--r--drivers/clk/ti/clock.h47
-rw-r--r--include/linux/clk/ti.h45
8 files changed, 59 insertions, 46 deletions
diff --git a/drivers/clk/ti/apll.c b/drivers/clk/ti/apll.c
index 49baf3831546..594b759f02ee 100644
--- a/drivers/clk/ti/apll.c
+++ b/drivers/clk/ti/apll.c
@@ -27,6 +27,8 @@
27#include <linux/clk/ti.h> 27#include <linux/clk/ti.h>
28#include <linux/delay.h> 28#include <linux/delay.h>
29 29
30#include "clock.h"
31
30#define APLL_FORCE_LOCK 0x1 32#define APLL_FORCE_LOCK 0x1
31#define APLL_AUTO_IDLE 0x2 33#define APLL_AUTO_IDLE 0x2
32#define MAX_APLL_WAIT_TRIES 1000000 34#define MAX_APLL_WAIT_TRIES 1000000
diff --git a/drivers/clk/ti/autoidle.c b/drivers/clk/ti/autoidle.c
index 3dbcc3681058..94f0dcd94181 100644
--- a/drivers/clk/ti/autoidle.c
+++ b/drivers/clk/ti/autoidle.c
@@ -22,6 +22,8 @@
22#include <linux/of_address.h> 22#include <linux/of_address.h>
23#include <linux/clk/ti.h> 23#include <linux/clk/ti.h>
24 24
25#include "clock.h"
26
25struct clk_ti_autoidle { 27struct clk_ti_autoidle {
26 void __iomem *reg; 28 void __iomem *reg;
27 u8 shift; 29 u8 shift;
diff --git a/drivers/clk/ti/clk-43xx.c b/drivers/clk/ti/clk-43xx.c
index 3795fce8a830..894316738459 100644
--- a/drivers/clk/ti/clk-43xx.c
+++ b/drivers/clk/ti/clk-43xx.c
@@ -19,6 +19,8 @@
19#include <linux/clk-provider.h> 19#include <linux/clk-provider.h>
20#include <linux/clk/ti.h> 20#include <linux/clk/ti.h>
21 21
22#include "clock.h"
23
22static struct ti_dt_clk am43xx_clks[] = { 24static struct ti_dt_clk am43xx_clks[] = {
23 DT_CLK(NULL, "clk_32768_ck", "clk_32768_ck"), 25 DT_CLK(NULL, "clk_32768_ck", "clk_32768_ck"),
24 DT_CLK(NULL, "clk_rc32k_ck", "clk_rc32k_ck"), 26 DT_CLK(NULL, "clk_rc32k_ck", "clk_rc32k_ck"),
diff --git a/drivers/clk/ti/clk-44xx.c b/drivers/clk/ti/clk-44xx.c
index 581db7711f51..7a8b51b35f9f 100644
--- a/drivers/clk/ti/clk-44xx.c
+++ b/drivers/clk/ti/clk-44xx.c
@@ -16,6 +16,8 @@
16#include <linux/clkdev.h> 16#include <linux/clkdev.h>
17#include <linux/clk/ti.h> 17#include <linux/clk/ti.h>
18 18
19#include "clock.h"
20
19/* 21/*
20 * OMAP4 ABE DPLL default frequency. In OMAP4460 TRM version V, section 22 * OMAP4 ABE DPLL default frequency. In OMAP4460 TRM version V, section
21 * "3.6.3.2.3 CM1_ABE Clock Generator" states that the "DPLL_ABE_X2_CLK 23 * "3.6.3.2.3 CM1_ABE Clock Generator" states that the "DPLL_ABE_X2_CLK
diff --git a/drivers/clk/ti/clk-54xx.c b/drivers/clk/ti/clk-54xx.c
index 96c69a335975..59ce2fa2c104 100644
--- a/drivers/clk/ti/clk-54xx.c
+++ b/drivers/clk/ti/clk-54xx.c
@@ -17,6 +17,8 @@
17#include <linux/io.h> 17#include <linux/io.h>
18#include <linux/clk/ti.h> 18#include <linux/clk/ti.h>
19 19
20#include "clock.h"
21
20#define OMAP5_DPLL_ABE_DEFFREQ 98304000 22#define OMAP5_DPLL_ABE_DEFFREQ 98304000
21 23
22/* 24/*
diff --git a/drivers/clk/ti/clk-7xx.c b/drivers/clk/ti/clk-7xx.c
index 5d2217ae4478..8b827219d454 100644
--- a/drivers/clk/ti/clk-7xx.c
+++ b/drivers/clk/ti/clk-7xx.c
@@ -16,11 +16,12 @@
16#include <linux/clkdev.h> 16#include <linux/clkdev.h>
17#include <linux/clk/ti.h> 17#include <linux/clk/ti.h>
18 18
19#include "clock.h"
20
19#define DRA7_DPLL_ABE_DEFFREQ 180633600 21#define DRA7_DPLL_ABE_DEFFREQ 180633600
20#define DRA7_DPLL_GMAC_DEFFREQ 1000000000 22#define DRA7_DPLL_GMAC_DEFFREQ 1000000000
21#define DRA7_DPLL_USB_DEFFREQ 960000000 23#define DRA7_DPLL_USB_DEFFREQ 960000000
22 24
23
24static struct ti_dt_clk dra7xx_clks[] = { 25static struct ti_dt_clk dra7xx_clks[] = {
25 DT_CLK(NULL, "atl_clkin0_ck", "atl_clkin0_ck"), 26 DT_CLK(NULL, "atl_clkin0_ck", "atl_clkin0_ck"),
26 DT_CLK(NULL, "atl_clkin1_ck", "atl_clkin1_ck"), 27 DT_CLK(NULL, "atl_clkin1_ck", "atl_clkin1_ck"),
diff --git a/drivers/clk/ti/clock.h b/drivers/clk/ti/clock.h
index 0ca5a36da999..3c43125b9cc9 100644
--- a/drivers/clk/ti/clock.h
+++ b/drivers/clk/ti/clock.h
@@ -154,6 +154,35 @@ struct ti_clk_dpll {
154 u8 recal_st_bit; 154 u8 recal_st_bit;
155}; 155};
156 156
157/* Composite clock component types */
158enum {
159 CLK_COMPONENT_TYPE_GATE = 0,
160 CLK_COMPONENT_TYPE_DIVIDER,
161 CLK_COMPONENT_TYPE_MUX,
162 CLK_COMPONENT_TYPE_MAX,
163};
164
165/**
166 * struct ti_dt_clk - OMAP DT clock alias declarations
167 * @lk: clock lookup definition
168 * @node_name: clock DT node to map to
169 */
170struct ti_dt_clk {
171 struct clk_lookup lk;
172 char *node_name;
173};
174
175#define DT_CLK(dev, con, name) \
176 { \
177 .lk = { \
178 .dev_id = dev, \
179 .con_id = con, \
180 }, \
181 .node_name = name, \
182 }
183
184typedef void (*ti_of_clk_init_cb_t)(struct clk_hw *, struct device_node *);
185
157struct clk *ti_clk_register_gate(struct ti_clk *setup); 186struct clk *ti_clk_register_gate(struct ti_clk *setup);
158struct clk *ti_clk_register_interface(struct ti_clk *setup); 187struct clk *ti_clk_register_interface(struct ti_clk *setup);
159struct clk *ti_clk_register_mux(struct ti_clk *setup); 188struct clk *ti_clk_register_mux(struct ti_clk *setup);
@@ -169,6 +198,12 @@ void ti_clk_patch_legacy_clks(struct ti_clk **patch);
169struct clk *ti_clk_register_clk(struct ti_clk *setup); 198struct clk *ti_clk_register_clk(struct ti_clk *setup);
170int ti_clk_register_legacy_clks(struct ti_clk_alias *clks); 199int ti_clk_register_legacy_clks(struct ti_clk_alias *clks);
171 200
201void __iomem *ti_clk_get_reg_addr(struct device_node *node, int index);
202void ti_dt_clocks_register(struct ti_dt_clk *oclks);
203int ti_clk_retry_init(struct device_node *node, struct clk_hw *hw,
204 ti_of_clk_init_cb_t func);
205int ti_clk_add_component(struct device_node *node, struct clk_hw *hw, int type);
206
172void omap2_init_clk_hw_omap_clocks(struct clk *clk); 207void omap2_init_clk_hw_omap_clocks(struct clk *clk);
173int of_ti_clk_autoidle_setup(struct device_node *node); 208int of_ti_clk_autoidle_setup(struct device_node *node);
174void omap2_clk_enable_init_clocks(const char **clk_names, u8 num_clocks); 209void omap2_clk_enable_init_clocks(const char **clk_names, u8 num_clocks);
@@ -186,12 +221,24 @@ extern const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_ssi_wait;
186extern const struct clk_hw_omap_ops clkhwops_am35xx_ipss_module_wait; 221extern const struct clk_hw_omap_ops clkhwops_am35xx_ipss_module_wait;
187extern const struct clk_hw_omap_ops clkhwops_am35xx_ipss_wait; 222extern const struct clk_hw_omap_ops clkhwops_am35xx_ipss_wait;
188 223
224extern const struct clk_ops ti_clk_divider_ops;
225extern const struct clk_ops ti_clk_mux_ops;
226
189int omap2_clkops_enable_clkdm(struct clk_hw *hw); 227int omap2_clkops_enable_clkdm(struct clk_hw *hw);
190void omap2_clkops_disable_clkdm(struct clk_hw *hw); 228void omap2_clkops_disable_clkdm(struct clk_hw *hw);
191 229
192int omap2_dflt_clk_enable(struct clk_hw *hw); 230int omap2_dflt_clk_enable(struct clk_hw *hw);
193void omap2_dflt_clk_disable(struct clk_hw *hw); 231void omap2_dflt_clk_disable(struct clk_hw *hw);
194int omap2_dflt_clk_is_enabled(struct clk_hw *hw); 232int omap2_dflt_clk_is_enabled(struct clk_hw *hw);
233void omap2_clk_dflt_find_companion(struct clk_hw_omap *clk,
234 void __iomem **other_reg,
235 u8 *other_bit);
236void omap2_clk_dflt_find_idlest(struct clk_hw_omap *clk,
237 void __iomem **idlest_reg,
238 u8 *idlest_bit, u8 *idlest_val);
239
240void omap2_clkt_iclk_allow_idle(struct clk_hw_omap *clk);
241void omap2_clkt_iclk_deny_idle(struct clk_hw_omap *clk);
195 242
196u8 omap2_init_dpll_parent(struct clk_hw *hw); 243u8 omap2_init_dpll_parent(struct clk_hw *hw);
197int omap3_noncore_dpll_enable(struct clk_hw *hw); 244int omap3_noncore_dpll_enable(struct clk_hw *hw);
diff --git a/include/linux/clk/ti.h b/include/linux/clk/ti.h
index 15f3c971ccab..5eccdf5c0e84 100644
--- a/include/linux/clk/ti.h
+++ b/include/linux/clk/ti.h
@@ -188,33 +188,6 @@ struct clk_hw_omap {
188/* DPLL Type and DCO Selection Flags */ 188/* DPLL Type and DCO Selection Flags */
189#define DPLL_J_TYPE 0x1 189#define DPLL_J_TYPE 0x1
190 190
191/* Composite clock component types */
192enum {
193 CLK_COMPONENT_TYPE_GATE = 0,
194 CLK_COMPONENT_TYPE_DIVIDER,
195 CLK_COMPONENT_TYPE_MUX,
196 CLK_COMPONENT_TYPE_MAX,
197};
198
199/**
200 * struct ti_dt_clk - OMAP DT clock alias declarations
201 * @lk: clock lookup definition
202 * @node_name: clock DT node to map to
203 */
204struct ti_dt_clk {
205 struct clk_lookup lk;
206 char *node_name;
207};
208
209#define DT_CLK(dev, con, name) \
210 { \
211 .lk = { \
212 .dev_id = dev, \
213 .con_id = con, \
214 }, \
215 .node_name = name, \
216 }
217
218/* Static memmap indices */ 191/* Static memmap indices */
219enum { 192enum {
220 TI_CLKM_CM = 0, 193 TI_CLKM_CM = 0,
@@ -225,8 +198,6 @@ enum {
225 CLK_MAX_MEMMAPS 198 CLK_MAX_MEMMAPS
226}; 199};
227 200
228typedef void (*ti_of_clk_init_cb_t)(struct clk_hw *, struct device_node *);
229
230/** 201/**
231 * struct clk_omap_reg - OMAP register declaration 202 * struct clk_omap_reg - OMAP register declaration
232 * @offset: offset from the master IP module base address 203 * @offset: offset from the master IP module base address
@@ -266,9 +237,6 @@ struct ti_clk_ll_ops {
266 237
267extern struct ti_clk_ll_ops *ti_clk_ll_ops; 238extern struct ti_clk_ll_ops *ti_clk_ll_ops;
268 239
269extern const struct clk_ops ti_clk_divider_ops;
270extern const struct clk_ops ti_clk_mux_ops;
271
272#define to_clk_hw_omap(_hw) container_of(_hw, struct clk_hw_omap, hw) 240#define to_clk_hw_omap(_hw) container_of(_hw, struct clk_hw_omap, hw)
273 241
274void omap2_init_clk_clkdm(struct clk_hw *clk); 242void omap2_init_clk_clkdm(struct clk_hw *clk);
@@ -276,14 +244,6 @@ int omap2_clk_disable_autoidle_all(void);
276int omap2_clk_enable_autoidle_all(void); 244int omap2_clk_enable_autoidle_all(void);
277int omap2_clk_allow_idle(struct clk *clk); 245int omap2_clk_allow_idle(struct clk *clk);
278int omap2_clk_deny_idle(struct clk *clk); 246int omap2_clk_deny_idle(struct clk *clk);
279void omap2_clkt_iclk_allow_idle(struct clk_hw_omap *clk);
280void omap2_clkt_iclk_deny_idle(struct clk_hw_omap *clk);
281void omap2_clk_dflt_find_companion(struct clk_hw_omap *clk,
282 void __iomem **other_reg,
283 u8 *other_bit);
284void omap2_clk_dflt_find_idlest(struct clk_hw_omap *clk,
285 void __iomem **idlest_reg,
286 u8 *idlest_bit, u8 *idlest_val);
287unsigned long omap2_dpllcore_recalc(struct clk_hw *hw, 247unsigned long omap2_dpllcore_recalc(struct clk_hw *hw,
288 unsigned long parent_rate); 248 unsigned long parent_rate);
289int omap2_reprogram_dpllcore(struct clk_hw *clk, unsigned long rate, 249int omap2_reprogram_dpllcore(struct clk_hw *clk, unsigned long rate,
@@ -292,14 +252,9 @@ void omap2xxx_clkt_dpllcore_init(struct clk_hw *hw);
292void omap2xxx_clkt_vps_init(void); 252void omap2xxx_clkt_vps_init(void);
293unsigned long omap2_get_dpll_rate(struct clk_hw_omap *clk); 253unsigned long omap2_get_dpll_rate(struct clk_hw_omap *clk);
294 254
295void __iomem *ti_clk_get_reg_addr(struct device_node *node, int index);
296void ti_dt_clocks_register(struct ti_dt_clk *oclks);
297void ti_dt_clk_init_provider(struct device_node *np, int index); 255void ti_dt_clk_init_provider(struct device_node *np, int index);
298void ti_dt_clk_init_retry_clks(void); 256void ti_dt_clk_init_retry_clks(void);
299void ti_dt_clockdomains_setup(void); 257void ti_dt_clockdomains_setup(void);
300int ti_clk_retry_init(struct device_node *node, struct clk_hw *hw,
301 ti_of_clk_init_cb_t func);
302int ti_clk_add_component(struct device_node *node, struct clk_hw *hw, int type);
303 258
304int omap3430_dt_clk_init(void); 259int omap3430_dt_clk_init(void);
305int omap3630_dt_clk_init(void); 260int omap3630_dt_clk_init(void);