diff options
author | Gao Pan <b54642@freescale.com> | 2015-08-25 14:00:32 +0800 |
---|---|---|
committer | Nitin Garg <nitin.garg@nxp.com> | 2016-01-14 11:02:08 -0600 |
commit | 740855765ff913945dc7d7c02c14d371e25b6b0a (patch) | |
tree | 5eb0e7097092a2156ab7b6e4fc3d00375878b043 /drivers/i2c | |
parent | 6dc41b12252e1e5731be2542d032464a645183ee (diff) |
MLK-11403: I2C: imx: restore pin setting for i2c
restore pin setting for i2c in suspend/resume
Signed-off-by: Gao Pan <gaopan@freescale.com>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-imx.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index fcc63781e854..97dd038f1222 100644 --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c @@ -1096,12 +1096,33 @@ static int i2c_imx_remove(struct platform_device *pdev) return 0; } +#ifdef CONFIG_PM_SLEEP +static int i2c_imx_suspend(struct device *dev) +{ + pinctrl_pm_select_sleep_state(dev); + return 0; +} + +static int i2c_imx_resume(struct device *dev) +{ + pinctrl_pm_select_default_state(dev); + return 0; +} + +static SIMPLE_DEV_PM_OPS(imx_i2c_pm, i2c_imx_suspend, i2c_imx_resume); +#define IMX_I2C_PM (&imx_i2c_pm) +#else +#define IMX_I2C_PM NULL +#endif + static struct platform_driver i2c_imx_driver = { .probe = i2c_imx_probe, .remove = i2c_imx_remove, .driver = { - .name = DRIVER_NAME, + .name = DRIVER_NAME, + .owner = THIS_MODULE, .of_match_table = i2c_imx_dt_ids, + .pm = IMX_I2C_PM, }, .id_table = imx_i2c_devtype, }; |