* [Patch V3] i2c: imx-lpi2c: add VLLS mode support
@ 2017-01-17 10:20 Gao Pan
2017-01-17 21:04 ` Vladimir Zapolskiy
2017-01-25 20:53 ` Wolfram Sang
0 siblings, 2 replies; 4+ messages in thread
From: Gao Pan @ 2017-01-17 10:20 UTC (permalink / raw)
To: wsa, wsa-dev, vz; +Cc: linux-i2c, pandy.gao, frank.li
When system enters VLLS mode, module power is turned off. As a result,
all registers are reset to HW default value. After exiting VLLS mode,
registers are still in default mode. As a result, the pinctrl settings
are incorrect, which will affect the module function.
The patch recovers the pinctrl setting when exit VLLS mode.
Signed-off-by: Gao Pan <pandy.gao@nxp.com>
---
V2:
-drop "#else branch" and IMX_LPI2C_PM completely
-pm = &imx_lpi2c_pm
V3:
-remove unnecessary #ifdef
drivers/i2c/busses/i2c-imx-lpi2c.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/drivers/i2c/busses/i2c-imx-lpi2c.c b/drivers/i2c/busses/i2c-imx-lpi2c.c
index c62b7cd..5a85c49 100644
--- a/drivers/i2c/busses/i2c-imx-lpi2c.c
+++ b/drivers/i2c/busses/i2c-imx-lpi2c.c
@@ -636,12 +636,31 @@ static int lpi2c_imx_remove(struct platform_device *pdev)
return 0;
}
+#ifdef CONFIG_PM_SLEEP
+static int lpi2c_imx_suspend(struct device *dev)
+{
+ pinctrl_pm_select_sleep_state(dev);
+
+ return 0;
+}
+
+static int lpi2c_imx_resume(struct device *dev)
+{
+ pinctrl_pm_select_default_state(dev);
+
+ return 0;
+}
+#endif
+
+static SIMPLE_DEV_PM_OPS(imx_lpi2c_pm, lpi2c_imx_suspend, lpi2c_imx_resume);
+
static struct platform_driver lpi2c_imx_driver = {
.probe = lpi2c_imx_probe,
.remove = lpi2c_imx_remove,
.driver = {
.name = DRIVER_NAME,
.of_match_table = lpi2c_imx_of_match,
+ .pm = &imx_lpi2c_pm,
},
};
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [Patch V3] i2c: imx-lpi2c: add VLLS mode support
2017-01-17 10:20 [Patch V3] i2c: imx-lpi2c: add VLLS mode support Gao Pan
@ 2017-01-17 21:04 ` Vladimir Zapolskiy
2017-01-25 20:53 ` Wolfram Sang
1 sibling, 0 replies; 4+ messages in thread
From: Vladimir Zapolskiy @ 2017-01-17 21:04 UTC (permalink / raw)
To: Gao Pan, wsa, wsa-dev; +Cc: linux-i2c, frank.li
On 01/17/2017 12:20 PM, Gao Pan wrote:
> When system enters VLLS mode, module power is turned off. As a result,
> all registers are reset to HW default value. After exiting VLLS mode,
> registers are still in default mode. As a result, the pinctrl settings
> are incorrect, which will affect the module function.
>
> The patch recovers the pinctrl setting when exit VLLS mode.
>
> Signed-off-by: Gao Pan <pandy.gao@nxp.com>
> ---
> V2:
> -drop "#else branch" and IMX_LPI2C_PM completely
> -pm = &imx_lpi2c_pm
>
> V3:
> -remove unnecessary #ifdef
>
The change looks good, thank you for updates.
Reviewed-by: Vladimir Zapolskiy <vz@mleia.com>
--
With best wishes,
Vladimir
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Patch V3] i2c: imx-lpi2c: add VLLS mode support
2017-01-17 10:20 [Patch V3] i2c: imx-lpi2c: add VLLS mode support Gao Pan
2017-01-17 21:04 ` Vladimir Zapolskiy
@ 2017-01-25 20:53 ` Wolfram Sang
2017-01-25 21:10 ` Wolfram Sang
1 sibling, 1 reply; 4+ messages in thread
From: Wolfram Sang @ 2017-01-25 20:53 UTC (permalink / raw)
To: Gao Pan; +Cc: wsa-dev, vz, linux-i2c, frank.li
[-- Attachment #1: Type: text/plain, Size: 487 bytes --]
On Tue, Jan 17, 2017 at 06:20:55PM +0800, Gao Pan wrote:
> When system enters VLLS mode, module power is turned off. As a result,
> all registers are reset to HW default value. After exiting VLLS mode,
> registers are still in default mode. As a result, the pinctrl settings
> are incorrect, which will affect the module function.
>
> The patch recovers the pinctrl setting when exit VLLS mode.
>
> Signed-off-by: Gao Pan <pandy.gao@nxp.com>
Applied to for-next, thanks!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Patch V3] i2c: imx-lpi2c: add VLLS mode support
2017-01-25 20:53 ` Wolfram Sang
@ 2017-01-25 21:10 ` Wolfram Sang
0 siblings, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2017-01-25 21:10 UTC (permalink / raw)
To: Gao Pan; +Cc: wsa-dev, vz, linux-i2c, frank.li
[-- Attachment #1: Type: text/plain, Size: 624 bytes --]
On Wed, Jan 25, 2017 at 09:53:06PM +0100, Wolfram Sang wrote:
> On Tue, Jan 17, 2017 at 06:20:55PM +0800, Gao Pan wrote:
> > When system enters VLLS mode, module power is turned off. As a result,
> > all registers are reset to HW default value. After exiting VLLS mode,
> > registers are still in default mode. As a result, the pinctrl settings
> > are incorrect, which will affect the module function.
> >
> > The patch recovers the pinctrl setting when exit VLLS mode.
> >
> > Signed-off-by: Gao Pan <pandy.gao@nxp.com>
>
> Applied to for-next, thanks!
Reconsidered and applied to for-current instead.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-01-25 21:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-17 10:20 [Patch V3] i2c: imx-lpi2c: add VLLS mode support Gao Pan
2017-01-17 21:04 ` Vladimir Zapolskiy
2017-01-25 20:53 ` Wolfram Sang
2017-01-25 21:10 ` 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).