diff options
author | Mugunthan V N <mugunthanvnm@ti.com> | 2013-06-06 14:15:14 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2013-06-16 05:57:32 -0400 |
commit | 739683b48d088bd7dcf91bcd255d7340bb76ccbd (patch) | |
tree | 7de12ad9bc8434c2cc0d2e76c145d4dd7fcd1046 /drivers/net | |
parent | f1c9cf074b6abb4c7cbb163d193470c93cb1ad5b (diff) |
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 21a5b291b4b3..807b0e874cf2 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include <linux/if_vlan.h> | 35 | #include <linux/if_vlan.h> |
36 | 36 | ||
37 | #include <linux/platform_data/cpsw.h> | 37 | #include <linux/platform_data/cpsw.h> |
38 | #include <linux/pinctrl/consumer.h> | ||
38 | 39 | ||
39 | #include "cpsw_ale.h" | 40 | #include "cpsw_ale.h" |
40 | #include "cpts.h" | 41 | #include "cpts.h" |
@@ -1689,6 +1690,9 @@ static int cpsw_probe(struct platform_device *pdev) | |||
1689 | */ | 1690 | */ |
1690 | pm_runtime_enable(&pdev->dev); | 1691 | pm_runtime_enable(&pdev->dev); |
1691 | 1692 | ||
1693 | /* Select default pin state */ | ||
1694 | pinctrl_pm_select_default_state(&pdev->dev); | ||
1695 | |||
1692 | if (cpsw_probe_dt(&priv->data, pdev)) { | 1696 | if (cpsw_probe_dt(&priv->data, pdev)) { |
1693 | pr_err("cpsw: platform data missing\n"); | 1697 | pr_err("cpsw: platform data missing\n"); |
1694 | ret = -ENODEV; | 1698 | ret = -ENODEV; |
@@ -1978,6 +1982,9 @@ static int cpsw_suspend(struct device *dev) | |||
1978 | cpsw_ndo_stop(ndev); | 1982 | cpsw_ndo_stop(ndev); |
1979 | pm_runtime_put_sync(&pdev->dev); | 1983 | pm_runtime_put_sync(&pdev->dev); |
1980 | 1984 | ||
1985 | /* Select sleep pin state */ | ||
1986 | pinctrl_pm_select_sleep_state(&pdev->dev); | ||
1987 | |||
1981 | return 0; | 1988 | return 0; |
1982 | } | 1989 | } |
1983 | 1990 | ||
@@ -1987,6 +1994,10 @@ static int cpsw_resume(struct device *dev) | |||
1987 | struct net_device *ndev = platform_get_drvdata(pdev); | 1994 | struct net_device *ndev = platform_get_drvdata(pdev); |
1988 | 1995 | ||
1989 | pm_runtime_get_sync(&pdev->dev); | 1996 | pm_runtime_get_sync(&pdev->dev); |
1997 | |||
1998 | /* Select default pin state */ | ||
1999 | pinctrl_pm_select_default_state(&pdev->dev); | ||
2000 | |||
1990 | if (netif_running(ndev)) | 2001 | if (netif_running(ndev)) |
1991 | cpsw_ndo_open(ndev); | 2002 | cpsw_ndo_open(ndev); |
1992 | return 0; | 2003 | return 0; |