diff options
author | Fabio Estevam <fabio.estevam@freescale.com> | 2013-05-27 03:48:33 +0000 |
---|---|---|
committer | Jason Liu <r64343@freescale.com> | 2013-08-23 07:30:03 +0800 |
commit | b64e5cbb7bfda1670b6495588657148b970d0881 (patch) | |
tree | f4400f8cc87e50eb8f5aa9a61b2197eec53cc378 /drivers | |
parent | d237ba13cc95ff99ab5e1b54d91104a6cb4e4882 (diff) |
fec: Handle the regulator in suspend/resume
In order to save power, let's disable the regulator in the suspend function and
enable it in resume.
Tested on a mx28evk board.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/freescale/fec_main.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index ec57f3a29a4b..498882083c05 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -2070,6 +2070,9 @@ fec_suspend(struct device *dev) clk_disable_unprepare(fep->clk_ahb); clk_disable_unprepare(fep->clk_ipg); + if (fep->reg_phy) + regulator_disable(fep->reg_phy); + return 0; } @@ -2078,6 +2081,13 @@ fec_resume(struct device *dev) { struct net_device *ndev = dev_get_drvdata(dev); struct fec_enet_private *fep = netdev_priv(ndev); + int ret; + + if (fep->reg_phy) { + ret = regulator_enable(fep->reg_phy); + if (ret) + return ret; + } clk_prepare_enable(fep->clk_enet_out); clk_prepare_enable(fep->clk_ahb); |