aintc.c (cd642c88a1957179fdc6843a6c7bd04ca238d625) | aintc.c (9346e9130d7ae72b1a6fadb36de85c835074b883) |
---|---|
1/*- 2 * Copyright (c) 2012 Damjan Marion <dmarion@Freebsd.org> 3 * All rights reserved. 4 * 5 * Based on OMAP3 INTC code by Ben Gray 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 206 unchanged lines hidden (view full) --- 215{ 216 217 ti_aintc_irq_eoi(device_get_softc(dev)); 218} 219 220static int 221ti_aintc_pic_attach(struct ti_aintc_softc *sc) 222{ | 1/*- 2 * Copyright (c) 2012 Damjan Marion <dmarion@Freebsd.org> 3 * All rights reserved. 4 * 5 * Based on OMAP3 INTC code by Ben Gray 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 206 unchanged lines hidden (view full) --- 215{ 216 217 ti_aintc_irq_eoi(device_get_softc(dev)); 218} 219 220static int 221ti_aintc_pic_attach(struct ti_aintc_softc *sc) 222{ |
223 struct intr_pic *pic; |
|
223 int error; 224 uint32_t irq; 225 const char *name; 226 intptr_t xref; 227 228 name = device_get_nameunit(sc->sc_dev); 229 for (irq = 0; irq < INTC_NIRQS; irq++) { 230 sc->aintc_isrcs[irq].tai_irq = irq; 231 232 error = intr_isrc_register(&sc->aintc_isrcs[irq].tai_isrc, 233 sc->sc_dev, 0, "%s,%u", name, irq); 234 if (error != 0) 235 return (error); 236 } 237 238 xref = OF_xref_from_node(ofw_bus_get_node(sc->sc_dev)); | 224 int error; 225 uint32_t irq; 226 const char *name; 227 intptr_t xref; 228 229 name = device_get_nameunit(sc->sc_dev); 230 for (irq = 0; irq < INTC_NIRQS; irq++) { 231 sc->aintc_isrcs[irq].tai_irq = irq; 232 233 error = intr_isrc_register(&sc->aintc_isrcs[irq].tai_isrc, 234 sc->sc_dev, 0, "%s,%u", name, irq); 235 if (error != 0) 236 return (error); 237 } 238 239 xref = OF_xref_from_node(ofw_bus_get_node(sc->sc_dev)); |
239 error = intr_pic_register(sc->sc_dev, xref); 240 if (error != 0) 241 return (error); | 240 pic = intr_pic_register(sc->sc_dev, xref); 241 if (pic == NULL) 242 return (ENXIO); |
242 243 return (intr_pic_claim_root(sc->sc_dev, xref, ti_aintc_intr, sc, 0)); 244} 245 246#else 247static void 248aintc_post_filter(void *arg) 249{ --- 133 unchanged lines hidden --- | 243 244 return (intr_pic_claim_root(sc->sc_dev, xref, ti_aintc_intr, sc, 0)); 245} 246 247#else 248static void 249aintc_post_filter(void *arg) 250{ --- 133 unchanged lines hidden --- |