summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/clock.h
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2010-11-01 17:25:30 -0700
committerColin Cross <ccross@android.com>2010-11-03 17:37:56 -0700
commitc95714d0ba915e422ad676f68630fcd513f34295 (patch)
treeb36183c6769f951166bdfe60be4bf3a2f9528159 /arch/arm/mach-tegra/clock.h
parent1f8ca000a05c44e338438c729022d238b167fba4 (diff)
ARM: tegra: clock: Redo clock locking
Give each clock its own lock, and remove all lock traversals from parent to child clocks to prevent AB-BA deadlocks. Signed-off-by: Colin Cross <ccross@android.com> Change-Id: I0afb7d1bca956439b1a4f17bbc6748aaec706b49
Diffstat (limited to 'arch/arm/mach-tegra/clock.h')
-rw-r--r--arch/arm/mach-tegra/clock.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/arch/arm/mach-tegra/clock.h b/arch/arm/mach-tegra/clock.h
index b13aab47083e..0bcf475b3c82 100644
--- a/arch/arm/mach-tegra/clock.h
+++ b/arch/arm/mach-tegra/clock.h
@@ -21,6 +21,8 @@
#define __MACH_TEGRA_CLOCK_H
#include <linux/list.h>
+#include <linux/mutex.h>
+#include <linux/spinlock.h>
#include <asm/clkdev.h>
#define DIV_BUS (1 << 0)
@@ -75,8 +77,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 list_head dvfs; /* list of dvfs dependencies */
struct clk_lookup lookup;
@@ -91,11 +91,11 @@ struct clk {
unsigned long max_rate;
bool is_dvfs;
bool auto_dvfs;
+ bool cansleep;
u32 flags;
const char *name;
u32 refcnt;
- unsigned long requested_rate;
enum clk_state state;
struct clk *parent;
u32 div;
@@ -137,8 +137,10 @@ struct clk {
unsigned long rate;
} shared_bus_user;
} u;
-};
+ struct mutex mutex;
+ spinlock_t spinlock;
+};
struct clk_duplicate {
const char *name;
@@ -158,12 +160,10 @@ 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);
void tegra_clk_set_dvfs_rates(void);
+void clk_set_cansleep(struct clk *c);
+unsigned long clk_get_rate_locked(struct clk *c);
#endif