linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa@the-dreams.de>
To: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: linux-acpi@vger.kernel.org, Mark Brown <broonie@kernel.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Aaron Lu <aaron.lu@intel.com>, Lv Zheng <lv.zheng@intel.com>,
	linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] i2c: attach/detach I2C client device to the ACPI power domain
Date: Thu, 10 Oct 2013 10:09:19 +0200	[thread overview]
Message-ID: <20131010080919.GC2638@katana> (raw)
In-Reply-To: <1381327461-10562-3-git-send-email-mika.westerberg@linux.intel.com>

[-- Attachment #1: Type: text/plain, Size: 1388 bytes --]

On Wed, Oct 09, 2013 at 05:04:20PM +0300, Mika Westerberg wrote:
> From: Lv Zheng <lv.zheng@intel.com>
> 
> If the I2C client device is enumerated from ACPI namespace it might have
> ACPI methods that needs to be called in order to transition the device to
> different power states (such as _PSx).
> 
> Implement this for I2C client devices by checking if the device has an ACPI
> handle and if that's the case, attach it to the ACPI power domain. In
> addition we make sure that the device is fully powered when its ->probe()
> function gets called.
> 
> For non-ACPI devices this patch is a no-op.
> 
> Signed-off-by: Lv Zheng <lv.zheng@intel.com>
> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> ---
>  drivers/i2c/i2c-core.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
> index 29d3f04..f25dee3 100644
> --- a/drivers/i2c/i2c-core.c
> +++ b/drivers/i2c/i2c-core.c
> @@ -254,10 +254,16 @@ static int i2c_device_probe(struct device *dev)
>  					client->flags & I2C_CLIENT_WAKE);
>  	dev_dbg(dev, "probe\n");
>  
> +	if (ACPI_HANDLE(&client->dev))
> +		acpi_dev_pm_attach(&client->dev, true);

I'd prefer to drop the 'if's in case they are checked inside the acpi_*
calls anyway. Not a show-stopper, though, so:

Acked-by: Wolfram Sang <wsa@the-dreams.de>


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2013-10-10  8:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-09 14:04 [PATCH 0/3] ACPI power management support for I2C and SPI devices Mika Westerberg
2013-10-09 14:04 ` [PATCH 1/3] ACPI / PM: allow child devices to ignore parent power state Mika Westerberg
     [not found] ` <1381327461-10562-1-git-send-email-mika.westerberg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2013-10-09 14:04   ` [PATCH 2/3] i2c: attach/detach I2C client device to the ACPI power domain Mika Westerberg
2013-10-10  8:09     ` Wolfram Sang [this message]
2013-10-10  8:26       ` Mika Westerberg
2013-10-09 14:04 ` [PATCH 3/3] spi: attach/detach SPI " Mika Westerberg
     [not found]   ` <1381327461-10562-4-git-send-email-mika.westerberg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2013-10-09 17:55     ` Mark Brown
2013-10-10  6:12       ` Mika Westerberg
     [not found]         ` <20131010061256.GB3521-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2013-10-10  9:38           ` Mark Brown
2013-10-10 10:28 ` [PATCH v2 0/3] ACPI power management support for I2C and SPI devices Mika Westerberg
2013-10-10 10:28   ` [PATCH v2 1/3] ACPI / PM: allow child devices to ignore parent power state Mika Westerberg
2013-10-10 10:28   ` [PATCH v2 2/3] i2c: attach/detach I2C client device to the ACPI power domain Mika Westerberg
     [not found]   ` <1381400928-2689-1-git-send-email-mika.westerberg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2013-10-10 10:28     ` [PATCH v2 3/3] spi: attach/detach SPI " Mika Westerberg
2013-10-10 13:02     ` [PATCH v2 0/3] ACPI power management support for I2C and SPI devices Rafael J. Wysocki

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=20131010080919.GC2638@katana \
    --to=wsa@the-dreams.de \
    --cc=aaron.lu@intel.com \
    --cc=broonie@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lv.zheng@intel.com \
    --cc=mika.westerberg@linux.intel.com \
    --cc=rjw@rjwysocki.net \
    /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).