linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4] i2c: omap: Add calls for pinctrl state select
@ 2015-05-06 13:07 pascal.huerst
       [not found] ` <1430917624-18164-1-git-send-email-pascal.huerst-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: pascal.huerst @ 2015-05-06 13:07 UTC (permalink / raw)
  To: wsa; +Cc: tony, linux-omap, linux-i2c, nsekhar, Pascal Huerst

From: Pascal Huerst <pascal.huerst@gmail.com>

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>
---
 drivers/i2c/busses/i2c-omap.c | 5 +++++
 1 file changed, 5 insertions(+)

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;

--
2.1.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v4] i2c: omap: Add calls for pinctrl state select
       [not found] ` <1430917624-18164-1-git-send-email-pascal.huerst-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2015-05-12 15:47   ` wsa-z923LK4zBo2bacvFa/9K2g
       [not found]     ` <20150512154737.GA4448-oo5tB6JMkjKRinMKxDlMNPwbnWRJjS81@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: wsa-z923LK4zBo2bacvFa/9K2g @ 2015-05-12 15:47 UTC (permalink / raw)
  To: pascal.huerst-Re5JQEeQqe8AvxtiuMwx3w
  Cc: tony-4v6yS6AI5VpBDgjK7y7TUQ, linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA, nsekhar-l0cyMroinI0

[-- Attachment #1: Type: text/plain, Size: 709 bytes --]

On Wed, May 06, 2015 at 03:07:04PM +0200, pascal.huerst-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:
> From: Pascal Huerst <pascal.huerst-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> 
> 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-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Reviewed-by: Sekhar Nori <nsekhar-l0cyMroinI0@public.gmane.org>

Applied to for-next, thanks!

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


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v4] i2c: omap: Add calls for pinctrl state select
       [not found]     ` <20150512154737.GA4448-oo5tB6JMkjKRinMKxDlMNPwbnWRJjS81@public.gmane.org>
@ 2015-05-12 16:07       ` Wolfram Sang
  0 siblings, 0 replies; 3+ messages in thread
From: Wolfram Sang @ 2015-05-12 16:07 UTC (permalink / raw)
  To: pascal.huerst-Re5JQEeQqe8AvxtiuMwx3w
  Cc: tony-4v6yS6AI5VpBDgjK7y7TUQ, linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA, nsekhar-l0cyMroinI0

[-- Attachment #1: Type: text/plain, Size: 164 bytes --]

> 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 :)


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-05-12 16:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-06 13:07 [PATCH v4] i2c: omap: Add calls for pinctrl state select pascal.huerst
     [not found] ` <1430917624-18164-1-git-send-email-pascal.huerst-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-05-12 15:47   ` wsa-z923LK4zBo2bacvFa/9K2g
     [not found]     ` <20150512154737.GA4448-oo5tB6JMkjKRinMKxDlMNPwbnWRJjS81@public.gmane.org>
2015-05-12 16:07       ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).