ehci_ebus.c (227849) | ehci_ebus.c (228483) |
---|---|
1/*- 2 * Copyright (C) 2009 Yohanes Nugroho <yohanes@gmail.com> 3 * based on ehci_mbus.c 4 * Copyright (C) 2008 MARVELL INTERNATIONAL LTD. 5 * All rights reserved. 6 * 7 * 8 * Redistribution and use in source and binary forms, with or without --- 18 unchanged lines hidden (view full) --- 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 */ 32 33 34#include <sys/cdefs.h> | 1/*- 2 * Copyright (C) 2009 Yohanes Nugroho <yohanes@gmail.com> 3 * based on ehci_mbus.c 4 * Copyright (C) 2008 MARVELL INTERNATIONAL LTD. 5 * All rights reserved. 6 * 7 * 8 * Redistribution and use in source and binary forms, with or without --- 18 unchanged lines hidden (view full) --- 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 */ 32 33 34#include <sys/cdefs.h> |
35__FBSDID("$FreeBSD: head/sys/arm/econa/ehci_ebus.c 227849 2011-11-22 21:56:55Z hselasky $"); | 35__FBSDID("$FreeBSD: head/sys/arm/econa/ehci_ebus.c 228483 2011-12-14 00:28:54Z hselasky $"); |
36 37#include "opt_bus.h" 38 39#include <machine/resource.h> 40 41#include <sys/stdint.h> 42#include <sys/stddef.h> 43#include <sys/param.h> --- 26 unchanged lines hidden (view full) --- 70#include <dev/usb/usb_controller.h> 71#include <dev/usb/usb_bus.h> 72#include <dev/usb/controller/ehci.h> 73#include <dev/usb/controller/ehcireg.h> 74 75 76static device_attach_t ehci_ebus_attach; 77static device_detach_t ehci_ebus_detach; | 36 37#include "opt_bus.h" 38 39#include <machine/resource.h> 40 41#include <sys/stdint.h> 42#include <sys/stddef.h> 43#include <sys/param.h> --- 26 unchanged lines hidden (view full) --- 70#include <dev/usb/usb_controller.h> 71#include <dev/usb/usb_bus.h> 72#include <dev/usb/controller/ehci.h> 73#include <dev/usb/controller/ehcireg.h> 74 75 76static device_attach_t ehci_ebus_attach; 77static device_detach_t ehci_ebus_detach; |
78static device_shutdown_t ehci_ebus_shutdown; 79static device_suspend_t ehci_ebus_suspend; 80static device_resume_t ehci_ebus_resume; | |
81 | 78 |
82 | |
83static void *ih_err; 84 85#define EHCI_HC_DEVSTR "CNS11XX USB EHCI" 86#define USB_BRIDGE_INTR_MASK 0x214 87 88static int | 79static void *ih_err; 80 81#define EHCI_HC_DEVSTR "CNS11XX USB EHCI" 82#define USB_BRIDGE_INTR_MASK 0x214 83 84static int |
89ehci_ebus_suspend(device_t self) 90{ 91 ehci_softc_t *sc = device_get_softc(self); 92 int err; 93 94 err = bus_generic_suspend(self); 95 if (err) 96 return (err); 97 ehci_suspend(sc); 98 return (0); 99} 100 101static int 102ehci_ebus_resume(device_t self) 103{ 104 ehci_softc_t *sc = device_get_softc(self); 105 106 ehci_resume(sc); 107 108 bus_generic_resume(self); 109 110 return (0); 111} 112 113static int 114ehci_ebus_shutdown(device_t self) 115{ 116 ehci_softc_t *sc = device_get_softc(self); 117 int err; 118 119 err = bus_generic_shutdown(self); 120 if (err) 121 return (err); 122 ehci_shutdown(sc); 123 124 return (0); 125} 126 127static int | |
128ehci_ebus_probe(device_t self) 129{ 130 131 device_set_desc(self, EHCI_HC_DEVSTR); 132 133 return (BUS_PROBE_DEFAULT); 134} 135 --- 136 unchanged lines hidden (view full) --- 272 return (0); 273} 274 275static device_method_t ehci_methods[] = { 276 /* Device interface */ 277 DEVMETHOD(device_probe, ehci_ebus_probe), 278 DEVMETHOD(device_attach, ehci_ebus_attach), 279 DEVMETHOD(device_detach, ehci_ebus_detach), | 85ehci_ebus_probe(device_t self) 86{ 87 88 device_set_desc(self, EHCI_HC_DEVSTR); 89 90 return (BUS_PROBE_DEFAULT); 91} 92 --- 136 unchanged lines hidden (view full) --- 229 return (0); 230} 231 232static device_method_t ehci_methods[] = { 233 /* Device interface */ 234 DEVMETHOD(device_probe, ehci_ebus_probe), 235 DEVMETHOD(device_attach, ehci_ebus_attach), 236 DEVMETHOD(device_detach, ehci_ebus_detach), |
280 DEVMETHOD(device_suspend, ehci_ebus_suspend), 281 DEVMETHOD(device_resume, ehci_ebus_resume), 282 DEVMETHOD(device_shutdown, ehci_ebus_shutdown), | 237 DEVMETHOD(device_suspend, bus_generic_suspend), 238 DEVMETHOD(device_resume, bus_generic_resume), 239 DEVMETHOD(device_shutdown, bus_generic_shutdown), |
283 284 DEVMETHOD_END 285}; 286 287static driver_t ehci_driver = { | 240 241 DEVMETHOD_END 242}; 243 244static driver_t ehci_driver = { |
288 "ehci", 289 ehci_methods, 290 sizeof(ehci_softc_t), | 245 .name = "ehci", 246 .methods = ehci_methods, 247 .size = sizeof(ehci_softc_t), |
291}; 292 293static devclass_t ehci_devclass; 294 295DRIVER_MODULE(ehci, econaarm, ehci_driver, ehci_devclass, 0, 0); 296MODULE_DEPEND(ehci, usb, 1, 1, 1); | 248}; 249 250static devclass_t ehci_devclass; 251 252DRIVER_MODULE(ehci, econaarm, ehci_driver, ehci_devclass, 0, 0); 253MODULE_DEPEND(ehci, usb, 1, 1, 1); |