[PATCH 2/2] powerpc: Add power management support to VIO bus
Michael Ellerman
michael at ellerman.id.au
Mon May 10 12:35:06 EST 2010
On Fri, 2010-05-07 at 13:58 -0500, Brian King wrote:
> Adds support for suspend/resume for VIO devices. This is needed for
> support for HMC initiated hibernation.
>
> Signed-off-by: Brian King <brking at linux.vnet.ibm.com>
> ---
>
> arch/powerpc/kernel/vio.c | 24 ++++++++++++++++++++++++
> 1 file changed, 24 insertions(+)
>
> diff -puN arch/powerpc/kernel/vio.c~powerpc_vio_bus_pm arch/powerpc/kernel/vio.c
> --- linux-2.6/arch/powerpc/kernel/vio.c~powerpc_vio_bus_pm 2010-05-07 13:49:16.000000000 -0500
> +++ linux-2.6-bjking1/arch/powerpc/kernel/vio.c 2010-05-07 13:49:16.000000000 -0500
> @@ -1358,6 +1358,29 @@ static int vio_hotplug(struct device *de
> return 0;
> }
>
> +static int vio_pm_suspend(struct device *dev)
> +{
> + const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
> +
> + if (pm && pm->suspend)
> + return pm->suspend(dev);
> + return 0;
> +}
> +
> +static int vio_pm_resume(struct device *dev)
> +{
> + const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
> +
> + if (pm && pm->resume)
> + return pm->resume(dev);
> + return 0;
> +}
> +
> +const struct dev_pm_ops vio_dev_pm_ops = {
> + .suspend = vio_pm_suspend,
> + .resume = vio_pm_resume,
> +};
That just looks like boiler plate, is there not a generic version
somewhere?
cheers
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20100510/cca77d18/attachment.pgp>
More information about the Linuxppc-dev
mailing list