* [PATCH v3] i2c: omap: Add calls for pinctrl state select
@ 2015-04-28 11:19 pascal.huerst-Re5JQEeQqe8AvxtiuMwx3w
[not found] ` <1430219973-24260-1-git-send-email-pascal.huerst-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: pascal.huerst-Re5JQEeQqe8AvxtiuMwx3w @ 2015-04-28 11:19 UTC (permalink / raw)
To: wsa-z923LK4zBo2bacvFa/9K2g
Cc: tony-4v6yS6AI5VpBDgjK7y7TUQ, linux-omap-u79uwXL29TY76Z2rM5mHXA,
linux-i2c-u79uwXL29TY76Z2rM5mHXA, nsekhar-l0cyMroinI0,
Pascal Huerst
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>
---
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 v3] i2c: omap: Add calls for pinctrl state select
[not found] ` <1430219973-24260-1-git-send-email-pascal.huerst-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2015-05-06 11:17 ` Pascal Huerst
2015-05-06 11:33 ` Sekhar Nori
0 siblings, 1 reply; 3+ messages in thread
From: Pascal Huerst @ 2015-05-06 11:17 UTC (permalink / raw)
To: wsa-z923LK4zBo2bacvFa/9K2g
Cc: tony-4v6yS6AI5VpBDgjK7y7TUQ, linux-omap-u79uwXL29TY76Z2rM5mHXA,
linux-i2c-u79uwXL29TY76Z2rM5mHXA, nsekhar-l0cyMroinI0
Sekhar Nori, any objections on that version?
On 28.04.2015 13:19, 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>
> ---
> 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 [flat|nested] 3+ messages in thread
* Re: [PATCH v3] i2c: omap: Add calls for pinctrl state select
2015-05-06 11:17 ` Pascal Huerst
@ 2015-05-06 11:33 ` Sekhar Nori
0 siblings, 0 replies; 3+ messages in thread
From: Sekhar Nori @ 2015-05-06 11:33 UTC (permalink / raw)
To: Pascal Huerst, wsa; +Cc: tony, linux-omap, linux-i2c
On Wednesday 06 May 2015 04:47 PM, Pascal Huerst wrote:
> Sekhar Nori, any objections on that version?
None. FWIW, you can add:
Reviewed-by: Sekhar Nori <nsekhar@ti.com>
Thanks,
Sekhar
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-05-06 11:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-28 11:19 [PATCH v3] i2c: omap: Add calls for pinctrl state select pascal.huerst-Re5JQEeQqe8AvxtiuMwx3w
[not found] ` <1430219973-24260-1-git-send-email-pascal.huerst-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-05-06 11:17 ` Pascal Huerst
2015-05-06 11:33 ` Sekhar Nori
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).