Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8d044fe6 authored by Ranjith Lohithakshan's avatar Ranjith Lohithakshan Committed by David S. Miller
Browse files

TI DaVinci EMAC: Add suspend/resume capability



Add suspend/resume capability to TI DaVinci EMAC driver.

Signed-off-by: default avatarRanjith Lohithakshan <ranjithl@ti.com>
Signed-off-by: default avatarChaithrika U S <chaithrika@ti.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9f9354b9
Loading
Loading
Loading
Loading
+27 −3
Original line number Original line Diff line number Diff line
@@ -2806,11 +2806,33 @@ static int __devexit davinci_emac_remove(struct platform_device *pdev)
	return 0;
	return 0;
}
}


static
int davinci_emac_suspend(struct platform_device *pdev, pm_message_t state)
{
	struct net_device *dev = platform_get_drvdata(pdev);

	if (netif_running(dev))
		emac_dev_stop(dev);

	clk_disable(emac_clk);

	return 0;
}

static int davinci_emac_resume(struct platform_device *pdev)
{
	struct net_device *dev = platform_get_drvdata(pdev);

	clk_enable(emac_clk);

	if (netif_running(dev))
		emac_dev_open(dev);

	return 0;
}

/**
/**
 * davinci_emac_driver: EMAC platform driver structure
 * davinci_emac_driver: EMAC platform driver structure
 *
 * We implement only probe and remove functions - suspend/resume and
 * others not supported by this module
 */
 */
static struct platform_driver davinci_emac_driver = {
static struct platform_driver davinci_emac_driver = {
	.driver = {
	.driver = {
@@ -2819,6 +2841,8 @@ static struct platform_driver davinci_emac_driver = {
	},
	},
	.probe = davinci_emac_probe,
	.probe = davinci_emac_probe,
	.remove = __devexit_p(davinci_emac_remove),
	.remove = __devexit_p(davinci_emac_remove),
	.suspend = davinci_emac_suspend,
	.resume = davinci_emac_resume,
};
};


/**
/**