aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-07-14 16:37:29 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-14 16:37:29 -0400
commit6c118e43dc513a7118b49b9ff953fe61e14515dc (patch)
treeef654ba1982c17a516697d25b3d0405acb6aeac1 /drivers/net
parent847106ff628805e1a0aa91e7f53381f3fdfcd839 (diff)
parent72f6befeea7dc634a83219287d5b874734b85637 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/avr32-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/avr32-2.6: (31 commits) avr32: Fix typo of IFSR in a comment in the PIO header file avr32: Power Management support ("standby" and "mem" modes) avr32: Add system device for the internal interrupt controller (intc) avr32: Add simple SRAM allocator avr32: Enable SDRAMC clock at startup rtc-at32ap700x: Enable wakeup macb: Basic suspend/resume support atmel_serial: Drain console TX shifter before suspending atmel_serial: Fix build on avr32 with CONFIG_PM enabled avr32: Use a quicklist for PTE allocation as well avr32: Use a quicklist for PGD allocation avr32: Cover the kernel page tables in the user PGDs avr32: Store virtual addresses in the PGD avr32: Remove useless zeroing of swapper_pg_dir at startup avr32: Clean up and optimize the TLB operations avr32: Rename at32ap.c -> pdc.c avr32: Move setup_platform() into chip-specific file avr32: Kill special exception handler sections avr32: Kill unneeded #include <asm/pgalloc.h> from asm/mmu_context.h avr32: Clean up time.c #includes ...
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/macb.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 92dccd43bdca..0a5745a854c7 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -1277,8 +1277,45 @@ static int __exit macb_remove(struct platform_device *pdev)
1277 return 0; 1277 return 0;
1278} 1278}
1279 1279
1280#ifdef CONFIG_PM
1281static int macb_suspend(struct platform_device *pdev, pm_message_t state)
1282{
1283 struct net_device *netdev = platform_get_drvdata(pdev);
1284 struct macb *bp = netdev_priv(netdev);
1285
1286 netif_device_detach(netdev);
1287
1288#ifndef CONFIG_ARCH_AT91
1289 clk_disable(bp->hclk);
1290#endif
1291 clk_disable(bp->pclk);
1292
1293 return 0;
1294}
1295
1296static int macb_resume(struct platform_device *pdev)
1297{
1298 struct net_device *netdev = platform_get_drvdata(pdev);
1299 struct macb *bp = netdev_priv(netdev);
1300
1301 clk_enable(bp->pclk);
1302#ifndef CONFIG_ARCH_AT91
1303 clk_enable(bp->hclk);
1304#endif
1305
1306 netif_device_attach(netdev);
1307
1308 return 0;
1309}
1310#else
1311#define macb_suspend NULL
1312#define macb_resume NULL
1313#endif
1314
1280static struct platform_driver macb_driver = { 1315static struct platform_driver macb_driver = {
1281 .remove = __exit_p(macb_remove), 1316 .remove = __exit_p(macb_remove),
1317 .suspend = macb_suspend,
1318 .resume = macb_resume,
1282 .driver = { 1319 .driver = {
1283 .name = "macb", 1320 .name = "macb",
1284 .owner = THIS_MODULE, 1321 .owner = THIS_MODULE,