-/* $OpenBSD: uaudio.c,v 1.104 2014/07/12 18:48:52 tedu Exp $ */
+/* $OpenBSD: uaudio.c,v 1.105 2014/08/21 14:52:55 mpi Exp $ */
/* $NetBSD: uaudio.c,v 1.90 2004/10/29 17:12:53 kent Exp $ */
/*
int sc_nencs;
struct mixerctl *sc_ctls; /* mixer controls */
int sc_nctls; /* # of mixer controls */
- struct device *sc_audiodev;
int sc_quirks;
};
int uaudio_match(struct device *, void *, void *);
void uaudio_attach(struct device *, struct device *, void *);
int uaudio_detach(struct device *, int);
-int uaudio_activate(struct device *, int);
struct cfdriver uaudio_cd = {
NULL, "uaudio", DV_DULL
};
-const struct cfattach uaudio_ca = {
- sizeof(struct uaudio_softc),
- uaudio_match,
- uaudio_attach,
- uaudio_detach,
- uaudio_activate,
+const struct cfattach uaudio_ca = {
+ sizeof(struct uaudio_softc), uaudio_match, uaudio_attach, uaudio_detach
};
int
uaudio_create_encodings(sc);
DPRINTF(("uaudio_attach: doing audio_attach_mi\n"));
- sc->sc_audiodev = audio_attach_mi(&uaudio_hw_if, sc, &sc->sc_dev);
-}
-
-int
-uaudio_activate(struct device *self, int act)
-{
- struct uaudio_softc *sc = (struct uaudio_softc *)self;
- int rv = 0;
-
- switch (act) {
- case DVACT_DEACTIVATE:
- if (sc->sc_audiodev != NULL)
- rv = config_deactivate(sc->sc_audiodev);
- usbd_deactivate(sc->sc_udev);
- break;
- }
- return (rv);
+ audio_attach_mi(&uaudio_hw_if, sc, &sc->sc_dev);
}
int
/* Wait for outstanding requests to complete. */
uaudio_drain(sc);
- if (sc->sc_audiodev != NULL)
- rv = config_detach(sc->sc_audiodev, flags);
+ rv = config_detach_children(self, flags);
return (rv);
}
-/* $OpenBSD: ukbd.c,v 1.67 2014/05/12 09:50:44 mpi Exp $ */
+/* $OpenBSD: ukbd.c,v 1.68 2014/08/21 14:52:55 mpi Exp $ */
/* $NetBSD: ukbd.c,v 1.85 2003/03/11 16:44:00 augustss Exp $ */
/*
int ukbd_match(struct device *, void *, void *);
void ukbd_attach(struct device *, struct device *, void *);
int ukbd_detach(struct device *, int);
-int ukbd_activate(struct device *, int);
struct cfdriver ukbd_cd = {
NULL, "ukbd", DV_DULL
};
-const struct cfattach ukbd_ca = {
- sizeof(struct ukbd_softc),
- ukbd_match,
- ukbd_attach,
- ukbd_detach,
- ukbd_activate,
+const struct cfattach ukbd_ca = {
+ sizeof(struct ukbd_softc), ukbd_match, ukbd_attach, ukbd_detach
};
struct ukbd_translation {
hidkbd_attach_wskbd(kbd, layout, &ukbd_accessops);
}
-int
-ukbd_activate(struct device *self, int act)
-{
- struct ukbd_softc *sc = (struct ukbd_softc *)self;
- struct hidkbd *kbd = &sc->sc_kbd;
- int rv = 0;
-
- switch (act) {
- case DVACT_DEACTIVATE:
- if (kbd->sc_wskbddev != NULL)
- rv = config_deactivate(kbd->sc_wskbddev);
- break;
- }
- return (rv);
-}
-
int
ukbd_detach(struct device *self, int flags)
{
-/* $OpenBSD: umass.c,v 1.66 2014/07/12 18:48:52 tedu Exp $ */
+/* $OpenBSD: umass.c,v 1.67 2014/08/21 14:52:56 mpi Exp $ */
/* $NetBSD: umass.c,v 1.116 2004/06/30 05:53:46 mycroft Exp $ */
/*
int umass_match(struct device *, void *, void *);
void umass_attach(struct device *, struct device *, void *);
int umass_detach(struct device *, int);
-int umass_activate(struct device *, int);
struct cfdriver umass_cd = {
NULL, "umass", DV_DULL
};
-const struct cfattach umass_ca = {
- sizeof(struct umass_softc),
- umass_match,
- umass_attach,
- umass_detach,
- umass_activate,
+const struct cfattach umass_ca = {
+ sizeof(struct umass_softc), umass_match, umass_attach, umass_detach
};
+
void umass_disco(struct umass_softc *sc);
/* generic transfer functions */
return (rv);
}
-int
-umass_activate(struct device *dev, int act)
-{
- struct umass_softc *sc = (struct umass_softc *)dev;
- struct umassbus_softc *scbus = sc->bus;
- int rv = 0;
-
- DPRINTF(UDMASS_USB, ("%s: umass_activate: %d\n",
- sc->sc_dev.dv_xname, act));
-
- switch (act) {
- case DVACT_DEACTIVATE:
- usbd_deactivate(sc->sc_udev);
- if (scbus == NULL || scbus->sc_child == NULL)
- break;
- rv = config_deactivate(scbus->sc_child);
- DPRINTF(UDMASS_USB, ("%s: umass_activate: child "
- "returned %d\n", sc->sc_dev.dv_xname, rv));
- break;
- default:
- rv = config_activate_children(dev, act);
- break;
- }
- return (rv);
-}
-
void
umass_disco(struct umass_softc *sc)
{
-/* $OpenBSD: ums.c,v 1.38 2013/11/15 08:17:44 pirofti Exp $ */
+/* $OpenBSD: ums.c,v 1.39 2014/08/21 14:52:56 mpi Exp $ */
/* $NetBSD: ums.c,v 1.60 2003/03/11 16:44:00 augustss Exp $ */
/*
ums_disable,
};
-int ums_match(struct device *, void *, void *);
-void ums_attach(struct device *, struct device *, void *);
-int ums_detach(struct device *, int);
-int ums_activate(struct device *, int);
-
-struct cfdriver ums_cd = {
- NULL, "ums", DV_DULL
-};
-
-const struct cfattach ums_ca = {
- sizeof(struct ums_softc),
- ums_match,
- ums_attach,
- ums_detach,
- ums_activate,
+int ums_match(struct device *, void *, void *);
+void ums_attach(struct device *, struct device *, void *);
+int ums_detach(struct device *, int);
+
+struct cfdriver ums_cd = {
+ NULL, "ums", DV_DULL
+};
+
+const struct cfattach ums_ca = {
+ sizeof(struct ums_softc), ums_match, ums_attach, ums_detach
};
int
hidms_attach(ms, &ums_accessops);
}
-int
-ums_activate(struct device *self, int act)
-{
- struct ums_softc *sc = (struct ums_softc *)self;
- struct hidms *ms = &sc->sc_ms;
- int rv = 0;
-
- switch (act) {
- case DVACT_DEACTIVATE:
- if (ms->sc_wsmousedev != NULL)
- rv = config_deactivate(ms->sc_wsmousedev);
- break;
- }
- return (rv);
-}
-
int
ums_detach(struct device *self, int flags)
{