aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBryan Wu <bryan.wu@analog.com>2007-09-19 11:37:14 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:51:49 -0400
commit496a34c2249fecc87ee689eede2bb8510c1b37a9 (patch)
treefb5fafab93bbde36c0e7be2bce04749ca4ffc23b /drivers
parent73f83182862a2c9113421720997c75ee939902f8 (diff)
Blackfin EMAC driver: add power management interface and change the bf537mac_reset to bf537mac_disable
Signed-off-by: Bryan Wu <bryan.wu@analog.com> Acked-by: Jeff Garzik <jeff@garzik.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/bfin_mac.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c
index ead7be969975..5cb4433d5612 100644
--- a/drivers/net/bfin_mac.c
+++ b/drivers/net/bfin_mac.c
@@ -672,7 +672,7 @@ static void bf537mac_poll(struct net_device *dev)
672} 672}
673#endif /* CONFIG_NET_POLL_CONTROLLER */ 673#endif /* CONFIG_NET_POLL_CONTROLLER */
674 674
675static void bf537mac_reset(void) 675static void bf537mac_disable(void)
676{ 676{
677 unsigned int opmode; 677 unsigned int opmode;
678 678
@@ -730,7 +730,7 @@ static void bf537mac_timeout(struct net_device *dev)
730{ 730{
731 pr_debug("%s: %s\n", dev->name, __FUNCTION__); 731 pr_debug("%s: %s\n", dev->name, __FUNCTION__);
732 732
733 bf537mac_reset(); 733 bf537mac_disable();
734 734
735 /* reset tx queue */ 735 /* reset tx queue */
736 tx_list_tail = tx_list_head->next; 736 tx_list_tail = tx_list_head->next;
@@ -810,7 +810,7 @@ static int bf537mac_open(struct net_device *dev)
810 810
811 bf537mac_setphy(dev); 811 bf537mac_setphy(dev);
812 setup_system_regs(dev); 812 setup_system_regs(dev);
813 bf537mac_reset(); 813 bf537mac_disable();
814 bf537mac_enable(dev); 814 bf537mac_enable(dev);
815 815
816 pr_debug("hardware init finished\n"); 816 pr_debug("hardware init finished\n");
@@ -968,15 +968,30 @@ static int bfin_mac_remove(struct platform_device *pdev)
968 return 0; 968 return 0;
969} 969}
970 970
971static int bfin_mac_suspend(struct platform_device *pdev, pm_message_t state) 971#ifdef CONFIG_PM
972static int bfin_mac_suspend(struct platform_device *pdev, pm_message_t mesg)
972{ 973{
974 struct net_device *net_dev = platform_get_drvdata(pdev);
975
976 if (netif_running(net_dev))
977 bf537mac_close(net_dev);
978
973 return 0; 979 return 0;
974} 980}
975 981
976static int bfin_mac_resume(struct platform_device *pdev) 982static int bfin_mac_resume(struct platform_device *pdev)
977{ 983{
984 struct net_device *net_dev = platform_get_drvdata(pdev);
985
986 if (netif_running(net_dev))
987 bf537mac_open(net_dev);
988
978 return 0; 989 return 0;
979} 990}
991#else
992#define bfin_mac_suspend NULL
993#define bfin_mac_resume NULL
994#endif /* CONFIG_PM */
980 995
981static struct platform_driver bfin_mac_driver = { 996static struct platform_driver bfin_mac_driver = {
982 .probe = bfin_mac_probe, 997 .probe = bfin_mac_probe,