Commit 096ea30c authored by Pascal Huerst's avatar Pascal Huerst Committed by Wolfram Sang

i2c: omap: Add calls for pinctrl state select

This adds calls to pinctrl subsystem in order to switch pin states
on suspend/resume if you provide a "sleep" state in DT.

If no "sleep" state is provided in the DT, these calls turn
to NOPs, so we don't need error checking here.
Signed-off-by: default avatarPascal Huerst <pascal.huerst@gmail.com>
Reviewed-by: default avatarSekhar Nori <nsekhar@ti.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent 7e5cd69a
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/i2c-omap.h> #include <linux/i2c-omap.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/pinctrl/consumer.h>
/* I2C controller revisions */ /* I2C controller revisions */
#define OMAP_I2C_OMAP1_REV_2 0x20 #define OMAP_I2C_OMAP1_REV_2 0x20
...@@ -1423,6 +1424,8 @@ static int omap_i2c_runtime_suspend(struct device *dev) ...@@ -1423,6 +1424,8 @@ static int omap_i2c_runtime_suspend(struct device *dev)
omap_i2c_read_reg(_dev, OMAP_I2C_STAT_REG); omap_i2c_read_reg(_dev, OMAP_I2C_STAT_REG);
} }
pinctrl_pm_select_sleep_state(dev);
return 0; return 0;
} }
...@@ -1431,6 +1434,8 @@ static int omap_i2c_runtime_resume(struct device *dev) ...@@ -1431,6 +1434,8 @@ static int omap_i2c_runtime_resume(struct device *dev)
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
struct omap_i2c_dev *_dev = platform_get_drvdata(pdev); struct omap_i2c_dev *_dev = platform_get_drvdata(pdev);
pinctrl_pm_select_default_state(dev);
if (!_dev->regs) if (!_dev->regs)
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment