From: Wolfram Sang <wsa@the-dreams.de>
To: linux-i2c@vger.kernel.org
Cc: linux-sh@vger.kernel.org, Magnus Damm <magnus.damm@gmail.com>,
Simon Horman <horms@verge.net.au>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Wolfram Sang <wsa@the-dreams.de>,
linux-pm@vger.kernel.org,
Sylwester Nawrocki <s.nawrocki@samsung.com>,
Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Subject: [PATCH 1/2] i2c: always enable RuntimePM for the adapter device
Date: Wed, 23 Dec 2015 17:19:28 +0000 [thread overview]
Message-ID: <1450891169-13708-2-git-send-email-wsa@the-dreams.de> (raw)
In-Reply-To: <1450891169-13708-1-git-send-email-wsa@the-dreams.de>
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
The adapter device is a logical device. Because of that, it already uses
pm_runtime_no_callbacks() in the core. To ensure proper propagation from
the children (i2c devices) to the parent of the adapter (the HW device),
make sure RuntimePM is enabled in any case.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/i2c/i2c-core.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index e94d2ca2aab4aa..55159e8e53283a 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -1610,6 +1610,7 @@ static int i2c_register_adapter(struct i2c_adapter *adap)
dev_dbg(&adap->dev, "adapter [%s] registered\n", adap->name);
pm_runtime_no_callbacks(&adap->dev);
+ pm_runtime_enable(&adap->dev);
#ifdef CONFIG_I2C_COMPAT
res = class_compat_create_link(i2c_adapter_compat_class, &adap->dev,
@@ -1864,6 +1865,8 @@ void i2c_del_adapter(struct i2c_adapter *adap)
/* device name is gone after device_unregister */
dev_dbg(&adap->dev, "adapter [%s] unregistered\n", adap->name);
+ pm_runtime_disable(&adap->dev);
+
/* wait until all references to the device are gone
*
* FIXME: This is old code and should ideally be replaced by an
--
2.1.4
next prev parent reply other threads:[~2015-12-23 17:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-23 17:19 [PATCH 0/2] i2c: proper RuntimePM for the adapter device Wolfram Sang
2015-12-23 17:19 ` Wolfram Sang [this message]
2016-01-10 8:27 ` [PATCH 1/2] i2c: always enable " Wolfram Sang
2015-12-23 17:19 ` [PATCH 2/2] i2c: s3c2410: remove superfluous runtime PM calls Wolfram Sang
2016-01-10 8:27 ` Wolfram Sang
2015-12-24 5:54 ` [PATCH 0/2] i2c: proper RuntimePM for the adapter device Shubhrajyoti Datta
2015-12-24 8:41 ` Wolfram Sang
2015-12-24 17:16 ` Shubhrajyoti Datta
2015-12-24 22:25 ` Wolfram Sang
2015-12-25 5:54 ` Shubhrajyoti Datta
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=1450891169-13708-2-git-send-email-wsa@the-dreams.de \
--to=wsa@the-dreams.de \
--cc=ckeepax@opensource.wolfsonmicro.com \
--cc=geert@linux-m68k.org \
--cc=horms@verge.net.au \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=s.nawrocki@samsung.com \
/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;
as well as URLs for NNTP newsgroup(s).