at91dci_atmelarm.c (227849) | at91dci_atmelarm.c (228483) |
---|---|
1#include <sys/cdefs.h> | 1#include <sys/cdefs.h> |
2__FBSDID("$FreeBSD: head/sys/dev/usb/controller/at91dci_atmelarm.c 227849 2011-11-22 21:56:55Z hselasky $"); | 2__FBSDID("$FreeBSD: head/sys/dev/usb/controller/at91dci_atmelarm.c 228483 2011-12-14 00:28:54Z hselasky $"); |
3 4/*- 5 * Copyright (c) 2007-2008 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 --- 61 unchanged lines hidden (view full) --- 72#define VBUS_BASE AT91RM92_PIOB_BASE 73 74#define PULLUP_MASK AT91C_PIO_PB22 75#define PULLUP_BASE AT91RM92_PIOB_BASE 76 77static device_probe_t at91_udp_probe; 78static device_attach_t at91_udp_attach; 79static device_detach_t at91_udp_detach; | 3 4/*- 5 * Copyright (c) 2007-2008 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 --- 61 unchanged lines hidden (view full) --- 72#define VBUS_BASE AT91RM92_PIOB_BASE 73 74#define PULLUP_MASK AT91C_PIO_PB22 75#define PULLUP_BASE AT91RM92_PIOB_BASE 76 77static device_probe_t at91_udp_probe; 78static device_attach_t at91_udp_attach; 79static device_detach_t at91_udp_detach; |
80static device_shutdown_t at91_udp_shutdown; | |
81 82struct at91_udp_softc { 83 struct at91dci_softc sc_dci; /* must be first */ 84 struct at91_pmc_clock *sc_iclk; 85 struct at91_pmc_clock *sc_fclk; 86 struct resource *sc_vbus_irq_res; 87 void *sc_vbus_intr_hdl; 88}; --- 230 unchanged lines hidden (view full) --- 319 at91_pmc_clock_disable(sc->sc_iclk); 320 at91_pmc_clock_disable(sc->sc_fclk); 321 at91_pmc_clock_deref(sc->sc_fclk); 322 at91_pmc_clock_deref(sc->sc_iclk); 323 324 return (0); 325} 326 | 80 81struct at91_udp_softc { 82 struct at91dci_softc sc_dci; /* must be first */ 83 struct at91_pmc_clock *sc_iclk; 84 struct at91_pmc_clock *sc_fclk; 85 struct resource *sc_vbus_irq_res; 86 void *sc_vbus_intr_hdl; 87}; --- 230 unchanged lines hidden (view full) --- 318 at91_pmc_clock_disable(sc->sc_iclk); 319 at91_pmc_clock_disable(sc->sc_fclk); 320 at91_pmc_clock_deref(sc->sc_fclk); 321 at91_pmc_clock_deref(sc->sc_iclk); 322 323 return (0); 324} 325 |
327static int 328at91_udp_shutdown(device_t dev) 329{ 330 struct at91_udp_softc *sc = device_get_softc(dev); 331 int err; 332 333 err = bus_generic_shutdown(dev); 334 if (err) 335 return (err); 336 337 at91dci_uninit(&sc->sc_dci); 338 339 return (0); 340} 341 | |
342static device_method_t at91_udp_methods[] = { 343 /* Device interface */ 344 DEVMETHOD(device_probe, at91_udp_probe), 345 DEVMETHOD(device_attach, at91_udp_attach), 346 DEVMETHOD(device_detach, at91_udp_detach), | 326static device_method_t at91_udp_methods[] = { 327 /* Device interface */ 328 DEVMETHOD(device_probe, at91_udp_probe), 329 DEVMETHOD(device_attach, at91_udp_attach), 330 DEVMETHOD(device_detach, at91_udp_detach), |
347 DEVMETHOD(device_shutdown, at91_udp_shutdown), | 331 DEVMETHOD(device_suspend, bus_generic_suspend), 332 DEVMETHOD(device_resume, bus_generic_resume), 333 DEVMETHOD(device_shutdown, bus_generic_shutdown), |
348 349 DEVMETHOD_END 350}; 351 352static driver_t at91_udp_driver = { | 334 335 DEVMETHOD_END 336}; 337 338static driver_t at91_udp_driver = { |
353 "at91_udp", 354 at91_udp_methods, 355 sizeof(struct at91_udp_softc), | 339 .name = "at91_udp", 340 .methods = at91_udp_methods, 341 .size = sizeof(struct at91_udp_softc), |
356}; 357 358static devclass_t at91_udp_devclass; 359 360DRIVER_MODULE(at91_udp, atmelarm, at91_udp_driver, at91_udp_devclass, 0, 0); | 342}; 343 344static devclass_t at91_udp_devclass; 345 346DRIVER_MODULE(at91_udp, atmelarm, at91_udp_driver, at91_udp_devclass, 0, 0); |