atmegadci_atmelarm.c (227849) | atmegadci_atmelarm.c (228483) |
---|---|
1#include <sys/cdefs.h> | 1#include <sys/cdefs.h> |
2__FBSDID("$FreeBSD: head/sys/dev/usb/controller/atmegadci_atmelarm.c 227849 2011-11-22 21:56:55Z hselasky $"); | 2__FBSDID("$FreeBSD: head/sys/dev/usb/controller/atmegadci_atmelarm.c 228483 2011-12-14 00:28:54Z hselasky $"); |
3 4/*- 5 * Copyright (c) 2009 Hans Petter Selasky. All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 1. Redistributions of source code must retain the above copyright --- 46 unchanged lines hidden (view full) --- 57#include <dev/usb/usb_bus.h> 58#include <dev/usb/controller/atmegadci.h> 59 60#include <sys/rman.h> 61 62static device_probe_t atmegadci_probe; 63static device_attach_t atmegadci_attach; 64static device_detach_t atmegadci_detach; | 3 4/*- 5 * Copyright (c) 2009 Hans Petter Selasky. All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 1. Redistributions of source code must retain the above copyright --- 46 unchanged lines hidden (view full) --- 57#include <dev/usb/usb_bus.h> 58#include <dev/usb/controller/atmegadci.h> 59 60#include <sys/rman.h> 61 62static device_probe_t atmegadci_probe; 63static device_attach_t atmegadci_attach; 64static device_detach_t atmegadci_detach; |
65static device_shutdown_t atmegadci_shutdown; | |
66 67struct atmegadci_super_softc { 68 struct atmegadci_softc sc_otg; /* must be first */ 69}; 70 71static void 72atmegadci_clocks_on(struct usb_bus *bus) 73{ --- 114 unchanged lines hidden (view full) --- 188 sc->sc_otg.sc_io_res); 189 sc->sc_otg.sc_io_res = NULL; 190 } 191 usb_bus_mem_free_all(&sc->sc_otg.sc_bus, NULL); 192 193 return (0); 194} 195 | 65 66struct atmegadci_super_softc { 67 struct atmegadci_softc sc_otg; /* must be first */ 68}; 69 70static void 71atmegadci_clocks_on(struct usb_bus *bus) 72{ --- 114 unchanged lines hidden (view full) --- 187 sc->sc_otg.sc_io_res); 188 sc->sc_otg.sc_io_res = NULL; 189 } 190 usb_bus_mem_free_all(&sc->sc_otg.sc_bus, NULL); 191 192 return (0); 193} 194 |
196static int 197atmegadci_shutdown(device_t dev) 198{ 199 struct atmegadci_super_softc *sc = device_get_softc(dev); 200 int err; 201 202 err = bus_generic_shutdown(dev); 203 if (err) 204 return (err); 205 206 atmegadci_uninit(&sc->sc_otg); 207 208 return (0); 209} 210 | |
211static device_method_t atmegadci_methods[] = { 212 /* Device interface */ 213 DEVMETHOD(device_probe, atmegadci_probe), 214 DEVMETHOD(device_attach, atmegadci_attach), 215 DEVMETHOD(device_detach, atmegadci_detach), | 195static device_method_t atmegadci_methods[] = { 196 /* Device interface */ 197 DEVMETHOD(device_probe, atmegadci_probe), 198 DEVMETHOD(device_attach, atmegadci_attach), 199 DEVMETHOD(device_detach, atmegadci_detach), |
216 DEVMETHOD(device_shutdown, atmegadci_shutdown), | 200 DEVMETHOD(device_suspend, bus_generic_suspend), 201 DEVMETHOD(device_resume, bus_generic_resume), 202 DEVMETHOD(device_shutdown, bus_generic_shutdown), |
217 218 DEVMETHOD_END 219}; 220 221static driver_t atmegadci_driver = { | 203 204 DEVMETHOD_END 205}; 206 207static driver_t atmegadci_driver = { |
222 "atmegadci", 223 atmegadci_methods, 224 sizeof(struct atmegadci_super_softc), | 208 .name = "atmegadci", 209 .methods = atmegadci_methods, 210 .size = sizeof(struct atmegadci_super_softc), |
225}; 226 227static devclass_t atmegadci_devclass; 228 229DRIVER_MODULE(atmegadci, atmelarm, atmegadci_driver, atmegadci_devclass, 0, 0); 230MODULE_DEPEND(atmegadci, usb, 1, 1, 1); | 211}; 212 213static devclass_t atmegadci_devclass; 214 215DRIVER_MODULE(atmegadci, atmelarm, atmegadci_driver, atmegadci_devclass, 0, 0); 216MODULE_DEPEND(atmegadci, usb, 1, 1, 1); |