summaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorPascal Huerst <pascal.huerst@gmail.com>2015-05-06 15:07:04 +0200
committerWolfram Sang <wsa@the-dreams.de>2015-05-12 17:46:26 +0200
commit096ea30c91b521c77964ee8c214f7ce3b9d08e7b (patch)
treeb11971048af504cfbdb22accc9f87a559dfcbd5f /drivers/i2c
parent7e5cd69a9152c70985ebf820e357da59dfa8f152 (diff)
downloadop-kernel-dev-096ea30c91b521c77964ee8c214f7ce3b9d08e7b.zip
op-kernel-dev-096ea30c91b521c77964ee8c214f7ce3b9d08e7b.tar.gz
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: Pascal Huerst <pascal.huerst@gmail.com> Reviewed-by: Sekhar Nori <nsekhar@ti.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-omap.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index 0e89419..8261941 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -38,6 +38,7 @@
#include <linux/slab.h>
#include <linux/i2c-omap.h>
#include <linux/pm_runtime.h>
+#include <linux/pinctrl/consumer.h>
/* I2C controller revisions */
#define OMAP_I2C_OMAP1_REV_2 0x20
@@ -1423,6 +1424,8 @@ static int omap_i2c_runtime_suspend(struct device *dev)
omap_i2c_read_reg(_dev, OMAP_I2C_STAT_REG);
}
+ pinctrl_pm_select_sleep_state(dev);
+
return 0;
}
@@ -1431,6 +1434,8 @@ static int omap_i2c_runtime_resume(struct device *dev)
struct platform_device *pdev = to_platform_device(dev);
struct omap_i2c_dev *_dev = platform_get_drvdata(pdev);
+ pinctrl_pm_select_default_state(dev);
+
if (!_dev->regs)
return 0;
OpenPOWER on IntegriCloud