* [PATCH] ks8851: suspend resume support
@ 2010-10-29 4:57 Arce, Abraham
2010-11-08 21:43 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Arce, Abraham @ 2010-10-29 4:57 UTC (permalink / raw)
To: netdev@vger.kernel.org
Add suspend/resume support using default open/stop interface methods
to do hardware dependant operations.
On suspend, same low power state (soft power mode) will be kept, the
following blocks will be disabled:
- Internal PLL Clock
- Tx/Rx PHY
- MAC
- SPI Interface
Signed-off-by: Abraham Arce <x0066660@ti.com>
---
drivers/net/ks8851.c | 33 +++++++++++++++++++++++++++++++++
1 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ks8851.c b/drivers/net/ks8851.c
index 8a178bc..9d40e33 100644
--- a/drivers/net/ks8851.c
+++ b/drivers/net/ks8851.c
@@ -1570,6 +1570,37 @@ static int ks8851_read_selftest(struct ks8851_net *ks)
/* driver bus management functions */
+#ifdef CONFIG_PM
+static int ks8851_suspend(struct spi_device *spi, pm_message_t state)
+{
+ struct ks8851_net *ks = dev_get_drvdata(&spi->dev);
+ struct net_device *dev = ks->netdev;
+
+ if (netif_running(dev)) {
+ netif_device_detach(dev);
+ ks8851_net_stop(dev);
+ }
+
+ return 0;
+}
+
+static int ks8851_resume(struct spi_device *spi)
+{
+ struct ks8851_net *ks = dev_get_drvdata(&spi->dev);
+ struct net_device *dev = ks->netdev;
+
+ if (netif_running(dev)) {
+ ks8851_net_open(dev);
+ netif_device_attach(dev);
+ }
+
+ return 0;
+}
+#else
+#define ks8851_suspend NULL
+#define ks8851_resume NULL
+#endif
+
static int __devinit ks8851_probe(struct spi_device *spi)
{
struct net_device *ndev;
@@ -1710,6 +1741,8 @@ static struct spi_driver ks8851_driver = {
},
.probe = ks8851_probe,
.remove = __devexit_p(ks8851_remove),
+ .suspend = ks8851_suspend,
+ .resume = ks8851_resume,
};
static int __init ks8851_init(void)
--
1.5.4.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ks8851: suspend resume support
2010-10-29 4:57 [PATCH] ks8851: suspend resume support Arce, Abraham
@ 2010-11-08 21:43 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2010-11-08 21:43 UTC (permalink / raw)
To: x0066660; +Cc: netdev
From: "Arce, Abraham" <x0066660@ti.com>
Date: Thu, 28 Oct 2010 23:57:20 -0500
> Add suspend/resume support using default open/stop interface methods
> to do hardware dependant operations.
>
> On suspend, same low power state (soft power mode) will be kept, the
> following blocks will be disabled:
>
> - Internal PLL Clock
> - Tx/Rx PHY
> - MAC
> - SPI Interface
>
> Signed-off-by: Abraham Arce <x0066660@ti.com>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-11-08 21:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-29 4:57 [PATCH] ks8851: suspend resume support Arce, Abraham
2010-11-08 21:43 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).