All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Wolfram Sang <wsa@the-dreams.de>, Mark Brown <broonie@kernel.org>,
	Ulf Hansson <ulf.hansson@linaro.org>
Cc: linux-pm@vger.kernel.org, Linus Walleij <linus.walleij@linaro.org>
Subject: [PATCH 1/3] PM / sleep: add a helper function to inherit child ignorance
Date: Thu,  7 Apr 2016 15:20:35 +0200	[thread overview]
Message-ID: <1460035237-12037-2-git-send-email-linus.walleij@linaro.org> (raw)
In-Reply-To: <1460035237-12037-1-git-send-email-linus.walleij@linaro.org>

A few subsystems dealing with peripherals on slow buses with
transfer-oriented runtime PM will need to inherit the child
ignorance property of their parent hardware devices.

Especially struct i2c_adapter and struct spi_master needs
this.

This adds a helper function to deal with this and make it
clear what is going on.

Cc: Wolfram Sang <wsa@the-dreams.de>
Cc: Mark Brown <broonie@kernel.org>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 include/linux/device.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/include/linux/device.h b/include/linux/device.h
index 002c59728dbe..675c09e62239 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -961,6 +961,13 @@ static inline void pm_suspend_ignore_children(struct device *dev, bool enable)
 	dev->power.ignore_children = enable;
 }
 
+static inline void pm_suspend_inherit_ignore_children(struct device *dev)
+{
+	if (!dev->parent)
+		return;
+	dev->power.ignore_children = dev->parent->power.ignore_children;
+}
+
 static inline void dev_pm_syscore_device(struct device *dev, bool val)
 {
 #ifdef CONFIG_PM_SLEEP
-- 
2.4.3


  reply	other threads:[~2016-04-07 13:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-07 13:20 [PATCH 0/3] PM / sleep: let slow buses inherit child ignorance Linus Walleij
2016-04-07 13:20 ` Linus Walleij [this message]
2016-04-11 11:54   ` [PATCH 1/3] PM / sleep: add a helper function to " Linus Walleij
2016-04-07 13:20 ` [PATCH 2/3] i2c: let I2C masters inherit suspend " Linus Walleij
2016-04-11  6:53   ` Linus Walleij
2016-04-11  6:58     ` Mark Brown
2016-04-07 13:20 ` [PATCH 3/3] RFC: spi: let SPI " Linus Walleij
2016-04-07 17:06   ` Mark Brown

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=1460035237-12037-2-git-send-email-linus.walleij@linaro.org \
    --to=linus.walleij@linaro.org \
    --cc=broonie@kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=ulf.hansson@linaro.org \
    --cc=wsa@the-dreams.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.