diff options
author | Takashi Iwai <tiwai@suse.de> | 2005-11-29 03:09:32 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-01-03 06:31:19 -0500 |
commit | 4c98cfef2efa6b6662ac28c4f0069964bbd9fdf9 (patch) | |
tree | 4ad45704bcf9e43085164d8d7ca6f07d6f1884dd /drivers/pnp/driver.c | |
parent | 0ba656d0b2319b76fbebd01c1c9ba5ca8eb33fb1 (diff) |
[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.c | 20 |
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) | |||
146 | return 1; | 146 | return 1; |
147 | } | 147 | } |
148 | 148 | ||
149 | static int pnp_bus_suspend(struct device *dev, pm_message_t state) | ||
150 | { | ||
151 | struct pnp_dev * pnp_dev = to_pnp_dev(dev); | ||
152 | struct pnp_driver * pnp_drv = pnp_dev->driver; | ||
153 | |||
154 | if (pnp_drv && pnp_drv->suspend) | ||
155 | return pnp_drv->suspend(pnp_dev, state); | ||
156 | return 0; | ||
157 | } | ||
158 | |||
159 | static void pnp_bus_resume(struct device *dev) | ||
160 | { | ||
161 | struct pnp_dev * pnp_dev = to_pnp_dev(dev); | ||
162 | struct pnp_driver * pnp_drv = pnp_dev->driver; | ||
163 | |||
164 | if (pnp_drv && pnp_drv->resume) | ||
165 | pnp_drv->resume(pnp_dev); | ||
166 | } | ||
149 | 167 | ||
150 | struct bus_type pnp_bus_type = { | 168 | struct bus_type pnp_bus_type = { |
151 | .name = "pnp", | 169 | .name = "pnp", |
152 | .match = pnp_bus_match, | 170 | .match = pnp_bus_match, |
171 | .suspend = pnp_bus_suspend, | ||
172 | .resume = pnp_bus_resume, | ||
153 | }; | 173 | }; |
154 | 174 | ||
155 | 175 | ||