linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: linux-i2c@vger.kernel.org
Cc: Wolfram Sang <wsa@the-dreams.de>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Lv Zheng <lv.zheng@intel.com>, Aaron Lu <aaron.lu@intel.com>,
	linux-arm-kernel@lists.infradead.org,
	Mika Westerberg <mika.westerberg@linux.intel.com>
Subject: [PATCH RESEND 0/2] runtime PM support for I2C clients
Date: Mon,  9 Sep 2013 16:34:37 +0300	[thread overview]
Message-ID: <1378733679-19500-1-git-send-email-mika.westerberg@linux.intel.com> (raw)

[Resend with linux-arm-kernel included and added acks from Rafael]

Hi all,

With the advent of ACPI 5.0 we are starting to see I2C client devices
described in ACPI namespace that support power management by the means of
standard ACPI _PSx-methods. For example Intel Haswell based platforms might
have touch screen or sensor-hub connected to the I2C bus that can be
powered on and off by calling _PS0 and _PS3 -methods.

In order to support such I2C client devices, we decided to hook the ACPI
power management for these to the standard Linux runtime PM framework.

These patches implement runtime PM support for I2C client devices in a
similar way that is done already for the PCI bus. Just before a driver is
bound to an I2C client device the device runtime PM is being prepared for
that device.

If the device in question has an ACPI handle we attach it to the ACPI power
domain that then makes sure that the right _PSx methods are called in
response to runtime PM events the driver generates.

A driver that wants to participate in runtime PM and power manage its
device should:
 1) Implement device specific runtime PM callbacks if needed.
 2) Call pm_runtime_put() (or some variant of that) to decrease the runtime
    PM reference count.

If the driver doesn't do anything the device is regarded as runtime PM
active and powered on.

Even though this series has been developed specifically for ACPI enumerated
I2C client devices, I believe it can be useful for other I2C client drivers
because the I2C core now prepares the runtime PM on behalf of the driver
and thus reduces the amount of code a driver writer needs to add.

Aaron Lu (1):
  i2c: prepare runtime PM support for I2C client devices

Lv Zheng (1):
  i2c: attach/detach I2C client device to the ACPI power domain

 drivers/i2c/i2c-core.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 56 insertions(+), 1 deletion(-)

-- 
1.8.4.rc2

             reply	other threads:[~2013-09-09 13:34 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-09 13:34 Mika Westerberg [this message]
2013-09-09 13:34 ` [PATCH RESEND 1/2] i2c: prepare runtime PM support for I2C client devices Mika Westerberg
2013-09-09 15:40   ` Mark Brown
2013-09-10  7:51     ` Mika Westerberg
     [not found]       ` <20130910075100.GK7393-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2013-09-10 11:38         ` Rafael J. Wysocki
2013-09-10 12:27       ` Mark Brown
     [not found]         ` <20130910122754.GK29403-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2013-09-10 14:26           ` Mika Westerberg
2013-09-10 16:13             ` Mark Brown
     [not found]               ` <20130910161321.GM29403-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2013-09-10 20:04                 ` Rafael J. Wysocki
     [not found]                   ` <3397524.g9aUWuArnm-sKB8Sp2ER+y1GS7QM15AGw@public.gmane.org>
2013-09-10 21:35                     ` Mark Brown
     [not found]                       ` <20130910213522.GG29403-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2013-09-10 22:32                         ` Rafael J. Wysocki
2013-09-11  1:01                           ` Aaron Lu
2013-09-11  9:55                             ` Mark Brown
     [not found]                               ` <20130911095552.GI29403-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2013-09-11 11:05                                 ` Mika Westerberg
2013-09-11 11:14                                   ` Mark Brown
2013-09-11 11:24                                     ` Mika Westerberg
     [not found]                             ` <522FC0DC.9030708-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2013-09-12 21:07                               ` Kevin Hilman
     [not found]                                 ` <87eh8trbob.fsf-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2013-09-12 22:01                                   ` Mark Brown
2013-09-09 13:34 ` [PATCH RESEND 2/2] i2c: attach/detach I2C client device to the ACPI power domain Mika Westerberg

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=1378733679-19500-1-git-send-email-mika.westerberg@linux.intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=aaron.lu@intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lv.zheng@intel.com \
    --cc=rafael.j.wysocki@intel.com \
    --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 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).