diff options
author | Paul Mundt <lethal@linux-sh.org> | 2009-05-26 10:50:40 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-05-26 10:50:40 -0400 |
commit | 464c9e10376b24f04402fa8ef72b66257561bffa (patch) | |
tree | ac95ad416a2d3f3afcc92ca1790267a03b2be10d /arch/sh/include | |
parent | b7e2ac619465f1774b827d9997109ceef4a61851 (diff) | |
parent | 61ce5393e4c8914c46ec99cbda76823515109709 (diff) |
Merge branch 'sh/clkfwk'
Diffstat (limited to 'arch/sh/include')
-rw-r--r-- | arch/sh/include/asm/clock.h | 69 | ||||
-rw-r--r-- | arch/sh/include/asm/machvec.h | 2 |
2 files changed, 47 insertions, 24 deletions
diff --git a/arch/sh/include/asm/clock.h b/arch/sh/include/asm/clock.h index b1f29199e4bd..aa9480d4aa05 100644 --- a/arch/sh/include/asm/clock.h +++ b/arch/sh/include/asm/clock.h | |||
@@ -10,9 +10,9 @@ struct clk; | |||
10 | 10 | ||
11 | struct clk_ops { | 11 | struct clk_ops { |
12 | void (*init)(struct clk *clk); | 12 | void (*init)(struct clk *clk); |
13 | void (*enable)(struct clk *clk); | 13 | int (*enable)(struct clk *clk); |
14 | void (*disable)(struct clk *clk); | 14 | void (*disable)(struct clk *clk); |
15 | void (*recalc)(struct clk *clk); | 15 | unsigned long (*recalc)(struct clk *clk); |
16 | int (*set_rate)(struct clk *clk, unsigned long rate, int algo_id); | 16 | int (*set_rate)(struct clk *clk, unsigned long rate, int algo_id); |
17 | int (*set_parent)(struct clk *clk, struct clk *parent); | 17 | int (*set_parent)(struct clk *clk, struct clk *parent); |
18 | long (*round_rate)(struct clk *clk, unsigned long rate); | 18 | long (*round_rate)(struct clk *clk, unsigned long rate); |
@@ -27,44 +27,46 @@ struct clk { | |||
27 | struct clk *parent; | 27 | struct clk *parent; |
28 | struct clk_ops *ops; | 28 | struct clk_ops *ops; |
29 | 29 | ||
30 | struct list_head children; | ||
31 | struct list_head sibling; /* node for children */ | ||
32 | |||
30 | int usecount; | 33 | int usecount; |
31 | 34 | ||
32 | unsigned long rate; | 35 | unsigned long rate; |
33 | unsigned long flags; | 36 | unsigned long flags; |
37 | |||
38 | void __iomem *enable_reg; | ||
39 | unsigned int enable_bit; | ||
40 | |||
34 | unsigned long arch_flags; | 41 | unsigned long arch_flags; |
42 | void *priv; | ||
43 | struct dentry *dentry; | ||
44 | }; | ||
45 | |||
46 | struct clk_lookup { | ||
47 | struct list_head node; | ||
48 | const char *dev_id; | ||
49 | const char *con_id; | ||
50 | struct clk *clk; | ||
35 | }; | 51 | }; |
36 | 52 | ||
37 | #define CLK_ALWAYS_ENABLED (1 << 0) | 53 | #define CLK_ENABLE_ON_INIT (1 << 0) |
38 | #define CLK_RATE_PROPAGATES (1 << 1) | ||
39 | #define CLK_NEEDS_INIT (1 << 2) | ||
40 | 54 | ||
41 | /* Should be defined by processor-specific code */ | 55 | /* Should be defined by processor-specific code */ |
42 | void arch_init_clk_ops(struct clk_ops **, int type); | 56 | void __deprecated arch_init_clk_ops(struct clk_ops **, int type); |
43 | int __init arch_clk_init(void); | 57 | int __init arch_clk_init(void); |
44 | 58 | ||
45 | /* arch/sh/kernel/cpu/clock.c */ | 59 | /* arch/sh/kernel/cpu/clock.c */ |
46 | int clk_init(void); | 60 | int clk_init(void); |
47 | 61 | unsigned long followparent_recalc(struct clk *); | |
48 | void clk_recalc_rate(struct clk *); | 62 | void recalculate_root_clocks(void); |
49 | 63 | void propagate_rate(struct clk *); | |
64 | int clk_reparent(struct clk *child, struct clk *parent); | ||
50 | int clk_register(struct clk *); | 65 | int clk_register(struct clk *); |
51 | void clk_unregister(struct clk *); | 66 | void clk_unregister(struct clk *); |
52 | 67 | ||
53 | static inline int clk_always_enable(const char *id) | 68 | /* arch/sh/kernel/cpu/clock-cpg.c */ |
54 | { | 69 | int __init __deprecated cpg_clk_init(void); |
55 | struct clk *clk; | ||
56 | int ret; | ||
57 | |||
58 | clk = clk_get(NULL, id); | ||
59 | if (IS_ERR(clk)) | ||
60 | return PTR_ERR(clk); | ||
61 | |||
62 | ret = clk_enable(clk); | ||
63 | if (ret) | ||
64 | clk_put(clk); | ||
65 | |||
66 | return ret; | ||
67 | } | ||
68 | 70 | ||
69 | /* the exported API, in addition to clk_set_rate */ | 71 | /* the exported API, in addition to clk_set_rate */ |
70 | /** | 72 | /** |
@@ -96,4 +98,23 @@ enum clk_sh_algo_id { | |||
96 | 98 | ||
97 | IP_N1, | 99 | IP_N1, |
98 | }; | 100 | }; |
101 | |||
102 | struct clk_div_mult_table { | ||
103 | unsigned int *divisors; | ||
104 | unsigned int nr_divisors; | ||
105 | unsigned int *multipliers; | ||
106 | unsigned int nr_multipliers; | ||
107 | }; | ||
108 | |||
109 | struct cpufreq_frequency_table; | ||
110 | void clk_rate_table_build(struct clk *clk, | ||
111 | struct cpufreq_frequency_table *freq_table, | ||
112 | int nr_freqs, | ||
113 | struct clk_div_mult_table *src_table, | ||
114 | unsigned long *bitmap); | ||
115 | |||
116 | long clk_rate_table_round(struct clk *clk, | ||
117 | struct cpufreq_frequency_table *freq_table, | ||
118 | unsigned long rate); | ||
119 | |||
99 | #endif /* __ASM_SH_CLOCK_H */ | 120 | #endif /* __ASM_SH_CLOCK_H */ |
diff --git a/arch/sh/include/asm/machvec.h b/arch/sh/include/asm/machvec.h index 64b1c16a0f03..73d6d16fa06b 100644 --- a/arch/sh/include/asm/machvec.h +++ b/arch/sh/include/asm/machvec.h | |||
@@ -46,6 +46,8 @@ struct sh_machine_vector { | |||
46 | 46 | ||
47 | void __iomem *(*mv_ioport_map)(unsigned long port, unsigned int size); | 47 | void __iomem *(*mv_ioport_map)(unsigned long port, unsigned int size); |
48 | void (*mv_ioport_unmap)(void __iomem *); | 48 | void (*mv_ioport_unmap)(void __iomem *); |
49 | |||
50 | int (*mv_clk_init)(void); | ||
49 | }; | 51 | }; |
50 | 52 | ||
51 | extern struct sh_machine_vector sh_mv; | 53 | extern struct sh_machine_vector sh_mv; |