Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 28828
b: refs/heads/master
c: 00e5edc
h: refs/heads/master
v: v3
  • Loading branch information
Andrew Victor authored and Jeff Garzik committed Jun 23, 2006
1 parent dab8531 commit 1afdf53
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 427d269f17fd02d192e9ae3bd93bdc07790fa02c
refs/heads/master: 00e5edcbfdb7030f6cbb8d5d89fdc2848133a182
46 changes: 45 additions & 1 deletion trunk/drivers/net/arm/at91_ether.c
Original file line number Diff line number Diff line change
Expand Up @@ -1128,10 +1128,54 @@ static int __devexit at91ether_remove(struct platform_device *pdev)
return 0;
}

#ifdef CONFIG_PM

static int at91ether_suspend(struct platform_device *pdev, pm_message_t mesg)
{
struct at91_private *lp = (struct at91_private *) at91_dev->priv;
struct net_device *net_dev = platform_get_drvdata(pdev);
int phy_irq = lp->board_data.phy_irq_pin;

if (netif_running(net_dev)) {
if (phy_irq)
disable_irq(phy_irq);

netif_stop_queue(net_dev);
netif_device_detach(net_dev);

clk_disable(lp->ether_clk);
}
return 0;
}

static int at91ether_resume(struct platform_device *pdev)
{
struct at91_private *lp = (struct at91_private *) at91_dev->priv;
struct net_device *net_dev = platform_get_drvdata(pdev);
int phy_irq = lp->board_data.phy_irq_pin;

if (netif_running(net_dev)) {
clk_enable(lp->ether_clk);

netif_device_attach(net_dev);
netif_start_queue(net_dev);

if (phy_irq)
enable_irq(phy_irq);
}
return 0;
}

#else
#define at91ether_suspend NULL
#define at91ether_resume NULL
#endif

static struct platform_driver at91ether_driver = {
.probe = at91ether_probe,
.remove = __devexit_p(at91ether_remove),
/* FIXME: support suspend and resume */
.suspend = at91ether_suspend,
.resume = at91ether_resume,
.driver = {
.name = DRV_NAME,
.owner = THIS_MODULE,
Expand Down

0 comments on commit 1afdf53

Please sign in to comment.