1 #ifndef __ASM_SH_CLOCK_H
2 #define __ASM_SH_CLOCK_H
4 #include <linux/list.h>
5 #include <linux/seq_file.h>
12 void (*init
)(struct clk
*clk
);
13 int (*enable
)(struct clk
*clk
);
14 void (*disable
)(struct clk
*clk
);
15 unsigned long (*recalc
)(struct clk
*clk
);
16 int (*set_rate
)(struct clk
*clk
, unsigned long rate
, int algo_id
);
17 int (*set_parent
)(struct clk
*clk
, struct clk
*parent
);
18 long (*round_rate
)(struct clk
*clk
, unsigned long rate
);
19 void (*build_rate_table
)(struct clk
*clk
);
23 struct list_head node
;
31 struct list_head children
;
32 struct list_head sibling
; /* node for children */
39 void __iomem
*enable_reg
;
40 unsigned int enable_bit
;
42 unsigned long arch_flags
;
44 struct dentry
*dentry
;
48 struct list_head node
;
54 #define CLK_ENABLE_ON_INIT (1 << 0)
56 /* Should be defined by processor-specific code */
57 void __deprecated
arch_init_clk_ops(struct clk_ops
**, int type
);
58 int __init
arch_clk_init(void);
60 /* arch/sh/kernel/cpu/clock.c */
62 unsigned long followparent_recalc(struct clk
*);
63 void recalculate_root_clocks(void);
64 void propagate_rate(struct clk
*);
65 int clk_reparent(struct clk
*child
, struct clk
*parent
);
66 int clk_register(struct clk
*);
67 void clk_unregister(struct clk
*);
69 /* arch/sh/kernel/cpu/clock-cpg.c */
70 int __init __deprecated
cpg_clk_init(void);
72 /* the exported API, in addition to clk_set_rate */
74 * clk_set_rate_ex - set the clock rate for a clock source, with additional parameter
76 * @rate: desired clock rate in Hz
77 * @algo_id: algorithm id to be passed down to ops->set_rate
79 * Returns success (0) or negative errno.
81 int clk_set_rate_ex(struct clk
*clk
, unsigned long rate
, int algo_id
);
103 struct clk_div_mult_table
{
104 unsigned int *divisors
;
105 unsigned int nr_divisors
;
106 unsigned int *multipliers
;
107 unsigned int nr_multipliers
;
110 struct cpufreq_frequency_table
;
111 void clk_rate_table_build(struct clk
*clk
,
112 struct cpufreq_frequency_table
*freq_table
,
114 struct clk_div_mult_table
*src_table
,
115 unsigned long *bitmap
);
117 long clk_rate_table_round(struct clk
*clk
,
118 struct cpufreq_frequency_table
*freq_table
,
121 #endif /* __ASM_SH_CLOCK_H */