netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Adding pinctrl PM support for CPSW and Davinci MDIO
@ 2013-06-06 18:15 Mugunthan V N
  2013-06-06 18:15 ` [PATCH 1/2] drivers: net: cpsw: use pinctrl PM helpers Mugunthan V N
  2013-06-06 18:15 ` [PATCH 2/2] drivers: net: davinci_mdio: " Mugunthan V N
  0 siblings, 2 replies; 5+ messages in thread
From: Mugunthan V N @ 2013-06-06 18:15 UTC (permalink / raw)
  To: netdev
  Cc: davem, linus.walleij, broonie, linux-arm-kernel, linux-omap,
	Mugunthan V N

* Adding pinctrl PM support for CPSW and MDIO for Power Optimization
* Adopted to the new pinctrl core PM helpers added by Linus Walleij in 
  http://marc.info/?l=linux-arm-kernel&m=137044113914184&w=2. This change
  was suggested by Mark Brown in my another patch series posted for CPSW
  and MDIO pinctrl.

David Miller:
  As this patch is based on the patch from Linus Walleij's patch
  "drivers: pinctrl sleep and idle states in the core", can you ACK this
  patch series so that Linus Walleij can take this patch via pinctrl tree.

Mugunthan V N (2):
  drivers: net: cpsw: use pinctrl PM helpers
  drivers: net: davinci_mdio: use pinctrl PM helpers

 drivers/net/ethernet/ti/cpsw.c         |   11 +++++++++++
 drivers/net/ethernet/ti/davinci_mdio.c |   10 ++++++++++
 2 files changed, 21 insertions(+)

-- 
1.7.9.5

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

* [PATCH 1/2] drivers: net: cpsw: use pinctrl PM helpers
  2013-06-06 18:15 [PATCH 0/2] Adding pinctrl PM support for CPSW and Davinci MDIO Mugunthan V N
@ 2013-06-06 18:15 ` Mugunthan V N
  2013-06-10 15:51   ` Linus Walleij
  2013-06-06 18:15 ` [PATCH 2/2] drivers: net: davinci_mdio: " Mugunthan V N
  1 sibling, 1 reply; 5+ messages in thread
From: Mugunthan V N @ 2013-06-06 18:15 UTC (permalink / raw)
  To: netdev
  Cc: davem, linus.walleij, broonie, linux-arm-kernel, linux-omap,
	Mugunthan V N

This utilize the new pinctrl core PM helpers to transition
the driver to "default" and "sleep" states.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
---
 drivers/net/ethernet/ti/cpsw.c |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index a45f64e..5143552 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -35,6 +35,7 @@
 #include <linux/if_vlan.h>
 
 #include <linux/platform_data/cpsw.h>
+#include <linux/pinctrl/consumer.h>
 
 #include "cpsw_ale.h"
 #include "cpts.h"
@@ -1691,6 +1692,9 @@ static int cpsw_probe(struct platform_device *pdev)
 	 */
 	pm_runtime_enable(&pdev->dev);
 
+	/* Select default pin state */
+	pinctrl_pm_select_default_state(&pdev->dev);
+
 	if (cpsw_probe_dt(&priv->data, pdev)) {
 		pr_err("cpsw: platform data missing\n");
 		ret = -ENODEV;
@@ -1979,6 +1983,9 @@ static int cpsw_suspend(struct device *dev)
 		cpsw_ndo_stop(ndev);
 	pm_runtime_put_sync(&pdev->dev);
 
+	/* Select sleep pin state */
+	pinctrl_pm_select_sleep_state(&pdev->dev);
+
 	return 0;
 }
 
@@ -1988,6 +1995,10 @@ static int cpsw_resume(struct device *dev)
 	struct net_device	*ndev = platform_get_drvdata(pdev);
 
 	pm_runtime_get_sync(&pdev->dev);
+
+	/* Select default pin state */
+	pinctrl_pm_select_default_state(&pdev->dev);
+
 	if (netif_running(ndev))
 		cpsw_ndo_open(ndev);
 	return 0;
-- 
1.7.9.5


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

* [PATCH 2/2] drivers: net: davinci_mdio: use pinctrl PM helpers
  2013-06-06 18:15 [PATCH 0/2] Adding pinctrl PM support for CPSW and Davinci MDIO Mugunthan V N
  2013-06-06 18:15 ` [PATCH 1/2] drivers: net: cpsw: use pinctrl PM helpers Mugunthan V N
