Deleted Added
full compact
xls_ehci.c (227849) xls_ehci.c (228483)
1/*-
2 * Copyright (c) 1998 The NetBSD Foundation, Inc.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to The NetBSD Foundation
6 * by Lennart Augustsson (augustss@carlstedt.se) at
7 * Carlstedt Research & Technology.
8 *

--- 15 unchanged lines hidden (view full) ---

24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 * POSSIBILITY OF SUCH DAMAGE.
29 */
30
31#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1998 The NetBSD Foundation, Inc.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to The NetBSD Foundation
6 * by Lennart Augustsson (augustss@carlstedt.se) at
7 * Carlstedt Research & Technology.
8 *

--- 15 unchanged lines hidden (view full) ---

24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 * POSSIBILITY OF SUCH DAMAGE.
29 */
30
31#include <sys/cdefs.h>
32__FBSDID("$FreeBSD: head/sys/mips/rmi/xls_ehci.c 227849 2011-11-22 21:56:55Z hselasky $");
32__FBSDID("$FreeBSD: head/sys/mips/rmi/xls_ehci.c 228483 2011-12-14 00:28:54Z hselasky $");
33
34#include "opt_bus.h"
35
36#include <sys/stdint.h>
37#include <sys/stddef.h>
38#include <sys/param.h>
39#include <sys/queue.h>
40#include <sys/types.h>

--- 23 unchanged lines hidden (view full) ---

64#include <dev/usb/usb_util.h>
65
66#include <dev/usb/usb_controller.h>
67#include <dev/usb/usb_bus.h>
68#include <dev/usb/controller/ehci.h>
69#include <dev/usb/controller/ehcireg.h>
70#include <mips/rmi/pic.h>
71
33
34#include "opt_bus.h"
35
36#include <sys/stdint.h>
37#include <sys/stddef.h>
38#include <sys/param.h>
39#include <sys/queue.h>
40#include <sys/types.h>

--- 23 unchanged lines hidden (view full) ---

64#include <dev/usb/usb_util.h>
65
66#include <dev/usb/usb_controller.h>
67#include <dev/usb/usb_bus.h>
68#include <dev/usb/controller/ehci.h>
69#include <dev/usb/controller/ehcireg.h>
70#include <mips/rmi/pic.h>
71
72static int ehci_xls_attach(device_t self);
73static int ehci_xls_detach(device_t self);
74static int ehci_xls_shutdown(device_t self);
75static int ehci_xls_suspend(device_t self);
76static int ehci_xls_resume(device_t self);
72static device_attach_t ehci_xls_attach;
73static device_detach_t ehci_xls_detach;
77
74
78static int
79ehci_xls_suspend(device_t self)
80{
81 ehci_softc_t *sc = device_get_softc(self);
82 int err;
83
84 err = bus_generic_suspend(self);
85 if (err)
86 return (err);
87 ehci_suspend(sc);
88 return (0);
89}
90
91static int
92ehci_xls_resume(device_t self)
93{
94 ehci_softc_t *sc = device_get_softc(self);
95
96 ehci_resume(sc);
97
98 bus_generic_resume(self);
99
100 return (0);
101}
102
103static int
104ehci_xls_shutdown(device_t self)
105{
106 ehci_softc_t *sc = device_get_softc(self);
107 int err;
108
109 err = bus_generic_shutdown(self);
110 if (err)
111 return (err);
112 ehci_shutdown(sc);
113
114 return (0);
115}
116
117static const char *xlr_usb_dev_desc = "RMI XLR USB 2.0 controller";
118static const char *xlr_vendor_desc = "RMI Corp";
119
120static int
121ehci_xls_probe(device_t self)
122{
123 /* TODO see if usb is enabled on the board */
124 device_set_desc(self, xlr_usb_dev_desc);

--- 118 unchanged lines hidden (view full) ---

243 return (0);
244}
245
246static device_method_t ehci_methods[] = {
247 /* Device interface */
248 DEVMETHOD(device_probe, ehci_xls_probe),
249 DEVMETHOD(device_attach, ehci_xls_attach),
250 DEVMETHOD(device_detach, ehci_xls_detach),
75static const char *xlr_usb_dev_desc = "RMI XLR USB 2.0 controller";
76static const char *xlr_vendor_desc = "RMI Corp";
77
78static int
79ehci_xls_probe(device_t self)
80{
81 /* TODO see if usb is enabled on the board */
82 device_set_desc(self, xlr_usb_dev_desc);

--- 118 unchanged lines hidden (view full) ---

201 return (0);
202}
203
204static device_method_t ehci_methods[] = {
205 /* Device interface */
206 DEVMETHOD(device_probe, ehci_xls_probe),
207 DEVMETHOD(device_attach, ehci_xls_attach),
208 DEVMETHOD(device_detach, ehci_xls_detach),
251 DEVMETHOD(device_suspend, ehci_xls_suspend),
252 DEVMETHOD(device_resume, ehci_xls_resume),
253 DEVMETHOD(device_shutdown, ehci_xls_shutdown),
209 DEVMETHOD(device_suspend, bus_generic_suspend),
210 DEVMETHOD(device_resume, bus_generic_resume),
211 DEVMETHOD(device_shutdown, bus_generic_shutdown),
254
255 DEVMETHOD_END
256};
257
258static driver_t ehci_driver = {
212
213 DEVMETHOD_END
214};
215
216static driver_t ehci_driver = {
259 "ehci",
260 ehci_methods,
261 sizeof(struct ehci_softc),
217 .name = "ehci",
218 .methods = ehci_methods,
219 .size = sizeof(struct ehci_softc),
262};
263
264static devclass_t ehci_devclass;
265
266DRIVER_MODULE(ehci, iodi, ehci_driver, ehci_devclass, 0, 0);
267MODULE_DEPEND(ehci, usb, 1, 1, 1);
220};
221
222static devclass_t ehci_devclass;
223
224DRIVER_MODULE(ehci, iodi, ehci_driver, ehci_devclass, 0, 0);
225MODULE_DEPEND(ehci, usb, 1, 1, 1);