diff options
Diffstat (limited to 'arch/arm/mach-tegra/clock.h')
-rw-r--r-- | arch/arm/mach-tegra/clock.h | 40 |
1 files changed, 11 insertions, 29 deletions
diff --git a/arch/arm/mach-tegra/clock.h b/arch/arm/mach-tegra/clock.h index bc300657deba..2aa37f5c44c0 100644 --- a/arch/arm/mach-tegra/clock.h +++ b/arch/arm/mach-tegra/clock.h | |||
@@ -2,6 +2,7 @@ | |||
2 | * arch/arm/mach-tegra/include/mach/clock.h | 2 | * arch/arm/mach-tegra/include/mach/clock.h |
3 | * | 3 | * |
4 | * Copyright (C) 2010 Google, Inc. | 4 | * Copyright (C) 2010 Google, Inc. |
5 | * Copyright (c) 2012 NVIDIA CORPORATION. All rights reserved. | ||
5 | * | 6 | * |
6 | * Author: | 7 | * Author: |
7 | * Colin Cross <ccross@google.com> | 8 | * Colin Cross <ccross@google.com> |
@@ -20,9 +21,9 @@ | |||
20 | #ifndef __MACH_TEGRA_CLOCK_H | 21 | #ifndef __MACH_TEGRA_CLOCK_H |
21 | #define __MACH_TEGRA_CLOCK_H | 22 | #define __MACH_TEGRA_CLOCK_H |
22 | 23 | ||
24 | #include <linux/clk-provider.h> | ||
23 | #include <linux/clkdev.h> | 25 | #include <linux/clkdev.h> |
24 | #include <linux/list.h> | 26 | #include <linux/list.h> |
25 | #include <linux/spinlock.h> | ||
26 | 27 | ||
27 | #include <mach/clk.h> | 28 | #include <mach/clk.h> |
28 | 29 | ||
@@ -52,7 +53,8 @@ | |||
52 | #define ENABLE_ON_INIT (1 << 28) | 53 | #define ENABLE_ON_INIT (1 << 28) |
53 | #define PERIPH_ON_APB (1 << 29) | 54 | #define PERIPH_ON_APB (1 << 29) |
54 | 55 | ||
55 | struct clk; | 56 | struct clk_tegra; |
57 | #define to_clk_tegra(_hw) container_of(_hw, struct clk_tegra, hw) | ||
56 | 58 | ||
57 | struct clk_mux_sel { | 59 | struct clk_mux_sel { |
58 | struct clk *input; | 60 | struct clk *input; |
@@ -68,47 +70,29 @@ struct clk_pll_freq_table { | |||
68 | u8 cpcon; | 70 | u8 cpcon; |
69 | }; | 71 | }; |
70 | 72 | ||
71 | struct clk_ops { | ||
72 | void (*init)(struct clk *); | ||
73 | int (*enable)(struct clk *); | ||
74 | void (*disable)(struct clk *); | ||
75 | int (*set_parent)(struct clk *, struct clk *); | ||
76 | int (*set_rate)(struct clk *, unsigned long); | ||
77 | long (*round_rate)(struct clk *, unsigned long); | ||
78 | void (*reset)(struct clk *, bool); | ||
79 | int (*clk_cfg_ex)(struct clk *, | ||
80 | enum tegra_clk_ex_param, u32); | ||
81 | }; | ||
82 | |||
83 | enum clk_state { | 73 | enum clk_state { |
84 | UNINITIALIZED = 0, | 74 | UNINITIALIZED = 0, |
85 | ON, | 75 | ON, |
86 | OFF, | 76 | OFF, |
87 | }; | 77 | }; |
88 | 78 | ||
89 | struct clk { | 79 | struct clk_tegra { |
90 | /* node for master clocks list */ | 80 | /* node for master clocks list */ |
91 | struct list_head node; /* node for list of all clocks */ | 81 | struct list_head node; /* node for list of all clocks */ |
92 | struct clk_lookup lookup; | 82 | struct clk_lookup lookup; |
83 | struct clk_hw hw; | ||
93 | 84 | ||
94 | #ifdef CONFIG_DEBUG_FS | ||
95 | struct dentry *dent; | ||
96 | #endif | ||
97 | bool set; | 85 | bool set; |
98 | struct clk_ops *ops; | 86 | unsigned long fixed_rate; |
99 | unsigned long rate; | ||
100 | unsigned long max_rate; | 87 | unsigned long max_rate; |
101 | unsigned long min_rate; | 88 | unsigned long min_rate; |
102 | u32 flags; | 89 | u32 flags; |
103 | const char *name; | 90 | const char *name; |
104 | 91 | ||
105 | u32 refcnt; | ||
106 | enum clk_state state; | 92 | enum clk_state state; |
107 | struct clk *parent; | ||
108 | u32 div; | 93 | u32 div; |
109 | u32 mul; | 94 | u32 mul; |
110 | 95 | ||
111 | const struct clk_mux_sel *inputs; | ||
112 | u32 reg; | 96 | u32 reg; |
113 | u32 reg_shift; | 97 | u32 reg_shift; |
114 | 98 | ||
@@ -144,7 +128,8 @@ struct clk { | |||
144 | } shared_bus_user; | 128 | } shared_bus_user; |
145 | } u; | 129 | } u; |
146 | 130 | ||
147 | spinlock_t spinlock; | 131 | void (*reset)(struct clk_hw *, bool); |
132 | int (*clk_cfg_ex)(struct clk_hw *, enum tegra_clk_ex_param, u32); | ||
148 | }; | 133 | }; |
149 | 134 | ||
150 | struct clk_duplicate { | 135 | struct clk_duplicate { |
@@ -159,13 +144,10 @@ struct tegra_clk_init_table { | |||
159 | bool enabled; | 144 | bool enabled; |
160 | }; | 145 | }; |
161 | 146 | ||
147 | void tegra_clk_add(struct clk *c); | ||
162 | void tegra2_init_clocks(void); | 148 | void tegra2_init_clocks(void); |
163 | void tegra30_init_clocks(void); | 149 | void tegra30_init_clocks(void); |
164 | void clk_init(struct clk *clk); | ||
165 | struct clk *tegra_get_clock_by_name(const char *name); | 150 | struct clk *tegra_get_clock_by_name(const char *name); |
166 | int clk_reparent(struct clk *c, struct clk *parent); | ||
167 | void tegra_clk_init_from_table(struct tegra_clk_init_table *table); | 151 | void tegra_clk_init_from_table(struct tegra_clk_init_table *table); |
168 | unsigned long clk_get_rate_locked(struct clk *c); | ||
169 | int clk_set_rate_locked(struct clk *c, unsigned long rate); | ||
170 | 152 | ||
171 | #endif | 153 | #endif |