]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/macb.c
Merge current mainline tree into linux-omap tree
[linux-2.6-omap-h63xx.git] / drivers / net / macb.c
index 50688a52658eb359f8c12ebf56a8d64a9c3c46e6..84c77f1f9a5cf755a33de626c140cd9c8f73e269 100644 (file)
@@ -21,8 +21,8 @@
 #include <linux/platform_device.h>
 #include <linux/phy.h>
 
-#include <asm/arch/board.h>
-#include <asm/arch/cpu.h>
+#include <mach/board.h>
+#include <mach/cpu.h>
 
 #include "macb.h"
 
@@ -164,9 +164,7 @@ static void macb_handle_link_change(struct net_device *dev)
        }
 
        if (phydev->link != bp->link) {
-               if (phydev->link)
-                       netif_tx_schedule_all(dev);
-               else {
+               if (!phydev->link) {
                        bp->speed = 0;
                        bp->duplex = -1;
                }
@@ -1281,8 +1279,45 @@ static int __exit macb_remove(struct platform_device *pdev)
        return 0;
 }
 
+#ifdef CONFIG_PM
+static int macb_suspend(struct platform_device *pdev, pm_message_t state)
+{
+       struct net_device *netdev = platform_get_drvdata(pdev);
+       struct macb *bp = netdev_priv(netdev);
+
+       netif_device_detach(netdev);
+
+#ifndef CONFIG_ARCH_AT91
+       clk_disable(bp->hclk);
+#endif
+       clk_disable(bp->pclk);
+
+       return 0;
+}
+
+static int macb_resume(struct platform_device *pdev)
+{
+       struct net_device *netdev = platform_get_drvdata(pdev);
+       struct macb *bp = netdev_priv(netdev);
+
+       clk_enable(bp->pclk);
+#ifndef CONFIG_ARCH_AT91
+       clk_enable(bp->hclk);
+#endif
+
+       netif_device_attach(netdev);
+
+       return 0;
+}
+#else
+#define macb_suspend   NULL
+#define macb_resume    NULL
+#endif
+
 static struct platform_driver macb_driver = {
        .remove         = __exit_p(macb_remove),
+       .suspend        = macb_suspend,
+       .resume         = macb_resume,
        .driver         = {
                .name           = "macb",
                .owner  = THIS_MODULE,