public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Rabin Vincent <rabin@rab.in>,
	stern@rowland.harvard.edu, linux-pm@lists.linux-foundation.org,
	linux-i2c@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: platform/i2c busses: pm runtime and system sleep
Date: Fri, 17 Dec 2010 14:24:03 +0000	[thread overview]
Message-ID: <20101217142402.GA19391@rakim.wolfsonmicro.main> (raw)
In-Reply-To: <201012171449.26082.rjw@sisk.pl>

On Fri, Dec 17, 2010 at 02:49:25PM +0100, Rafael J. Wysocki wrote:
> On Friday, December 17, 2010, Mark Brown wrote:

> > By, for example, providing default implementations which the buses can
> > use if they choose to.

> OK, so we have generic_subsys_pm_ops.  Do we need anything beyond that?

Hrm.  Possibly just some fiddling with those or alternative versions.
For example, looking at the I2C bus suspend it's this:

static int i2c_device_pm_suspend(struct device *dev)
{
	const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;

	if (pm) {
		if (pm_runtime_suspended(dev))
			return 0;
		else
			return pm->suspend ? pm->suspend(dev) : 0;
	}

	return i2c_legacy_suspend(dev, PMSG_SUSPEND);
}

Ideally the if (pm) block could just be factored out into the pm core as
there's nothing I2C-specific about that at all.  Possibly even the whole
logic surrounding fall back to legacy, though that smells a bit.  The
generic suspend operation doesn't fit here:

int pm_generic_suspend(struct device *dev)
{
	return __pm_generic_call(dev, PM_EVENT_SUSPEND);
}
EXPORT_SYMBOL_GPL(pm_generic_suspend);

  reply	other threads:[~2010-12-17 14:24 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-16 18:26 platform/i2c busses: pm runtime and system sleep Rabin Vincent
2010-12-17  0:09 ` Rafael J. Wysocki
2011-02-17 15:25   ` Rabin Vincent
2011-02-18  2:48     ` Rabin Vincent
2011-02-18 15:05       ` Alan Stern
2011-02-18 18:28       ` Rafael J. Wysocki
2011-02-18 19:25         ` Rabin Vincent
2011-02-18 20:20           ` Rafael J. Wysocki
2011-02-18 20:27             ` Russell King - ARM Linux
2011-02-18 22:16               ` Mark Brown
2011-02-19  7:24               ` Rabin Vincent
2011-02-19  9:54               ` Linus Walleij
2011-02-19 10:00                 ` Russell King - ARM Linux
2011-02-19 10:16                   ` Linus Walleij
2010-12-17 12:54 ` Mark Brown
2010-12-17 13:25   ` Rafael J. Wysocki
2010-12-17 13:34     ` Mark Brown
2010-12-17 13:49       ` Rafael J. Wysocki
2010-12-17 14:24         ` Mark Brown [this message]
2010-12-17 23:01           ` Rafael J. Wysocki
2010-12-18  1:04             ` Mark Brown
2010-12-18 12:54               ` Rafael J. Wysocki
2010-12-18 13:20                 ` Mark Brown
2010-12-18 14:59                   ` Rafael J. Wysocki
2010-12-20 15:00                     ` Mark Brown
2010-12-20 21:13                       ` Rafael J. Wysocki
2010-12-21 23:51                         ` Mark Brown
2010-12-22  0:35                           ` 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=20101217142402.GA19391@rakim.wolfsonmicro.main \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=rabin@rab.in \
    --cc=rjw@sisk.pl \
    --cc=stern@rowland.harvard.edu \
    /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