Skip to contentSkip to conversation

OMAP: clock: Fix compile break with a

PATCH New Rajendra Nayak 1 participant 1 message Feb 14, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 OMAP: clock: Fix compile break with a

s/spin_lock_irq*/spin_unlock_irq*

Trivial fix to do a s/spin_lock_irqrestore/spin_unlock_irqrestore and fix the compile break.

---
 arch/arm/plat-omap/clock.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/plat-omap/clock.c +2 -2
index 585533a..a2b069f 100644
@@ -346,7 +346,7 @@ void omap_clk_enable_autoidle_all(void)
 		if (c->ops->allow_idle)
 			c->ops->allow_idle(c);
 
-	spin_lock_irqrestore(&clockfw_lock, flags);
+	spin_unlock_irqrestore(&clockfw_lock, flags);
 }
 
 void omap_clk_disable_autoidle_all(void)
@@ -360,7 +360,7 @@ void omap_clk_disable_autoidle_all(void)
 		if (c->ops->deny_idle)
 			c->ops->deny_idle(c);
 
-	spin_lock_irqrestore(&clockfw_lock, flags);
+	spin_unlock_irqrestore(&clockfw_lock, flags);
 }
 
 /*
Signature · 4 lines
1.7.0.4

Regards,
Rajendra
Quoted 23 lines

- Paul

From: Rajendra Nayak <[email protected]>
Date: Thu, 10 Feb 2011 14:46:36 +0530
Subject: [PATCH] omap: clock: Add allow_idle/deny_idle support in clkops

On OMAP various clock nodes (dpll's, mx post dividers, interface clocks) support hardware level autogating which can be controlled from software.
Support such functionality by adding two new function pointer allow_idle and deny_idle in the clkops structure.

These function pointers can be populated for any clock node which supports hardware level autogating.

Also add 2 new functions (omap_clk_enable_auotidle and omap_clk_disable_autoidle) which can be called from architecture specific PM core code, if hardware level autogating (for all supported clock nodes) is to be enabled or disabled.

Quoted 5 lines
[paul at pwsan.com: use spinlock rather than mutex due to race]
---
 arch/arm/plat-omap/clock.c              |   28

++++++++++++++++++++++++++++

Review

Quoted 43 lines
 arch/arm/plat-omap/include/plat/clock.h |    6 ++++++
 2 files changed, 34 insertions(+), 0 deletions(-)
arch/arm/plat-omap/clock.c +28 -0
index fc62fb5..0cdac8d 100644
@@ -335,6 +335,34 @@ struct clk *omap_clk_get_by_name(const char *name)
 	return ret;
 }
 
+void omap_clk_enable_autoidle(void)
+{
+	struct clk *c;
+	unsigned long flags;
+
+	spin_lock_irqsave(&clockfw_lock, flags);
+
+	list_for_each_entry(c, &clocks, node)
+		if (c->ops->allow_idle)
+			c->ops->allow_idle(c);
+
+	spin_lock_irqrestore(&clockfw_lock, flags);
+}
+
+void omap_clk_disable_autoidle(void)
+{
+	struct clk *c;
+	unsigned long flags;
+
+	spin_lock_irqsave(&clockfw_lock, flags);
+
+	list_for_each_entry(c, &clocks, node)
+		if (c->ops->deny_idle)
+			c->ops->deny_idle(c);
+
+	spin_lock_irqrestore(&clockfw_lock, flags);
+}
+
 /*
  * Low level helpers
  */
(quoted diff) +0 -0

b/arch/arm/plat-omap/include/plat/clock.h

arch/arm/plat-omap/include/plat/clock.h struct clockdomain; · line 26

Quoted 6 lines

index 8eb0ada..167f1e0f 100644

arch/arm/plat-omap/include/plat/clock.h +0 -0
@@ -25,6 +25,8 @@ struct clockdomain;
  * @disable: fn ptr that enables the current clock in hardware
  * @find_idlest: function returning the IDLEST register for the clock's

IP blk

arch/arm/plat-omap/include/plat/clock.h struct clockdomain; · line 27

Quoted 1 line
arch/arm/plat-omap/include/plat/clock.h +0 -0
  * @find_companion: function returning the "companion" clk reg for the

clock

arch/arm/plat-omap/include/plat/clock.h struct clockdomain; · line 28

Quoted 1 line
arch/arm/plat-omap/include/plat/clock.h +1 -0
+ * @allow_idle: fn ptr that enables autoidle for the current clock in

hardware

arch/arm/plat-omap/include/plat/clock.h struct clockdomain; · line 29

Quoted 1 line
arch/arm/plat-omap/include/plat/clock.h +1 -0
+ * @deny_idle: fn ptr that disables autoidle for the current clock in

hardware

arch/arm/plat-omap/include/plat/clock.h struct clkops { · line 45

Quoted 6 lines
arch/arm/plat-omap/include/plat/clock.h +0 -0
  *
  * A "companion" clk is an accompanying clock to the one being queried
  * that must be enabled for the IP module connected to the clock to
@@ -42,6 +44,8 @@ struct clkops {
 					       u8 *, u8 *);
 	void			(*find_companion)(struct clk *, void

__iomem **,

arch/arm/plat-omap/include/plat/clock.h extern void clk_init_cpufreq_table(struct

Quoted 7 lines
arch/arm/plat-omap/include/plat/clock.h +2 -0
 						  u8 *);
+	void			(*allow_idle)(struct clk *);
+	void			(*deny_idle)(struct clk *);
 };
 
 #ifdef CONFIG_ARCH_OMAP2PLUS
@@ -292,6 +296,8 @@ extern void clk_init_cpufreq_table(struct

cpufreq_frequency_table **table);

arch/arm/plat-omap/include/plat/clock.h extern void clk_init_cpufreq_table(struct · line 296

Quoted 1 line
arch/arm/plat-omap/include/plat/clock.h +0 -0
 extern void clk_exit_cpufreq_table(struct cpufreq_frequency_table

**table);

Quoted 9 lines
arch/arm/plat-omap/include/plat/clock.h +2 -1
 #endif
 extern struct clk *omap_clk_get_by_name(const char *name);
+extern void omap_clk_enable_autoidle(void);
+extern void omap_clk_disable_autoidle(void);
 
 extern const struct clkops clkops_null;
 
--

1.7.2.3