Skip to contentSkip to conversation

i2c: omap: Add calls for pinctrl state select

PATCH Applied [email protected] 2 participants 3 messages May 6, 2015 – May 12, 2015 2 messages not in the archive

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 i2c: omap: Add calls for pinctrl state select

From: Pascal Huerst <[email protected]>

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.

---
 drivers/i2c/busses/i2c-omap.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/i2c/busses/i2c-omap.c +5 -0
index 0e89419..8261941 100644
@@ -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;
 

--
2.1.0

A message that is not in the archive (sent off-list or not yet received): 1430917624-18164-1-git-send-email-pascal.huerst-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#2 lore raw
Quoted 10 lines · On Wed, May 06, 2015 at 03:07:04PM +0200…

From: Pascal Huerst <[email protected]>

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.

Applied to for-next, thanks!

The mail header does not contain your full name, you might want to fix that...

A message that is not in the archive (sent off-list or not yet received): 20150512154737.GA4448-oo5tB6JMkjKRinMKxDlMNPwbnWRJjS81@public.gmane.org

#4 lore raw
Quoted 2 lines

The mail header does not contain your full name, you might want to fix that...

Life is great! I just had the same flaw on my newly set up secondary laptop :)