diff options
author | Ranjith Lohithakshan <ranjithl@ti.com> | 2009-11-05 01:06:20 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-05 01:06:20 -0500 |
commit | 8d044fe6aacaf573112331847155211a56a12736 (patch) | |
tree | 3fcb62e2d1a26d9d628b6e4e8f8b70fd2862db93 /drivers/net/davinci_emac.c | |
parent | 9f9354b92defa15aa0e215946c6e2dbccecb6aa7 (diff) |
TI DaVinci EMAC: Add suspend/resume capability
Add suspend/resume capability to TI DaVinci EMAC driver.
Signed-off-by: Ranjith Lohithakshan <ranjithl@ti.com>
Signed-off-by: Chaithrika U S <chaithrika@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/davinci_emac.c')
-rw-r--r-- | drivers/net/davinci_emac.c | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c index a876dce13b9e..f1b09c0992b4 100644 --- a/drivers/net/davinci_emac.c +++ b/drivers/net/davinci_emac.c | |||
@@ -2806,11 +2806,33 @@ static int __devexit davinci_emac_remove(struct platform_device *pdev) | |||
2806 | return 0; | 2806 | return 0; |
2807 | } | 2807 | } |
2808 | 2808 | ||
2809 | static | ||
2810 | int davinci_emac_suspend(struct platform_device *pdev, pm_message_t state) | ||
2811 | { | ||
2812 | struct net_device *dev = platform_get_drvdata(pdev); | ||
2813 | |||
2814 | if (netif_running(dev)) | ||
2815 | emac_dev_stop(dev); | ||
2816 | |||
2817 | clk_disable(emac_clk); | ||
2818 | |||
2819 | return 0; | ||
2820 | } | ||
2821 | |||
2822 | static int davinci_emac_resume(struct platform_device *pdev) | ||
2823 | { | ||
2824 | struct net_device *dev = platform_get_drvdata(pdev); | ||
2825 | |||
2826 | clk_enable(emac_clk); | ||
2827 | |||
2828 | if (netif_running(dev)) | ||
2829 | emac_dev_open(dev); | ||
2830 | |||
2831 | return 0; | ||
2832 | } | ||
2833 | |||
2809 | /** | 2834 | /** |
2810 | * davinci_emac_driver: EMAC platform driver structure | 2835 | * davinci_emac_driver: EMAC platform driver structure |
2811 | * | ||
2812 | * We implement only probe and remove functions - suspend/resume and | ||
2813 | * others not supported by this module | ||
2814 | */ | 2836 | */ |
2815 | static struct platform_driver davinci_emac_driver = { | 2837 | static struct platform_driver davinci_emac_driver = { |
2816 | .driver = { | 2838 | .driver = { |
@@ -2819,6 +2841,8 @@ static struct platform_driver davinci_emac_driver = { | |||
2819 | }, | 2841 | }, |
2820 | .probe = davinci_emac_probe, | 2842 | .probe = davinci_emac_probe, |
2821 | .remove = __devexit_p(davinci_emac_remove), | 2843 | .remove = __devexit_p(davinci_emac_remove), |
2844 | .suspend = davinci_emac_suspend, | ||
2845 | .resume = davinci_emac_resume, | ||
2822 | }; | 2846 | }; |
2823 | 2847 | ||
2824 | /** | 2848 | /** |