diff options
author | Colin Cross <ccross@android.com> | 2011-02-12 16:43:05 -0800 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2011-02-21 00:10:43 -0800 |
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 @@ #ifndef __MACH_TEGRA_CLOCK_H #define __MACH_TEGRA_CLOCK_H -#include <linux/list.h> #include <linux/clkdev.h> +#include <linux/list.h> +#include <linux/spinlock.h> #define DIV_BUS (1 << 0) #define DIV_U71 (1 << 1) @@ -75,8 +76,6 @@ enum clk_state { struct clk { /* node for master clocks list */ struct list_head node; /* node for list of all clocks */ - struct list_head children; /* list of children */ - struct list_head sibling; /* node for children */ struct clk_lookup lookup; #ifdef CONFIG_DEBUG_FS @@ -122,8 +121,9 @@ struct clk { struct clk *backup; } cpu; } u; -}; + spinlock_t spinlock; +}; struct clk_duplicate { const char *name; @@ -143,11 +143,9 @@ void tegra2_periph_reset_assert(struct clk *c); void clk_init(struct clk *clk); struct clk *tegra_get_clock_by_name(const char *name); unsigned long clk_measure_input_freq(void); -void clk_disable_locked(struct clk *c); -int clk_enable_locked(struct clk *c); -int clk_set_parent_locked(struct clk *c, struct clk *parent); -int clk_set_rate_locked(struct clk *c, unsigned long rate); int clk_reparent(struct clk *c, struct clk *parent); void tegra_clk_init_from_table(struct tegra_clk_init_table *table); +unsigned long clk_get_rate_locked(struct clk *c); +int clk_set_rate_locked(struct clk *c, unsigned long rate); #endif |