public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 2.6.23-rc2 1/2] define clk_must_disable()
@ 2007-08-06 18:11 David Brownell
  2007-08-06 20:04 ` Russell King
  0 siblings, 1 reply; 16+ messages in thread
From: David Brownell @ 2007-08-06 18:11 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Andrew Victor, linux-pm, Russell King

This patch adds a clk_must_disable() operation, exposing the clock constraints
which often distinguish system power states.  Systems with such constraints
include ones using ARM-based AT91, OMAP, and PXA chips.  The new operation
lets driver methods check those constraints.

A common benefit to leaving some device clocks enabled is that a suspended
device may then be able to issue system wakeup events.  RS232, USB, Ethernet,
and other drivers can use driver model wakeup flags as userspace directions
about how to trade off between the lowest power "full off" states and more
functional wakeup-enabled ones.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>

--- at91.orig/include/linux/clk.h	2007-02-16 08:47:11.000000000 -0800
+++ at91/include/linux/clk.h	2007-02-16 08:47:17.000000000 -0800
@@ -121,4 +121,24 @@ int clk_set_parent(struct clk *clk, stru
  */
 struct clk *clk_get_parent(struct clk *clk);
 
+/**
+ * clk_must_disable - report whether a clock's users must disable it
+ * @clk: one node in the clock tree
+ *
+ * This routine returns true only if the upcoming system state requires
+ * disabling the specified clock.
+ *
+ * It's common for platform power states to constrain certain clocks (and
+ * their descendants) to be unavailable, while other states allow that
+ * clock to be active.  A platform's power states often include an "all on"
+ * mode; system wide sleep states like "standby" and "suspend-to-RAM"; and
+ * operating states which sacrifice functionality for lower power usage.
+ *
+ * The constraint value is commonly tested in device driver suspend(), to
+ * leave clocks active if they are needed for features like wakeup events.
+ * On platforms that support reduced functionality operating states, the
+ * constraint may also need to be tested during resume() and probe() calls.
+ */
+int clk_must_disable(struct clk *clk);
+
 #endif

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2007-08-07 22:20 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-06 18:11 [patch 2.6.23-rc2 1/2] define clk_must_disable() David Brownell
2007-08-06 20:04 ` Russell King
2007-08-06 20:38   ` David Brownell
2007-08-06 21:03     ` David Brownell
2007-08-06 21:48     ` Russell King
2007-08-06 23:46       ` David Brownell
2007-08-07  5:23         ` Andrew Morton
2007-08-07 12:50           ` Russell King
2007-08-07 17:21             ` Andrew Morton
2007-08-07 17:25               ` Russell King
2007-08-07 20:15             ` David Brownell
2007-08-07 20:18             ` David Brownell
2007-08-07 21:04             ` David Brownell
2007-08-07 21:17             ` David Brownell
2007-08-07 22:20               ` Rafael J. Wysocki
2007-08-07 21:20             ` David Brownell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox