summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/controller
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/usb/controller')
-rw-r--r--sys/dev/usb/controller/dwc_otg_fdt.c18
-rw-r--r--sys/dev/usb/controller/dwc_otg_fdt.h39
2 files changed, 46 insertions, 11 deletions
diff --git a/sys/dev/usb/controller/dwc_otg_fdt.c b/sys/dev/usb/controller/dwc_otg_fdt.c
index a6209ff..73df72e 100644
--- a/sys/dev/usb/controller/dwc_otg_fdt.c
+++ b/sys/dev/usb/controller/dwc_otg_fdt.c
@@ -53,15 +53,11 @@ __FBSDID("$FreeBSD$");
#include <dev/usb/usb_bus.h>
#include <dev/usb/controller/dwc_otg.h>
+#include <dev/usb/controller/dwc_otg_fdt.h>
static device_probe_t dwc_otg_probe;
-static device_attach_t dwc_otg_attach;
static device_detach_t dwc_otg_detach;
-struct dwc_otg_super_softc {
- struct dwc_otg_softc sc_otg; /* must be first */
-};
-
static int
dwc_otg_probe(device_t dev)
{
@@ -74,13 +70,13 @@ dwc_otg_probe(device_t dev)
device_set_desc(dev, "DWC OTG 2.0 integrated USB controller");
- return (0);
+ return (BUS_PROBE_DEFAULT);
}
-static int
+int
dwc_otg_attach(device_t dev)
{
- struct dwc_otg_super_softc *sc = device_get_softc(dev);
+ struct dwc_otg_fdt_softc *sc = device_get_softc(dev);
char usb_mode[24];
int err;
int rid;
@@ -161,7 +157,7 @@ error:
static int
dwc_otg_detach(device_t dev)
{
- struct dwc_otg_super_softc *sc = device_get_softc(dev);
+ struct dwc_otg_fdt_softc *sc = device_get_softc(dev);
device_t bdev;
int err;
@@ -212,10 +208,10 @@ static device_method_t dwc_otg_methods[] = {
DEVMETHOD_END
};
-static driver_t dwc_otg_driver = {
+driver_t dwc_otg_driver = {
.name = "dwcotg",
.methods = dwc_otg_methods,
- .size = sizeof(struct dwc_otg_super_softc),
+ .size = sizeof(struct dwc_otg_fdt_softc),
};
static devclass_t dwc_otg_devclass;
diff --git a/sys/dev/usb/controller/dwc_otg_fdt.h b/sys/dev/usb/controller/dwc_otg_fdt.h
new file mode 100644
index 0000000..9e01118
--- /dev/null
+++ b/sys/dev/usb/controller/dwc_otg_fdt.h
@@ -0,0 +1,39 @@
+/*-
+ * Copyright (c) 2012 Hans Petter Selasky. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _DWC_OTG_FDT_H_
+#define _DWC_OTG_FDT_H_
+
+struct dwc_otg_fdt_softc {
+ struct dwc_otg_softc sc_otg; /* must be first */
+};
+
+extern driver_t dwc_otg_driver;
+
+device_attach_t dwc_otg_attach;
+
+#endif
OpenPOWER on IntegriCloud