diff options
author | Gao Pan <pandy.gao@nxp.com> | 2017-01-04 15:13:29 +0800 |
---|---|---|
committer | Leonard Crestez <leonard.crestez@nxp.com> | 2018-08-24 12:41:33 +0300 |
commit | 859d12f03a7a887a1aa5d6f55d6573897f524aa0 (patch) | |
tree | 22c07394e5414e953045201367c0309e37e63421 /drivers/spi | |
parent | 68a870688626f7cb89898c57504623c182eb080f (diff) |
MLK-13717-2 spi: imx-lpspi: support for vlls mode
On i.MX7ULP sillicon, system suspend go through VLLS mode that gate
off pinctrl and modules power, then all registers are reset to HW
default value. To support the feature, driver needs to recover all
registers status.
Signed-off-by: Gao Pan <pandy.gao@nxp.com>
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/spi-fsl-lpspi.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/drivers/spi/spi-fsl-lpspi.c b/drivers/spi/spi-fsl-lpspi.c index 9ae55b7d8044..cf79a48da9c4 100644 --- a/drivers/spi/spi-fsl-lpspi.c +++ b/drivers/spi/spi-fsl-lpspi.c @@ -464,11 +464,31 @@ static int fsl_lpspi_remove(struct platform_device *pdev) return 0; } +#ifdef CONFIG_PM_SLEEP +static int fsl_lpspi_suspend(struct device *dev) +{ + pinctrl_pm_select_sleep_state(dev); + return 0; +} + +static int fsl_lpspi_resume(struct device *dev) +{ + pinctrl_pm_select_default_state(dev); + return 0; +} + +static SIMPLE_DEV_PM_OPS(imx_lpspi_pm, fsl_lpspi_suspend, fsl_lpspi_resume); +#define IMX_LPSPI_PM (&imx_lpspi_pm) +#else +#define IMX_LPSPI_PM NULL +#endif + static struct platform_driver fsl_lpspi_driver = { .driver = { - .name = DRIVER_NAME, - .of_match_table = fsl_lpspi_dt_ids, - }, + .name = DRIVER_NAME, + .of_match_table = fsl_lpspi_dt_ids, + .pm = IMX_LPSPI_PM, + }, .probe = fsl_lpspi_probe, .remove = fsl_lpspi_remove, }; |