[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201012181354.58077.rjw@sisk.pl>
Date: Sat, 18 Dec 2010 13:54:57 +0100
From: "Rafael J. Wysocki" <rjw@...k.pl>
To: Mark Brown <broonie@...nsource.wolfsonmicro.com>
Cc: Rabin Vincent <rabin@....in>, stern@...land.harvard.edu,
linux-pm@...ts.linux-foundation.org, linux-i2c@...r.kernel.org,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: platform/i2c busses: pm runtime and system sleep
On Saturday, December 18, 2010, Mark Brown wrote:
> On Sat, Dec 18, 2010 at 12:01:25AM +0100, Rafael J. Wysocki wrote:
> > On Friday, December 17, 2010, Mark Brown wrote:
>
> > > 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.
>
> > No, the legacy is i2c-specific.
>
> SPI and platform (the first two buses I looked at) both seem to have
> legacy suspend operations too? Clearly the bus would need to provide an
> op to invoke the legacy call but the logic which prioritises the pm_ops
> over the legacy operation is generic.
Well, the problem with that is the driver would need to tell the generic call
what the legacy routine is and there's no, er, generic way to do that.
In the i2c case, for example, there is struct i2c_driver that contains the
->suspend() and ->resume() pointers, so the bus type driver _knows_ how to
get there, but the PM core doesn't have this information.
Thanks,
Rafael
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists