Skip to content

Commit 096ea30

Browse files
pascalhuerstWolfram Sang
authored andcommitted
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 <[email protected]> Reviewed-by: Sekhar Nori <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent 7e5cd69 commit 096ea30

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/i2c/busses/i2c-omap.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include <linux/slab.h>
3939
#include <linux/i2c-omap.h>
4040
#include <linux/pm_runtime.h>
41+
#include <linux/pinctrl/consumer.h>
4142

4243
/* I2C controller revisions */
4344
#define OMAP_I2C_OMAP1_REV_2 0x20
@@ -1423,6 +1424,8 @@ static int omap_i2c_runtime_suspend(struct device *dev)
14231424
omap_i2c_read_reg(_dev, OMAP_I2C_STAT_REG);
14241425
}
14251426

1427+
pinctrl_pm_select_sleep_state(dev);
1428+
14261429
return 0;
14271430
}
14281431

@@ -1431,6 +1434,8 @@ static int omap_i2c_runtime_resume(struct device *dev)
14311434
struct platform_device *pdev = to_platform_device(dev);
14321435
struct omap_i2c_dev *_dev = platform_get_drvdata(pdev);
14331436

1437+
pinctrl_pm_select_default_state(dev);
1438+
14341439
if (!_dev->regs)
14351440
return 0;
14361441

0 commit comments

Comments
 (0)