diff options
Diffstat (limited to 'drivers/net/macb.c')
-rw-r--r-- | drivers/net/macb.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/drivers/net/macb.c b/drivers/net/macb.c index 50688a52658e..0496d16f9de5 100644 --- a/drivers/net/macb.c +++ b/drivers/net/macb.c | |||
@@ -1281,8 +1281,45 @@ static int __exit macb_remove(struct platform_device *pdev) | |||
1281 | return 0; | 1281 | return 0; |
1282 | } | 1282 | } |
1283 | 1283 | ||
1284 | #ifdef CONFIG_PM | ||
1285 | static int macb_suspend(struct platform_device *pdev, pm_message_t state) | ||
1286 | { | ||
1287 | struct net_device *netdev = platform_get_drvdata(pdev); | ||
1288 | struct macb *bp = netdev_priv(netdev); | ||
1289 | |||
1290 | netif_device_detach(netdev); | ||
1291 | |||
1292 | #ifndef CONFIG_ARCH_AT91 | ||
1293 | clk_disable(bp->hclk); | ||
1294 | #endif | ||
1295 | clk_disable(bp->pclk); | ||
1296 | |||
1297 | return 0; | ||
1298 | } | ||
1299 | |||
1300 | static int macb_resume(struct platform_device *pdev) | ||
1301 | { | ||
1302 | struct net_device *netdev = platform_get_drvdata(pdev); | ||
1303 | struct macb *bp = netdev_priv(netdev); | ||
1304 | |||
1305 | clk_enable(bp->pclk); | ||
1306 | #ifndef CONFIG_ARCH_AT91 | ||
1307 | clk_enable(bp->hclk); | ||
1308 | #endif | ||
1309 | |||
1310 | netif_device_attach(netdev); | ||
1311 | |||
1312 | return 0; | ||
1313 | } | ||
1314 | #else | ||
1315 | #define macb_suspend NULL | ||
1316 | #define macb_resume NULL | ||
1317 | #endif | ||
1318 | |||
1284 | static struct platform_driver macb_driver = { | 1319 | static struct platform_driver macb_driver = { |
1285 | .remove = __exit_p(macb_remove), | 1320 | .remove = __exit_p(macb_remove), |
1321 | .suspend = macb_suspend, | ||
1322 | .resume = macb_resume, | ||
1286 | .driver = { | 1323 | .driver = { |
1287 | .name = "macb", | 1324 | .name = "macb", |
1288 | .owner = THIS_MODULE, | 1325 | .owner = THIS_MODULE, |