diff options
author | Gao Pan <pandy.gao@nxp.com> | 2017-01-04 15:13:29 +0800 |
---|---|---|
committer | Jason Liu <jason.hui.liu@nxp.com> | 2019-02-12 10:25:41 +0800 |
commit | 11319f92cc3125be995ea6315171941b6acc6d8b (patch) | |
tree | b2f8254344538ab4948e01082d2c6892d049c110 /drivers/spi | |
parent | 4fff1f51e0e156710745be1b1905c263aa725acf (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 | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/spi/spi-fsl-lpspi.c b/drivers/spi/spi-fsl-lpspi.c index cb3c73007ca1..6fa75e4b7849 100644 --- a/drivers/spi/spi-fsl-lpspi.c +++ b/drivers/spi/spi-fsl-lpspi.c @@ -510,10 +510,30 @@ 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, + .pm = IMX_LPSPI_PM, }, .probe = fsl_lpspi_probe, .remove = fsl_lpspi_remove, |