From 739683b48d088bd7dcf91bcd255d7340bb76ccbd Mon Sep 17 00:00:00 2001 From: Mugunthan V N Date: Thu, 6 Jun 2013 23:45:14 +0530 Subject: drivers: net: cpsw: use pinctrl PM helpers This utilize the new pinctrl core PM helpers to transition the driver to "default" and "sleep" states. Signed-off-by: Mugunthan V N Acked-by: David S. Miller Signed-off-by: Linus Walleij --- drivers/net/ethernet/ti/cpsw.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'drivers/net') diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index 21a5b291b4b3..807b0e874cf2 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -35,6 +35,7 @@ #include #include +#include #include "cpsw_ale.h" #include "cpts.h" @@ -1689,6 +1690,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; @@ -1978,6 +1982,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; } @@ -1987,6 +1994,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; -- cgit v1.2.3-58-ga151 From 5c0e3580cb988cf4688070d2d7ac56cf83fc6959 Mon Sep 17 00:00:00 2001 From: Mugunthan V N Date: Thu, 6 Jun 2013 23:45:15 +0530 Subject: drivers: net: davinci_mdio: use pinctrl PM helpers This utilize the new pinctrl core PM helpers to transition the driver to "default" and "sleep" states. Signed-off-by: Mugunthan V N Acked-by: David S. Miller Signed-off-by: Linus Walleij --- drivers/net/ethernet/ti/davinci_mdio.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'drivers/net') diff --git a/drivers/net/ethernet/ti/davinci_mdio.c b/drivers/net/ethernet/ti/davinci_mdio.c index 12aec173564c..5e361f411ea4 100644 --- a/drivers/net/ethernet/ti/davinci_mdio.c +++ b/drivers/net/ethernet/ti/davinci_mdio.c @@ -38,6 +38,7 @@ #include #include #include +#include /* * 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); -- cgit v1.2.3-58-ga151