From e11f8e31f0da5e46bb6c4ed4e4945d361383195e Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 7 Oct 2016 07:09:48 +0200 Subject: ohci: Fixes due to USB stack update --- freebsd/sys/dev/usb/controller/ohci.h | 6 ++++++ rtemsbsd/sys/dev/usb/controller/ohci_lpc.c | 28 +++++++--------------------- 2 files changed, 13 insertions(+), 21 deletions(-) diff --git a/freebsd/sys/dev/usb/controller/ohci.h b/freebsd/sys/dev/usb/controller/ohci.h index fad1a9fe..d020d998 100644 --- a/freebsd/sys/dev/usb/controller/ohci.h +++ b/freebsd/sys/dev/usb/controller/ohci.h @@ -253,6 +253,12 @@ typedef struct ohci_softc { uint8_t sc_hub_idata[32]; char sc_vendor[16]; +#ifdef __rtems__ + int sc_init_done; +#ifdef BSP_USB_OTG_TRANSCEIVER_I2C_ADDR + struct usb_otg_transceiver sc_otg_trans; +#endif /* BSP_USB_OTG_TRANSCEIVER_I2C_ADDR */ +#endif /* __rtems__ */ } ohci_softc_t; diff --git a/rtemsbsd/sys/dev/usb/controller/ohci_lpc.c b/rtemsbsd/sys/dev/usb/controller/ohci_lpc.c index 527561c3..a0314c54 100644 --- a/rtemsbsd/sys/dev/usb/controller/ohci_lpc.c +++ b/rtemsbsd/sys/dev/usb/controller/ohci_lpc.c @@ -34,6 +34,8 @@ #include +#include + #if defined(LIBBSP_ARM_LPC24XX_BSP_H) || defined(LIBBSP_ARM_LPC32XX_BSP_H) #include @@ -224,7 +226,7 @@ static int lpc_otg_clk_ctrl(uint32_t otg_clk_ctrl) #include #include #include -#include +#include #include #include #include @@ -232,7 +234,7 @@ static int lpc_otg_clk_ctrl(uint32_t otg_clk_ctrl) #include #include #include -#include +#include #include #include #include @@ -362,7 +364,6 @@ static int i2c_write( static device_probe_t ohci_lpc_probe; static device_attach_t ohci_lpc_attach; static device_detach_t ohci_lpc_detach; -static device_suspend_t ohci_lpc_suspend; static device_resume_t ohci_lpc_resume; static int @@ -393,23 +394,9 @@ ohci_lpc_otg_transceiver_suspend(ohci_softc_t *e) return eno; } -static int -ohci_lpc_suspend(device_t self) -{ - ohci_softc_t *e = device_get_softc(self); - int eno = bus_generic_suspend(self); - - if (eno == 0) { - ohci_suspend(e); - } - - return (eno); -} - static int ohci_lpc_resume(device_t self) { - ohci_softc_t *e = device_get_softc(self); int eno = 0; #ifdef BSP_USB_OTG_TRANSCEIVER_I2C_ADDR @@ -442,8 +429,6 @@ ohci_lpc_resume(device_t self) #endif /* BSP_USB_OTG_TRANSCEIVER_I2C_ADDR */ if (eno == 0) { - ohci_resume(e); - eno = bus_generic_resume(self); } @@ -472,6 +457,7 @@ ohci_lpc_attach(device_t self) e->sc_bus.parent = self; e->sc_bus.devices = e->sc_devices; e->sc_bus.devices_max = OHCI_MAX_DEVICES; + e->sc_bus.dma_bits = 32; /* Get all DMA memory */ if (usb_bus_mem_alloc_all(&e->sc_bus, USB_GET_DMA_TAG(self), &ohci_iterate_hw_softc)) { @@ -602,7 +588,7 @@ ohci_lpc_detach(device_t self) device_delete_child(self, bdev); } - device_delete_all_children(self); + device_delete_children(self); if (e->sc_init_done) { ohci_detach(e); @@ -632,7 +618,7 @@ static device_method_t ohci_methods [] = { DEVMETHOD(device_probe, ohci_lpc_probe), DEVMETHOD(device_attach, ohci_lpc_attach), DEVMETHOD(device_detach, ohci_lpc_detach), - DEVMETHOD(device_suspend, ohci_lpc_suspend), + DEVMETHOD(device_suspend, bus_generic_suspend), DEVMETHOD(device_resume, ohci_lpc_resume), DEVMETHOD(device_shutdown, bus_generic_shutdown), -- cgit v1.2.3