summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/ti/davinci_mdio.c
diff options
context:
space:
mode:
authorMugunthan V N <mugunthanvnm@ti.com>2013-06-06 23:45:15 +0530
committerLinus Walleij <linus.walleij@linaro.org>2013-06-16 11:57:32 +0200
commit5c0e3580cb988cf4688070d2d7ac56cf83fc6959 (patch)
treef9c6b9571a381272491169d271801d8b24ff2116 /drivers/net/ethernet/ti/davinci_mdio.c
parent739683b48d088bd7dcf91bcd255d7340bb76ccbd (diff)
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 <mugunthanvnm@ti.com> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/net/ethernet/ti/davinci_mdio.c')
-rw-r--r--drivers/net/ethernet/ti/davinci_mdio.c10
1 files changed, 10 insertions, 0 deletions
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 <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);