diff --git a/sys/dev/usb2/controller/at91dci.c b/sys/dev/usb2/controller/at91dci.c index 2450ae436aca..9ab971014004 100644 --- a/sys/dev/usb2/controller/at91dci.c +++ b/sys/dev/usb2/controller/at91dci.c @@ -729,11 +729,9 @@ repeat: } } -static void -at91dci_vbus_interrupt(struct usb2_bus *bus, uint8_t is_on) +void +at91dci_vbus_interrupt(struct at91dci_softc *sc, uint8_t is_on) { - struct at91dci_softc *sc = AT9100_DCI_BUS2SC(bus); - DPRINTFN(5, "vbus = %u\n", is_on); USB_BUS_LOCK(&sc->sc_bus); @@ -760,7 +758,6 @@ at91dci_vbus_interrupt(struct usb2_bus *bus, uint8_t is_on) &at91dci_root_intr_done); } } - USB_BUS_UNLOCK(&sc->sc_bus); } @@ -2466,6 +2463,5 @@ struct usb2_bus_methods at91dci_bus_methods = .get_hw_ep_profile = &at91dci_get_hw_ep_profile, .set_stall = &at91dci_set_stall, .clear_stall = &at91dci_clear_stall, - .vbus_interrupt = &at91dci_vbus_interrupt, .roothub_exec = &at91dci_root_ctrl_task, }; diff --git a/sys/dev/usb2/controller/at91dci.h b/sys/dev/usb2/controller/at91dci.h index d553495cfba3..d38630731827 100644 --- a/sys/dev/usb2/controller/at91dci.h +++ b/sys/dev/usb2/controller/at91dci.h @@ -240,5 +240,6 @@ void at91dci_uninit(struct at91dci_softc *sc); void at91dci_suspend(struct at91dci_softc *sc); void at91dci_resume(struct at91dci_softc *sc); void at91dci_interrupt(struct at91dci_softc *sc); +void at91dci_vbus_interrupt(struct at91dci_softc *sc, uint8_t is_on); #endif /* _AT9100_DCI_H_ */ diff --git a/sys/dev/usb2/controller/at91dci_atmelarm.c b/sys/dev/usb2/controller/at91dci_atmelarm.c index 3fe3ec3f0ace..5ce562568cca 100644 --- a/sys/dev/usb2/controller/at91dci_atmelarm.c +++ b/sys/dev/usb2/controller/at91dci_atmelarm.c @@ -72,7 +72,7 @@ struct at91_udp_softc { }; static void -at91_vbus_interrupt(struct at91_udp_softc *sc) +at91_vbus_poll(struct at91_udp_softc *sc) { uint32_t temp; uint8_t vbus_val; @@ -84,8 +84,7 @@ at91_vbus_interrupt(struct at91_udp_softc *sc) /* just forward it */ vbus_val = at91_pio_gpio_get(VBUS_BASE, VBUS_MASK); - (sc->sc_dci.sc_bus.methods->vbus_interrupt) - (&sc->sc_dci.sc_bus, vbus_val); + at91dci_vbus_interrupt(&sc->sc_dci, vbus_val); } static void @@ -220,10 +219,10 @@ at91_udp_attach(device_t dev) } #if (__FreeBSD_version >= 700031) err = bus_setup_intr(dev, sc->sc_vbus_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - NULL, (void *)at91_vbus_interrupt, sc, &sc->sc_vbus_intr_hdl); + NULL, (void *)at91_vbus_poll, sc, &sc->sc_vbus_intr_hdl); #else err = bus_setup_intr(dev, sc->sc_vbus_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - (void *)at91_vbus_interrupt, sc, &sc->sc_vbus_intr_hdl); + (void *)at91_vbus_poll, sc, &sc->sc_vbus_intr_hdl); #endif if (err) { sc->sc_vbus_intr_hdl = NULL; @@ -237,7 +236,7 @@ at91_udp_attach(device_t dev) goto error; } else { /* poll VBUS one time */ - at91_vbus_interrupt(sc); + at91_vbus_poll(sc); } return (0); diff --git a/sys/dev/usb2/controller/musb2_otg.c b/sys/dev/usb2/controller/musb2_otg.c index 899a73faafc0..79a1fbac749d 100644 --- a/sys/dev/usb2/controller/musb2_otg.c +++ b/sys/dev/usb2/controller/musb2_otg.c @@ -954,11 +954,9 @@ repeat: } } -static void -musbotg_vbus_interrupt(struct usb2_bus *bus, uint8_t is_on) +void +musbotg_vbus_interrupt(struct musbotg_softc *sc, uint8_t is_on) { - struct musbotg_softc *sc = MUSBOTG_BUS2SC(bus); - DPRINTFN(4, "vbus = %u\n", is_on); USB_BUS_LOCK(&sc->sc_bus); @@ -2873,6 +2871,5 @@ struct usb2_bus_methods musbotg_bus_methods = .get_hw_ep_profile = &musbotg_get_hw_ep_profile, .set_stall = &musbotg_set_stall, .clear_stall = &musbotg_clear_stall, - .vbus_interrupt = &musbotg_vbus_interrupt, .roothub_exec = &musbotg_root_ctrl_task, }; diff --git a/sys/dev/usb2/controller/musb2_otg.h b/sys/dev/usb2/controller/musb2_otg.h index 2bf1d6673353..0d880e1fd4dc 100644 --- a/sys/dev/usb2/controller/musb2_otg.h +++ b/sys/dev/usb2/controller/musb2_otg.h @@ -402,5 +402,6 @@ void musbotg_uninit(struct musbotg_softc *sc); void musbotg_suspend(struct musbotg_softc *sc); void musbotg_resume(struct musbotg_softc *sc); void musbotg_interrupt(struct musbotg_softc *sc); +void musbotg_vbus_interrupt(struct musbotg_softc *sc, uint8_t is_on); #endif /* _MUSB2_OTG_H_ */ diff --git a/sys/dev/usb2/controller/musb2_otg_atmelarm.c b/sys/dev/usb2/controller/musb2_otg_atmelarm.c index 85e57dd0533b..44fa32056091 100644 --- a/sys/dev/usb2/controller/musb2_otg_atmelarm.c +++ b/sys/dev/usb2/controller/musb2_otg_atmelarm.c @@ -50,14 +50,12 @@ struct musbotg_super_softc { }; static void -musbotg_vbus_interrupt(struct musbotg_super_softc *sc) +musbotg_vbus_poll(struct musbotg_super_softc *sc) { uint8_t vbus_val = 1; /* fake VBUS on - TODO */ /* just forward it */ - - (sc->sc_otg.sc_bus.methods->vbus_interrupt) - (&sc->sc_otg.sc_bus, vbus_val); + musbotg_vbus_interrupt(&sc->sc_otg, vbus_val); } static void @@ -154,7 +152,7 @@ musbotg_attach(device_t dev) goto error; } else { /* poll VBUS one time */ - musbotg_vbus_interrupt(sc); + musbotg_vbus_poll(sc); } return (0); diff --git a/sys/dev/usb2/controller/usb2_controller.h b/sys/dev/usb2/controller/usb2_controller.h index 70eb42b36eee..646b49af1c99 100644 --- a/sys/dev/usb2/controller/usb2_controller.h +++ b/sys/dev/usb2/controller/usb2_controller.h @@ -91,10 +91,6 @@ struct usb2_bus_methods { void (*set_stall) (struct usb2_device *udev, struct usb2_xfer *xfer, struct usb2_pipe *pipe); void (*clear_stall) (struct usb2_device *udev, struct usb2_pipe *pipe); - /* USB Device mode only - Optional */ - - void (*vbus_interrupt) (struct usb2_bus *, uint8_t is_on); - /* USB Device and Host mode - Optional */ void (*roothub_exec) (struct usb2_bus *);