public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: linux-pm@lists.osdl.org
Cc: Linux Kernel list <linux-kernel@vger.kernel.org>,
	Andrew Victor <andrew@sanpeople.com>
Subject: [PATCH/RFC 2.6.17-rc4-git] clk_must_disable()
Date: Tue, 16 May 2006 17:39:15 -0700	[thread overview]
Message-ID: <200605161739.17059.david-b@pacbell.net> (raw)

This defines a new optional clock API ... comments?

In implementation terms, the platform's pm_ops.prepare() can record the
target system state, and its implementation of this method would know
thinks like "STR turns off those two PLLs and their derived clocks",
while "standby leaves those PLLs on".

Alternate PM approaches -- DPM, operating points, whatever -- could have
their own internal representations of these constraints, but drivers would
only need this one API call to check them from suspend() callbacks.

- Dave


-------------------------	SNIP!

This patch adds a clk_must_disable() operation, exposing clock constraints
that 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 to trade off between the
lowest power "full off" states and more functional wakeup-enabled states,
as configured through sysfs.

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


--- at91-pre2.orig/include/linux/clk.h	2006-05-15 10:07:24.000000000 -0700
+++ at91-pre2/include/linux/clk.h	2006-05-15 10:41:15.000000000 -0700
@@ -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" or "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

             reply	other threads:[~2006-05-17  0:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-17  0:39 David Brownell [this message]
2006-06-15 17:13 ` [PATCH/RFC 2.6.17-rc4-git] clk_must_disable() David Brownell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200605161739.17059.david-b@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=andrew@sanpeople.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox