Serial: imx: add dev_pm_ops to support suspend to ram/disk
authorShenwei Wang <shenwei.wang@freescale.com>
Thu, 30 Jul 2015 15:32:36 +0000 (10:32 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 3 Aug 2015 22:51:19 +0000 (15:51 -0700)
commit90bb6bd385638f37d30dcc7342a62aff80089def
tree6efbae097041cbe6a33ebe6ab8ee281acd8f1704
parente70e69bf205e6d1f742f1cf1935b155417c9e29a
Serial: imx: add dev_pm_ops to support suspend to ram/disk

When system goes into low power states like SUSPEND_MEM and
HIBERNATION, the hardware IP block may be powered off to reduce
the power consumption. This power down may cause problems on
some imx platforms, because the hardware settings are reset to
its power on default values which may differ from the ones when
it power off. This patch added the dev_pm_ops and implemented
two callbacks: suspend_noirq and resume_noirq, which will save
the necessory hardware parameters right before power down and
recover them before system uses the hardware.

Because added the dev_pm_ops, the old suspend/resume callbacks
under platform_driver will not be called any more. Changed their
prototypes and moved those two callbacks into dev_pm_ops too.

Signed-off-by: Shenwei Wang <shenwei.wang@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/imx.c