Changeset View
Changeset View
Standalone View
Standalone View
sys/arm/ti/omap4/omap4_wugen.c
Show First 20 Lines • Show All 179 Lines • ▼ Show 20 Lines | |||||
static int | static int | ||||
omap4_wugen_attach(device_t dev) | omap4_wugen_attach(device_t dev) | ||||
{ | { | ||||
struct omap4_wugen_sc *sc; | struct omap4_wugen_sc *sc; | ||||
phandle_t node; | phandle_t node; | ||||
phandle_t parent_xref; | phandle_t parent_xref; | ||||
int rid, rv; | int rid, rv; | ||||
u_int irq_count; | |||||
sc = device_get_softc(dev); | sc = device_get_softc(dev); | ||||
sc->sc_dev = dev; | sc->sc_dev = dev; | ||||
node = ofw_bus_get_node(dev); | node = ofw_bus_get_node(dev); | ||||
rv = OF_getencprop(node, "interrupt-parent", &parent_xref, | rv = OF_getencprop(node, "interrupt-parent", &parent_xref, | ||||
sizeof(parent_xref)); | sizeof(parent_xref)); | ||||
if (rv <= 0) { | if (rv <= 0) { | ||||
Show All 9 Lines | omap4_wugen_attach(device_t dev) | ||||
rid = 0; | rid = 0; | ||||
sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, | sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, | ||||
RF_ACTIVE); | RF_ACTIVE); | ||||
if (sc->sc_mem_res == NULL) { | if (sc->sc_mem_res == NULL) { | ||||
device_printf(dev, "can't allocate resources\n"); | device_printf(dev, "can't allocate resources\n"); | ||||
return (ENXIO); | return (ENXIO); | ||||
} | } | ||||
if (intr_pic_register(dev, OF_xref_from_node(node)) != 0) { | if (intr_pic_intr_count(sc->sc_parent, &irq_count) != 0) { | ||||
device_printf(dev, | |||||
"unable to find interrupt parent interrupts\n"); | |||||
goto fail; | |||||
} | |||||
if (intr_pic_register(dev, OF_xref_from_node(node), irq_count) != 0) { | |||||
skra: This is pass-through PIC, so I suppose that no irq range is needed. And allocating some could… | |||||
andrewAuthorUnsubmitted Not Done Inline ActionsYes, I think so. I also think this driver only needs to implement the pic_map_intr function as the other pic_ functions will all use the parent interrupt controller in subr_intr.c. andrew: Yes, I think so. I also think this driver only needs to implement the `pic_map_intr` function… | |||||
device_printf(dev, "can't register PIC\n"); | device_printf(dev, "can't register PIC\n"); | ||||
goto fail; | goto fail; | ||||
} | } | ||||
return (0); | return (0); | ||||
fail: | fail: | ||||
omap4_wugen_detach(dev); | omap4_wugen_detach(dev); | ||||
return (ENXIO); | return (ENXIO); | ||||
Show All 29 Lines |
This is pass-through PIC, so I suppose that no irq range is needed. And allocating some could be quite wrong.