Commit abd6633c authored by David Härdeman's avatar David Härdeman Committed by Linus Torvalds

pnp: add a shutdown method to pnp drivers

The shutdown method is used by the winbond cir driver to setup the
hardware for wake-from-S5.
Signed-off-by: default avatarBjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: default avatarDavid Härdeman <david@hardeman.nu>
Cc: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent a976f150
...@@ -135,6 +135,15 @@ static int pnp_device_remove(struct device *dev) ...@@ -135,6 +135,15 @@ static int pnp_device_remove(struct device *dev)
return 0; return 0;
} }
static void pnp_device_shutdown(struct device *dev)
{
struct pnp_dev *pnp_dev = to_pnp_dev(dev);
struct pnp_driver *drv = pnp_dev->driver;
if (drv && drv->shutdown)
drv->shutdown(pnp_dev);
}
static int pnp_bus_match(struct device *dev, struct device_driver *drv) static int pnp_bus_match(struct device *dev, struct device_driver *drv)
{ {
struct pnp_dev *pnp_dev = to_pnp_dev(dev); struct pnp_dev *pnp_dev = to_pnp_dev(dev);
...@@ -203,6 +212,7 @@ struct bus_type pnp_bus_type = { ...@@ -203,6 +212,7 @@ struct bus_type pnp_bus_type = {
.match = pnp_bus_match, .match = pnp_bus_match,
.probe = pnp_device_probe, .probe = pnp_device_probe,
.remove = pnp_device_remove, .remove = pnp_device_remove,
.shutdown = pnp_device_shutdown,
.suspend = pnp_bus_suspend, .suspend = pnp_bus_suspend,
.resume = pnp_bus_resume, .resume = pnp_bus_resume,
.dev_attrs = pnp_interface_attrs, .dev_attrs = pnp_interface_attrs,
......
...@@ -360,6 +360,7 @@ struct pnp_driver { ...@@ -360,6 +360,7 @@ struct pnp_driver {
unsigned int flags; unsigned int flags;
int (*probe) (struct pnp_dev *dev, const struct pnp_device_id *dev_id); int (*probe) (struct pnp_dev *dev, const struct pnp_device_id *dev_id);
void (*remove) (struct pnp_dev *dev); void (*remove) (struct pnp_dev *dev);
void (*shutdown) (struct pnp_dev *dev);
int (*suspend) (struct pnp_dev *dev, pm_message_t state); int (*suspend) (struct pnp_dev *dev, pm_message_t state);
int (*resume) (struct pnp_dev *dev); int (*resume) (struct pnp_dev *dev);
struct device_driver driver; struct device_driver driver;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment