diff options
Diffstat (limited to 'arch/arm/plat-samsung/include/plat/clock.h')
-rw-r--r-- | arch/arm/plat-samsung/include/plat/clock.h | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/arch/arm/plat-samsung/include/plat/clock.h b/arch/arm/plat-samsung/include/plat/clock.h index d86af84b5b8c..43324af24c6e 100644 --- a/arch/arm/plat-samsung/include/plat/clock.h +++ b/arch/arm/plat-samsung/include/plat/clock.h | |||
@@ -11,6 +11,30 @@ | |||
11 | 11 | ||
12 | #include <linux/spinlock.h> | 12 | #include <linux/spinlock.h> |
13 | 13 | ||
14 | struct clk; | ||
15 | |||
16 | /** | ||
17 | * struct clk_ops - standard clock operations | ||
18 | * @set_rate: set the clock rate, see clk_set_rate(). | ||
19 | * @get_rate: get the clock rate, see clk_get_rate(). | ||
20 | * @round_rate: round a given clock rate, see clk_round_rate(). | ||
21 | * @set_parent: set the clock's parent, see clk_set_parent(). | ||
22 | * | ||
23 | * Group the common clock implementations together so that we | ||
24 | * don't have to keep setting the same fiels again. We leave | ||
25 | * enable in struct clk. | ||
26 | * | ||
27 | * Adding an extra layer of indirection into the process should | ||
28 | * not be a problem as it is unlikely these operations are going | ||
29 | * to need to be called quickly. | ||
30 | */ | ||
31 | struct clk_ops { | ||
32 | int (*set_rate)(struct clk *c, unsigned long rate); | ||
33 | unsigned long (*get_rate)(struct clk *c); | ||
34 | unsigned long (*round_rate)(struct clk *c, unsigned long rate); | ||
35 | int (*set_parent)(struct clk *c, struct clk *parent); | ||
36 | }; | ||
37 | |||
14 | struct clk { | 38 | struct clk { |
15 | struct list_head list; | 39 | struct list_head list; |
16 | struct module *owner; | 40 | struct module *owner; |
@@ -21,11 +45,8 @@ struct clk { | |||
21 | unsigned long rate; | 45 | unsigned long rate; |
22 | unsigned long ctrlbit; | 46 | unsigned long ctrlbit; |
23 | 47 | ||
48 | struct clk_ops *ops; | ||
24 | int (*enable)(struct clk *, int enable); | 49 | int (*enable)(struct clk *, int enable); |
25 | int (*set_rate)(struct clk *c, unsigned long rate); | ||
26 | unsigned long (*get_rate)(struct clk *c); | ||
27 | unsigned long (*round_rate)(struct clk *c, unsigned long rate); | ||
28 | int (*set_parent)(struct clk *c, struct clk *parent); | ||
29 | }; | 50 | }; |
30 | 51 | ||
31 | /* other clocks which may be registered by board support */ | 52 | /* other clocks which may be registered by board support */ |