[PATCH 1/2] powerpc/mpc85xx: add two functions to get suspend state which is standby or mem

Scott Wood scottwood at freescale.com
Tue Apr 15 09:27:11 EST 2014


On Mon, 2014-04-14 at 10:24 +0800, Dongsheng Wang wrote:
> From: Wang Dongsheng <dongsheng.wang at freescale.com>
> 
> Add set_pm_suspend_state & pm_suspend_state functions to set/get suspend state.
> When system going to sleep, devices can get the system suspend state(STANDBY/MEM)
> through pm_suspend_state function and handle different situations.
> 
> Signed-off-by: Wang Dongsheng <dongsheng.wang at freescale.com>
> 
> diff --git a/arch/powerpc/platforms/85xx/common.c b/arch/powerpc/platforms/85xx/common.c
> index b564b5e..3853d43 100644
> --- a/arch/powerpc/platforms/85xx/common.c
> +++ b/arch/powerpc/platforms/85xx/common.c
> @@ -8,6 +8,7 @@
>  
>  #include <linux/of_irq.h>
>  #include <linux/of_platform.h>
> +#include <linux/suspend.h>
>  
>  #include <asm/qe.h>
>  #include <sysdev/cpm2_pic.h>
> @@ -47,6 +48,19 @@ int __init mpc85xx_common_publish_devices(void)
>  {
>  	return of_platform_bus_probe(NULL, mpc85xx_common_ids, NULL);
>  }
> +
> +static suspend_state_t pm_state;
> +
> +void set_pm_suspend_state(suspend_state_t state)
> +{
> +	pm_state = state;
> +}
> +
> +suspend_state_t pm_suspend_state(void)
> +{
> +	return pm_state;
> +}

These need to be namespaced to indicate that they apply only to mpc85xx.
Where do you plan on using these from, that mpc85xx can be safely
assumed?

This seems like a feature that should be implemented in generic code
instead.

-Scott




More information about the Linuxppc-dev mailing list