diff options
author | Gao Pan <b54642@freescale.com> | 2015-08-25 14:00:32 +0800 |
---|---|---|
committer | Nitin Garg <nitin.garg@freescale.com> | 2015-09-17 09:24:17 -0500 |
commit | d286d1493721ff7da4ff2c091c38337dc2c3463b (patch) | |
tree | 9294e358c1999fba0f0ad5150fb97543152f49f5 /drivers/i2c | |
parent | 6ce4a1a9f4a27629d49060e4b09bab2a2ce938a1 (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 | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index f4f023d6b9f2..3ed8e47785fc 100644 --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c @@ -735,13 +735,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, - .owner = THIS_MODULE, + .name = DRIVER_NAME, + .owner = THIS_MODULE, .of_match_table = i2c_imx_dt_ids, + .pm = IMX_I2C_PM, }, .id_table = imx_i2c_devtype, }; |