Lines Matching refs:dev
1 /* $FreeBSD: releng/11.0/sys/dev/usb/controller/saf1761_otg_fdt.c 276717 2015-01-05 20:22:18Z hselasky $ */
55 #include <dev/fdt/fdt_common.h>
57 #include <dev/ofw/openfirm.h>
58 #include <dev/ofw/ofw_bus.h>
59 #include <dev/ofw/ofw_bus_subr.h>
61 #include <dev/usb/usb.h>
62 #include <dev/usb/usbdi.h>
64 #include <dev/usb/usb_core.h>
65 #include <dev/usb/usb_busdma.h>
66 #include <dev/usb/usb_process.h>
67 #include <dev/usb/usb_transfer.h>
68 #include <dev/usb/usb_device.h>
69 #include <dev/usb/usb_hub.h>
70 #include <dev/usb/usb_util.h>
72 #include <dev/usb/usb_controller.h>
73 #include <dev/usb/usb_bus.h>
76 #include <dev/usb/controller/saf1761_otg.h>
77 #include <dev/usb/controller/saf1761_otg_reg.h>
107 saf1761_otg_fdt_probe(device_t dev)
109 if (!ofw_bus_status_okay(dev))
112 if (!ofw_bus_is_compatible(dev, "nxp,usb-isp1761"))
115 device_set_desc(dev, "ISP1761/SAF1761 DCI USB 2.0 Device Controller");
121 saf1761_otg_fdt_attach(device_t dev)
123 struct saf1761_otg_softc *sc = device_get_softc(dev);
131 if (OF_getprop(ofw_bus_get_node(dev), "bus-width",
142 if (OF_getprop(ofw_bus_get_node(dev), "analog-oc",
148 if (OF_getprop(ofw_bus_get_node(dev), "dack-polarity",
154 if (OF_getprop(ofw_bus_get_node(dev), "dreq-polarity",
160 if (OF_getprop(ofw_bus_get_node(dev), "int-polarity",
167 if (OF_getprop(ofw_bus_get_node(dev), "int-level",
174 sc->sc_bus.parent = dev;
181 USB_GET_DMA_TAG(dev), NULL)) {
186 bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE);
197 sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
202 sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
208 sc->sc_bus.bdev = device_add_child(dev, "usbus", -1);
214 err = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_TTY | INTR_MPSAFE,
222 device_printf(dev, "Init failed\n");
227 device_printf(dev, "USB probe and attach failed\n");
233 saf1761_otg_fdt_detach(dev);
238 saf1761_otg_fdt_detach(device_t dev)
240 struct saf1761_otg_softc *sc = device_get_softc(dev);
247 device_delete_child(dev, bdev);
250 device_delete_children(dev);
258 err = bus_teardown_intr(dev, sc->sc_irq_res,
263 bus_release_resource(dev, SYS_RES_IRQ, 0,
268 bus_release_resource(dev, SYS_RES_MEMORY, 0,