summaryrefslogtreecommitdiff
path: root/drivers/pnp/driver.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-11-29 11:09:32 +0300
committerJaroslav Kysela <perex@suse.cz>2006-01-03 14:31:19 +0300
commit4c98cfef2efa6b6662ac28c4f0069964bbd9fdf9 (patch)
tree4ad45704bcf9e43085164d8d7ca6f07d6f1884dd /drivers/pnp/driver.c
parent0ba656d0b2319b76fbebd01c1c9ba5ca8eb33fb1 (diff)
downloadlinux-4c98cfef2efa6b6662ac28c4f0069964bbd9fdf9.tar.xz
[ALSA] PATCH] Add PM support to PnP drivers
Add suspend/resume callback to pnp_driver and pnp_card_driver. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'drivers/pnp/driver.c')
-rw-r--r--drivers/pnp/driver.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/pnp/driver.c b/drivers/pnp/driver.c
index d3ccce706ab4..ea2cb9a8b21d 100644
--- a/drivers/pnp/driver.c
+++ b/drivers/pnp/driver.c
@@ -146,10 +146,30 @@ static int pnp_bus_match(struct device *dev, struct device_driver *drv)
return 1;
}
+static int pnp_bus_suspend(struct device *dev, pm_message_t state)
+{
+ struct pnp_dev * pnp_dev = to_pnp_dev(dev);
+ struct pnp_driver * pnp_drv = pnp_dev->driver;
+
+ if (pnp_drv && pnp_drv->suspend)
+ return pnp_drv->suspend(pnp_dev, state);
+ return 0;
+}
+
+static void pnp_bus_resume(struct device *dev)
+{
+ struct pnp_dev * pnp_dev = to_pnp_dev(dev);
+ struct pnp_driver * pnp_drv = pnp_dev->driver;
+
+ if (pnp_drv && pnp_drv->resume)
+ pnp_drv->resume(pnp_dev);
+}
struct bus_type pnp_bus_type = {
.name = "pnp",
.match = pnp_bus_match,
+ .suspend = pnp_bus_suspend,
+ .resume = pnp_bus_resume,
};