From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: srinivas.kandagatla@st.com
Cc: linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org,
Rob Herring <rob.herring@calxeda.com>,
Pawel Moll <pawel.moll@arm.com>,
Mark Rutland <mark.rutland@arm.com>,
Stephen Warren <swarren@wwwdotorg.org>,
Ian Campbell <ijc+devicetree@hellion.org.uk>,
Rob Landley <rob@landley.net>,
Russell King <linux@arm.linux.org.uk>,
Stuart Menefy <stuart.menefy@st.com>, Pavel Machek <pavel@ucw.cz>,
Len Brown <len.brown@intel.com>,
stephen.gallimore@st.com,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Giuseppe Cavallaro <peppe.cavallaro@st.com>,
Grant Likely <grant.likely@linaro.org>,
devicetree@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, kernel@stlinux.com,
linux-pm@vger.kernel.org
Subject: Re: [PATCH RFC 07/10] PM / wakeup : Introduce device_child_may_wakeup
Date: Tue, 12 Nov 2013 15:20:01 +0100 [thread overview]
Message-ID: <4093206.klj58BXQv3@vostro.rjw.lan> (raw)
In-Reply-To: <1384264377-7609-1-git-send-email-srinivas.kandagatla@st.com>
On Tuesday, November 12, 2013 01:52:57 PM srinivas.kandagatla@st.com wrote:
> From: Srinivas Kandagatla <srinivas.kandagatla@st.com>
>
> This patch introduces device_child_may_wakeup function, which will be
> useful for wrapper or SoC level driver power management code.
> Without this patch each driver has to write this same code to get the
> functionality.
>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
> ---
> drivers/base/power/wakeup.c | 23 +++++++++++++++++++++++
> include/linux/pm_wakeup.h | 1 +
> 2 files changed, 24 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c
> index 2d56f41..270f000 100644
> --- a/drivers/base/power/wakeup.c
> +++ b/drivers/base/power/wakeup.c
> @@ -342,6 +342,29 @@ int device_set_wakeup_enable(struct device *dev, bool enable)
> }
> EXPORT_SYMBOL_GPL(device_set_wakeup_enable);
>
> +/* callback for device_child_may_wakeup */
> +static int __device_child_may_wakeup(struct device *dev, void *c)
> +{
> + return device_may_wakeup(dev);
> +}
This doesn't have anything to do with children in principle, so please call
it differently. Something like device_may_wakeup_cb() would work for me (and
then you may not need the comment even).
Thanks!
> +
> +/**
> + * device_child_may_wakeup - Check if any of the child devices are wakeup
> + * sources.
> + * @dev: parent device to handle.
> + *
> + * Function to check if any of the children of a given parent are wakeup
> + * sources.
> + *
> + * This function will return true if any one of the children of given parent
> + * are wakeup sources, else it returns false.
> + */
> +bool device_child_may_wakeup(struct device *parent)
> +{
> + return device_for_each_child(parent, NULL, __device_child_may_wakeup);
> +}
> +EXPORT_SYMBOL_GPL(device_child_may_wakeup);
> +
> /*
> * The functions below use the observation that each wakeup event starts a
> * period in which the system should not be suspended. The moment this period
> diff --git a/include/linux/pm_wakeup.h b/include/linux/pm_wakeup.h
> index a0f7080..b376584 100644
> --- a/include/linux/pm_wakeup.h
> +++ b/include/linux/pm_wakeup.h
> @@ -93,6 +93,7 @@ extern int device_wakeup_disable(struct device *dev);
> extern void device_set_wakeup_capable(struct device *dev, bool capable);
> extern int device_init_wakeup(struct device *dev, bool val);
> extern int device_set_wakeup_enable(struct device *dev, bool enable);
> +bool device_child_may_wakeup(struct device *parent);
> extern void __pm_stay_awake(struct wakeup_source *ws);
> extern void pm_stay_awake(struct device *dev);
> extern void __pm_relax(struct wakeup_source *ws);
>
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
next prev parent reply other threads:[~2013-11-12 14:07 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-12 13:51 [PATCH RFC 00/10] ARM: STi: Add dwmac glue and reset controller srinivas.kandagatla
2013-11-12 13:52 ` [PATCH RFC 01/10] drivers: reset: STi SoC system configuration reset controller support srinivas.kandagatla
2013-11-12 13:52 ` [PATCH RFC 02/10] drivers: reset: Reset controller driver for STiH415 srinivas.kandagatla
2013-11-12 13:52 ` [PATCH RFC 03/10] drivers: reset: Reset controller driver for STiH416 srinivas.kandagatla
2013-11-12 13:52 ` [PATCH RFC 04/10] drivers: reset: stih415: add softreset controller srinivas.kandagatla
2013-11-12 13:52 ` [PATCH RFC 05/10] drivers: reset: stih416: " srinivas.kandagatla
2013-11-12 13:52 ` [PATCH RFC 06/10] ARM: STi: Add reset controller support to mach-sti Kconfig srinivas.kandagatla
2013-11-12 13:52 ` [PATCH RFC 07/10] PM / wakeup : Introduce device_child_may_wakeup srinivas.kandagatla
2013-11-12 14:20 ` Rafael J. Wysocki [this message]
2013-11-12 14:09 ` srinivas kandagatla
2013-11-12 13:53 ` [PATCH RFC 08/10] net: stmmac:sti: Add STi SOC glue driver srinivas.kandagatla
2013-11-29 19:37 ` Maxime Ripard
2013-12-02 12:48 ` srinivas kandagatla
2013-12-06 18:37 ` Maxime Ripard
2013-11-12 13:53 ` [PATCH RFC 09/10] ARM: STi: Add STiH415 ethernet support srinivas.kandagatla
2013-11-12 13:53 ` [PATCH RFC 10/10] ARM: STi: Add STiH416 " srinivas.kandagatla
2013-11-19 5:28 ` [PATCH RFC 00/10] ARM: STi: Add dwmac glue and reset controller Giuseppe CAVALLARO
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=4093206.klj58BXQv3@vostro.rjw.lan \
--to=rjw@rjwysocki.net \
--cc=devicetree@vger.kernel.org \
--cc=grant.likely@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=ijc+devicetree@hellion.org.uk \
--cc=kernel@stlinux.com \
--cc=len.brown@intel.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=mark.rutland@arm.com \
--cc=netdev@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=pawel.moll@arm.com \
--cc=peppe.cavallaro@st.com \
--cc=rob.herring@calxeda.com \
--cc=rob@landley.net \
--cc=srinivas.kandagatla@st.com \
--cc=stephen.gallimore@st.com \
--cc=stuart.menefy@st.com \
--cc=swarren@wwwdotorg.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
all inboxes | Powered by JetHome®