diff options
author | Colin Cross <ccross@android.com> | 2011-02-12 19:43:05 -0500 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2011-02-21 03:10:43 -0500 |
commit | 4729fd7a7dfe7847b4870801ad12222adaeb016c (patch) | |
tree | 4e91328db46cc6c5ddd91d6e75323020c4623c42 /arch/arm/mach-tegra/clock.h | |
parent | f151961173bf28047d01b410969f05e485f56d7e (diff) |
ARM: tegra: clock: Convert global lock to a lock per clock
Give each clock its own lock, and remove all lock traversals from
parent to child clocks to prevent AB-BA deadlocks.
This brings the locking in line with the common struct clk
patches and should make conversion simple.
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Colin Cross <ccross@android.com>
Diffstat (limited to 'arch/arm/mach-tegra/clock.h')
-rw-r--r-- | arch/arm/mach-tegra/clock.h | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/arch/arm/mach-tegra/clock.h b/arch/arm/mach-tegra/clock.h index 20f0ce69bbaf..a63dbf93d9b0 100644 --- a/arch/arm/mach-tegra/clock.h +++ b/arch/arm/mach-tegra/clock.h | |||
@@ -20,8 +20,9 @@ | |||
20 | #ifndef __MACH_TEGRA_CLOCK_H | 20 | #ifndef __MACH_TEGRA_CLOCK_H |
21 | #define __MACH_TEGRA_CLOCK_H | 21 | #define __MACH_TEGRA_CLOCK_H |
22 | 22 | ||
23 | #include <linux/list.h> | ||
24 | #include <linux/clkdev.h> | 23 | #include <linux/clkdev.h> |
24 | #include <linux/list.h> | ||
25 | #include <linux/spinlock.h> | ||
25 | 26 | ||
26 | #define DIV_BUS (1 << 0) | 27 | #define DIV_BUS (1 << 0) |
27 | #define DIV_U71 (1 << 1) | 28 | #define DIV_U71 (1 << 1) |
@@ -75,8 +76,6 @@ enum clk_state { | |||
75 | struct clk { | 76 | struct clk { |
76 | /* node for master clocks list */ | 77 | /* node for master clocks list */ |
77 | struct list_head node; /* node for list of all clocks */ | 78 | struct list_head node; /* node for list of all clocks */ |
78 | struct list_head children; /* list of children */ | ||
79 | struct list_head sibling; /* node for children */ | ||
80 | struct clk_lookup lookup; | 79 | struct clk_lookup lookup; |
81 | 80 | ||
82 | #ifdef CONFIG_DEBUG_FS | 81 | #ifdef CONFIG_DEBUG_FS |
@@ -122,8 +121,9 @@ struct clk { | |||
122 | struct clk *backup; | 121 | struct clk *backup; |
123 | } cpu; | 122 | } cpu; |
124 | } u; | 123 | } u; |
125 | }; | ||
126 | 124 | ||
125 | spinlock_t spinlock; | ||
126 | }; | ||
127 | 127 | ||
128 | struct clk_duplicate { | 128 | struct clk_duplicate { |
129 | const char *name; | 129 | const char *name; |
@@ -143,11 +143,9 @@ void tegra2_periph_reset_assert(struct clk *c); | |||
143 | void clk_init(struct clk *clk); | 143 | void clk_init(struct clk *clk); |
144 | struct clk *tegra_get_clock_by_name(const char *name); | 144 | struct clk *tegra_get_clock_by_name(const char *name); |
145 | unsigned long clk_measure_input_freq(void); | 145 | unsigned long clk_measure_input_freq(void); |
146 | void clk_disable_locked(struct clk *c); | ||
147 | int clk_enable_locked(struct clk *c); | ||
148 | int clk_set_parent_locked(struct clk *c, struct clk *parent); | ||
149 | int clk_set_rate_locked(struct clk *c, unsigned long rate); | ||
150 | int clk_reparent(struct clk *c, struct clk *parent); | 146 | int clk_reparent(struct clk *c, struct clk *parent); |
151 | void tegra_clk_init_from_table(struct tegra_clk_init_table *table); | 147 | void tegra_clk_init_from_table(struct tegra_clk_init_table *table); |
148 | unsigned long clk_get_rate_locked(struct clk *c); | ||
149 | int clk_set_rate_locked(struct clk *c, unsigned long rate); | ||
152 | 150 | ||
153 | #endif | 151 | #endif |