@ 2013-06-06 18:15 ` Mugunthan V N
  2013-06-10 15:52   ` Linus Walleij
  1 sibling, 1 reply; 5+ messages in thread
From: Mugunthan V N @ 2013-06-06 18:15 UTC (permalink / raw)
  To: netdev
  Cc: davem, linus.walleij, broonie, linux-arm-kernel, linux-omap,
	Mugunthan V N

This utilize the new pinctrl core PM helpers to transition
the driver to "default" and "sleep" states.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
---
 drivers/net/ethernet/ti/davinci_mdio.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/net/ethernet/ti/davinci_mdio.c b/drivers/net/ethernet/ti/davinci_mdio.c
index 12aec17..5e361f4 100644
--- a/drivers/net/ethernet/ti/davinci_mdio.c
+++ b/drivers/net/ethernet/ti/davinci_mdio.c
@@ -38,6 +38,7 @@
 #include <linux/davinci_emac.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
+#include <linux/pinctrl/consumer.h>
 
 /*
  * This timeout definition is a worst-case ultra defensive measure against
@@ -347,6 +348,9 @@ static int davinci_mdio_probe(struct platform_device *pdev)
 	data->bus->parent	= dev;
 	data->bus->priv		= data;
 
+	/* Select default pin state */
+	pinctrl_pm_select_default_state(&pdev->dev);
+
 	pm_runtime_enable(&pdev->dev);
 	pm_runtime_get_sync(&pdev->dev);
 	data->clk = clk_get(&pdev->dev, "fck");
@@ -454,6 +458,9 @@ static int davinci_mdio_suspend(struct device *dev)
 	data->suspended = true;
 	spin_unlock(&data->lock);
 
+	/* Select sleep pin state */
+	pinctrl_pm_select_sleep_state(dev);
+
 	return 0;
 }
 
@@ -462,6 +469,9 @@ static int davinci_mdio_resume(struct device *dev)
 	struct davinci_mdio_data *data = dev_get_drvdata(dev);
 	u32 ctrl;
 
+	/* Select default pin state */
+	pinctrl_pm_select_default_state(dev);
+
 	spin_lock(&data->lock);
 	pm_runtime_get_sync(data->dev);
 
-- 
1.7.9.5


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

* Re: [PATCH 1/2] drivers: net: cpsw: use pinctrl PM helpers
  2013-06-06 18:15 ` [PATCH 1/2] drivers: net: cpsw: use pinctrl PM helpers Mugunthan V N
@ 2013-06-10 15:51   ` Linus Walleij
  0 siblings, 0 replies; 5+ messages in thread
From: Linus Walleij @ 2013-06-10 15:51 UTC (permalink / raw)
  To: Mugunthan V N
  Cc: netdev, David S. Miller, Mark Brown, linux-arm-kernel, Linux-OMAP

On Thu, Jun 6, 2013 at 8:15 PM, Mugunthan V N <mugunthanvnm@ti.com> wrote:

> This utilize the new pinctrl core PM helpers to transition
> the driver to "default" and "sleep" states.
>
> Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>

This version of the patch applied with DaveM:s ACK.

Yours,
Linus Walleij

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

* Re: [PATCH 2/2] drivers: net: davinci_mdio: use pinctrl PM helpers
  2013-06-06 18:15 ` [PATCH 2/2] drivers: net: davinci_mdio: " Mugunthan V N
@ 2013-06-10 15:52   ` Linus Walleij
  0 siblings, 0 replies; 5+ messages in thread
From: Linus Walleij @ 2013-06-10 15:52 UTC (permalink / raw)
  To: Mugunthan V N
  Cc: netdev, David S. Miller, Mark Brown, linux-arm-kernel, Linux-OMAP

On Thu, Jun 6, 2013 at 8:15 PM, Mugunthan V N <mugunthanvnm@ti.com> wrote:

> This utilize the new pinctrl core PM helpers to transition
> the driver to "default" and "sleep" states.
>
> Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>

This version of the patch applied with DaveM:s ACK.

Yours,
Linus Walleij

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

end of thread, other threads:[~2013-06-10 15:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-06 18:15 [PATCH 0/2] Adding pinctrl PM support for CPSW and Davinci MDIO Mugunthan V N
2013-06-06 18:15 ` [PATCH 1/2] drivers: net: cpsw: use pinctrl PM helpers Mugunthan V N
2013-06-10 15:51   ` Linus Walleij
2013-06-06 18:15 ` [PATCH 2/2] drivers: net: davinci_mdio: " Mugunthan V N
2013-06-10 15:52   ` Linus Walleij

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