Messages in this thread | | | Date | Wed, 9 Jan 2019 15:14:17 +0100 | From | Pavel Machek <> | Subject | Re: [PATCH v2 1/3] PM / Suspend: Add support to check if platform's power is off in suspend |
| |
Hi!
> Add support to check if platform's power will be cut off in suspend. > This will help drivers shared by multiple platforms to take only the > necessary actions while suspending/resuming (some platform may not need > to save/restore all the registers if platforms remains powered while > suspended). In this way suspend/resume time could be improved. > > Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> > --- > include/linux/suspend.h | 6 ++++++ > kernel/power/suspend.c | 13 +++++++++++++ > 2 files changed, 19 insertions(+) > > diff --git a/include/linux/suspend.h b/include/linux/suspend.h > index 3f529ad9a9d2..21f19b167fe2 100644 > --- a/include/linux/suspend.h > +++ b/include/linux/suspend.h > @@ -173,6 +173,9 @@ static inline void dpm_save_failed_step(enum suspend_stat_step step) > * Called by the PM core if the suspending of devices fails. > * This callback is optional and should only be implemented by platforms > * which require special recovery actions in that situation. > + * > + * @off_in_suspend: Returns wether the platform's power will be cut off at
wether -- spelling?
> @@ -185,6 +188,7 @@ struct platform_suspend_ops { > bool (*suspend_again)(void); > void (*end)(void); > void (*recover)(void); > + bool (*off_in_suspend)(suspend_state_t state); > };
Dunno, should it be per-regulator? SoCs commonly have more than one power supply, with some of them off during suspend... Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html [unhandled content-type:application/pgp-signature] | |