uss820dci_atmelarm.c (227849) | uss820dci_atmelarm.c (228483) |
---|---|
1#include <sys/cdefs.h> | 1#include <sys/cdefs.h> |
2__FBSDID("$FreeBSD: head/sys/dev/usb/controller/uss820dci_atmelarm.c 227849 2011-11-22 21:56:55Z hselasky $"); | 2__FBSDID("$FreeBSD: head/sys/dev/usb/controller/uss820dci_atmelarm.c 228483 2011-12-14 00:28:54Z hselasky $"); |
3 4/*- 5 * Copyright (c) 2008 Hans Petter Selasky <hselasky@FreeBSD.org> 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions 10 * are met: --- 47 unchanged lines hidden (view full) --- 58#include <dev/usb/usb_bus.h> 59#include <dev/usb/controller/uss820dci.h> 60 61#include <sys/rman.h> 62 63static device_probe_t uss820_atmelarm_probe; 64static device_attach_t uss820_atmelarm_attach; 65static device_detach_t uss820_atmelarm_detach; | 3 4/*- 5 * Copyright (c) 2008 Hans Petter Selasky <hselasky@FreeBSD.org> 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions 10 * are met: --- 47 unchanged lines hidden (view full) --- 58#include <dev/usb/usb_bus.h> 59#include <dev/usb/controller/uss820dci.h> 60 61#include <sys/rman.h> 62 63static device_probe_t uss820_atmelarm_probe; 64static device_attach_t uss820_atmelarm_attach; 65static device_detach_t uss820_atmelarm_detach; |
66static device_suspend_t uss820_atmelarm_suspend; 67static device_resume_t uss820_atmelarm_resume; 68static device_shutdown_t uss820_atmelarm_shutdown; | |
69 70static device_method_t uss820dci_methods[] = { 71 /* Device interface */ 72 DEVMETHOD(device_probe, uss820_atmelarm_probe), 73 DEVMETHOD(device_attach, uss820_atmelarm_attach), 74 DEVMETHOD(device_detach, uss820_atmelarm_detach), | 66 67static device_method_t uss820dci_methods[] = { 68 /* Device interface */ 69 DEVMETHOD(device_probe, uss820_atmelarm_probe), 70 DEVMETHOD(device_attach, uss820_atmelarm_attach), 71 DEVMETHOD(device_detach, uss820_atmelarm_detach), |
75 DEVMETHOD(device_suspend, uss820_atmelarm_suspend), 76 DEVMETHOD(device_resume, uss820_atmelarm_resume), 77 DEVMETHOD(device_shutdown, uss820_atmelarm_shutdown), | 72 DEVMETHOD(device_suspend, bus_generic_suspend), 73 DEVMETHOD(device_resume, bus_generic_resume), 74 DEVMETHOD(device_shutdown, bus_generic_shutdown), |
78 79 DEVMETHOD_END 80}; 81 82static driver_t uss820dci_driver = { 83 .name = "uss820", 84 .methods = uss820dci_methods, 85 .size = sizeof(struct uss820dci_softc), 86}; 87 88static devclass_t uss820dci_devclass; 89 90DRIVER_MODULE(uss820, atmelarm, uss820dci_driver, uss820dci_devclass, 0, 0); 91MODULE_DEPEND(uss820, usb, 1, 1, 1); 92 93static const char *const uss820_desc = "USS820 USB Device Controller"; 94 95static int | 75 76 DEVMETHOD_END 77}; 78 79static driver_t uss820dci_driver = { 80 .name = "uss820", 81 .methods = uss820dci_methods, 82 .size = sizeof(struct uss820dci_softc), 83}; 84 85static devclass_t uss820dci_devclass; 86 87DRIVER_MODULE(uss820, atmelarm, uss820dci_driver, uss820dci_devclass, 0, 0); 88MODULE_DEPEND(uss820, usb, 1, 1, 1); 89 90static const char *const uss820_desc = "USS820 USB Device Controller"; 91 92static int |
96uss820_atmelarm_suspend(device_t dev) 97{ 98 struct uss820dci_softc *sc = device_get_softc(dev); 99 int err; 100 101 err = bus_generic_suspend(dev); 102 if (err == 0) { 103 uss820dci_suspend(sc); 104 } 105 return (err); 106} 107 108static int 109uss820_atmelarm_resume(device_t dev) 110{ 111 struct uss820dci_softc *sc = device_get_softc(dev); 112 int err; 113 114 uss820dci_resume(sc); 115 116 err = bus_generic_resume(dev); 117 118 return (err); 119} 120 121static int 122uss820_atmelarm_shutdown(device_t dev) 123{ 124 struct uss820dci_softc *sc = device_get_softc(dev); 125 int err; 126 127 err = bus_generic_shutdown(dev); 128 if (err) 129 return (err); 130 131 uss820dci_uninit(sc); 132 133 return (0); 134} 135 136static int | |
137uss820_atmelarm_probe(device_t dev) 138{ 139 device_set_desc(dev, uss820_desc); 140 return (0); /* success */ 141} 142 143static int 144uss820_atmelarm_attach(device_t dev) --- 105 unchanged lines hidden --- | 93uss820_atmelarm_probe(device_t dev) 94{ 95 device_set_desc(dev, uss820_desc); 96 return (0); /* success */ 97} 98 99static int 100uss820_atmelarm_attach(device_t dev) --- 105 unchanged lines hidden --- |