diff options
author | Mugunthan V N <mugunthanvnm@ti.com> | 2013-06-06 23:45:14 +0530 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2013-06-16 11:57:32 +0200 |
commit | 739683b48d088bd7dcf91bcd255d7340bb76ccbd (patch) | |
tree | 7de12ad9bc8434c2cc0d2e76c145d4dd7fcd1046 /drivers/net | |
parent | f1c9cf074b6abb4c7cbb163d193470c93cb1ad5b (diff) | |
download | op-kernel-dev-739683b48d088bd7dcf91bcd255d7340bb76ccbd.zip op-kernel-dev-739683b48d088bd7dcf91bcd255d7340bb76ccbd.tar.gz |
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 <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')
-rw-r--r-- | drivers/net/ethernet/ti/cpsw.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index 21a5b29..807b0e8 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" @@ -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; |