Lines Matching refs:pnp_dev
45 struct pnp_dev *dev) in match_device()
60 int pnp_device_attach(struct pnp_dev *pnp_dev) in pnp_device_attach() argument
63 if (pnp_dev->status != PNP_READY) { in pnp_device_attach()
67 pnp_dev->status = PNP_ATTACHED; in pnp_device_attach()
73 void pnp_device_detach(struct pnp_dev *pnp_dev) in pnp_device_detach() argument
76 if (pnp_dev->status == PNP_ATTACHED) in pnp_device_detach()
77 pnp_dev->status = PNP_READY; in pnp_device_detach()
86 struct pnp_dev *pnp_dev; in pnp_device_probe() local
88 pnp_dev = to_pnp_dev(dev); in pnp_device_probe()
91 error = pnp_device_attach(pnp_dev); in pnp_device_probe()
95 if (pnp_dev->active == 0) { in pnp_device_probe()
97 error = pnp_activate_dev(pnp_dev); in pnp_device_probe()
103 error = pnp_disable_dev(pnp_dev); in pnp_device_probe()
109 dev_id = match_device(pnp_drv, pnp_dev); in pnp_device_probe()
111 error = pnp_drv->probe(pnp_dev, dev_id); in pnp_device_probe()
114 pnp_dev->driver = pnp_drv; in pnp_device_probe()
122 pnp_device_detach(pnp_dev); in pnp_device_probe()
128 struct pnp_dev *pnp_dev = to_pnp_dev(dev); in pnp_device_remove() local
129 struct pnp_driver *drv = pnp_dev->driver; in pnp_device_remove()
133 drv->remove(pnp_dev); in pnp_device_remove()
134 pnp_dev->driver = NULL; in pnp_device_remove()
137 if (pnp_dev->active && in pnp_device_remove()
139 pnp_disable_dev(pnp_dev); in pnp_device_remove()
141 pnp_device_detach(pnp_dev); in pnp_device_remove()
146 struct pnp_dev *pnp_dev = to_pnp_dev(dev); in pnp_device_shutdown() local
147 struct pnp_driver *drv = pnp_dev->driver; in pnp_device_shutdown()
150 drv->shutdown(pnp_dev); in pnp_device_shutdown()
155 struct pnp_dev *pnp_dev = to_pnp_dev(dev); in pnp_bus_match() local
158 if (match_device(pnp_drv, pnp_dev) == NULL) in pnp_bus_match()
165 struct pnp_dev *pnp_dev = to_pnp_dev(dev); in __pnp_bus_suspend() local
166 struct pnp_driver *pnp_drv = pnp_dev->driver; in __pnp_bus_suspend()
180 error = pnp_drv->suspend(pnp_dev, state); in __pnp_bus_suspend()
185 if (pnp_can_disable(pnp_dev)) { in __pnp_bus_suspend()
186 error = pnp_stop_dev(pnp_dev); in __pnp_bus_suspend()
191 if (pnp_can_suspend(pnp_dev)) in __pnp_bus_suspend()
192 pnp_dev->protocol->suspend(pnp_dev, state); in __pnp_bus_suspend()
213 struct pnp_dev *pnp_dev = to_pnp_dev(dev); in pnp_bus_resume() local
214 struct pnp_driver *pnp_drv = pnp_dev->driver; in pnp_bus_resume()
220 if (pnp_dev->protocol->resume) { in pnp_bus_resume()
221 error = pnp_dev->protocol->resume(pnp_dev); in pnp_bus_resume()
226 if (pnp_can_write(pnp_dev)) { in pnp_bus_resume()
227 error = pnp_start_dev(pnp_dev); in pnp_bus_resume()
239 error = pnp_drv->resume(pnp_dev); in pnp_bus_resume()
288 struct pnp_id *pnp_add_id(struct pnp_dev *dev, const char *id) in pnp_add_id()