Changeset View
Changeset View
Standalone View
Standalone View
sys/arm/ti/omap4/omap4_wugen.c
Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | |||||
struct omap4_wugen_sc { | struct omap4_wugen_sc { | ||||
device_t sc_dev; | device_t sc_dev; | ||||
struct resource *sc_mem_res; | struct resource *sc_mem_res; | ||||
device_t sc_parent; | device_t sc_parent; | ||||
}; | }; | ||||
static int | static int | ||||
omap4_wugen_register(device_t dev, struct intr_irqsrc *isrc, | omap4_wugen_alloc_intr(device_t dev, struct intr_irqsrc *isrc, | ||||
boolean_t *is_percpu) | struct resource *res, struct intr_map_data *data) | ||||
{ | { | ||||
struct omap4_wugen_sc *sc = device_get_softc(dev); | struct omap4_wugen_sc *sc = device_get_softc(dev); | ||||
return (PIC_REGISTER(sc->sc_parent, isrc, is_percpu)); | return (PIC_ALLOC_INTR(sc->sc_parent, isrc, res, data)); | ||||
} | } | ||||
static int | static void | ||||
omap4_wugen_unregister(device_t dev, struct intr_irqsrc *isrc) | omap4_wugen_disable_intr(device_t dev, struct intr_irqsrc *isrc) | ||||
{ | { | ||||
struct omap4_wugen_sc *sc = device_get_softc(dev); | struct omap4_wugen_sc *sc = device_get_softc(dev); | ||||
return (PIC_UNREGISTER(sc->sc_parent, isrc)); | PIC_DISABLE_INTR(sc->sc_parent, isrc); | ||||
} | } | ||||
static void | static void | ||||
omap4_wugen_enable_source(device_t dev, struct intr_irqsrc *isrc) | omap4_wugen_enable_intr(device_t dev, struct intr_irqsrc *isrc) | ||||
{ | { | ||||
struct omap4_wugen_sc *sc = device_get_softc(dev); | struct omap4_wugen_sc *sc = device_get_softc(dev); | ||||
PIC_ENABLE_SOURCE(sc->sc_parent, isrc); | PIC_ENABLE_INTR(sc->sc_parent, isrc); | ||||
} | } | ||||
static void | static int | ||||
omap4_wugen_disable_source(device_t dev, struct intr_irqsrc *isrc) | omap4_wugen_map_intr(device_t dev, struct intr_map_data *data, | ||||
struct intr_irqsrc **isrcp) | |||||
{ | { | ||||
struct omap4_wugen_sc *sc = device_get_softc(dev); | struct omap4_wugen_sc *sc = device_get_softc(dev); | ||||
PIC_DISABLE_SOURCE(sc->sc_parent, isrc); | return (PIC_MAP_INTR(sc->sc_parent, data, isrcp)); | ||||
} | } | ||||
static void | static int | ||||
omap4_wugen_enable_intr(device_t dev, struct intr_irqsrc *isrc) | omap4_wugen_release_intr(device_t dev, struct intr_irqsrc *isrc, | ||||
struct resource *res, struct intr_map_data *data) | |||||
{ | { | ||||
struct omap4_wugen_sc *sc = device_get_softc(dev); | struct omap4_wugen_sc *sc = device_get_softc(dev); | ||||
PIC_ENABLE_INTR(sc->sc_parent, isrc); | return (PIC_RELEASE_INTR(sc->sc_parent, isrc, res, data)); | ||||
} | } | ||||
static int | |||||
omap4_wugen_setup_intr(device_t dev, struct intr_irqsrc *isrc, | |||||
struct resource *res, struct intr_map_data *data) | |||||
{ | |||||
struct omap4_wugen_sc *sc = device_get_softc(dev); | |||||
return (PIC_SETUP_INTR(sc->sc_parent, isrc, res, data)); | |||||
} | |||||
static int | |||||
omap4_wugen_teardown_intr(device_t dev, struct intr_irqsrc *isrc, | |||||
struct resource *res, struct intr_map_data *data) | |||||
{ | |||||
struct omap4_wugen_sc *sc = device_get_softc(dev); | |||||
return (PIC_TEARDOWN_INTR(sc->sc_parent, isrc, res, data)); | |||||
} | |||||
static void | static void | ||||
omap4_wugen_pre_ithread(device_t dev, struct intr_irqsrc *isrc) | omap4_wugen_pre_ithread(device_t dev, struct intr_irqsrc *isrc) | ||||
{ | { | ||||
struct omap4_wugen_sc *sc = device_get_softc(dev); | struct omap4_wugen_sc *sc = device_get_softc(dev); | ||||
PIC_PRE_ITHREAD(sc->sc_parent, isrc); | PIC_PRE_ITHREAD(sc->sc_parent, isrc); | ||||
} | } | ||||
Show All 11 Lines | |||||
{ | { | ||||
struct omap4_wugen_sc *sc = device_get_softc(dev); | struct omap4_wugen_sc *sc = device_get_softc(dev); | ||||
PIC_POST_FILTER(sc->sc_parent, isrc); | PIC_POST_FILTER(sc->sc_parent, isrc); | ||||
} | } | ||||
#ifdef SMP | #ifdef SMP | ||||
static int | static int | ||||
omap4_wugen_bind(device_t dev, struct intr_irqsrc *isrc) | omap4_wugen_bind_intr(device_t dev, struct intr_irqsrc *isrc) | ||||
{ | { | ||||
struct omap4_wugen_sc *sc = device_get_softc(dev); | struct omap4_wugen_sc *sc = device_get_softc(dev); | ||||
return (PIC_BIND(sc->sc_parent, isrc)); | return (PIC_BIND_INTR(sc->sc_parent, isrc)); | ||||
} | } | ||||
#endif | #endif | ||||
static int | static int | ||||
omap4_wugen_probe(device_t dev) | omap4_wugen_probe(device_t dev) | ||||
{ | { | ||||
if (!ofw_bus_status_okay(dev)) | if (!ofw_bus_status_okay(dev)) | ||||
▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
static device_method_t omap4_wugen_methods[] = { | static device_method_t omap4_wugen_methods[] = { | ||||
DEVMETHOD(device_probe, omap4_wugen_probe), | DEVMETHOD(device_probe, omap4_wugen_probe), | ||||
DEVMETHOD(device_attach, omap4_wugen_attach), | DEVMETHOD(device_attach, omap4_wugen_attach), | ||||
DEVMETHOD(device_detach, omap4_wugen_detach), | DEVMETHOD(device_detach, omap4_wugen_detach), | ||||
/* Interrupt controller interface */ | /* Interrupt controller interface */ | ||||
DEVMETHOD(pic_register, omap4_wugen_register), | DEVMETHOD(pic_alloc_intr, omap4_wugen_alloc_intr), | ||||
DEVMETHOD(pic_unregister, omap4_wugen_unregister), | DEVMETHOD(pic_disable_intr, omap4_wugen_disable_intr), | ||||
DEVMETHOD(pic_enable_source, omap4_wugen_enable_source), | |||||
DEVMETHOD(pic_disable_source, omap4_wugen_disable_source), | |||||
DEVMETHOD(pic_enable_intr, omap4_wugen_enable_intr), | DEVMETHOD(pic_enable_intr, omap4_wugen_enable_intr), | ||||
DEVMETHOD(pic_map_intr, omap4_wugen_map_intr), | |||||
DEVMETHOD(pic_release_intr, omap4_wugen_release_intr), | |||||
DEVMETHOD(pic_setup_intr, omap4_wugen_setup_intr), | |||||
DEVMETHOD(pic_teardown_intr, omap4_wugen_teardown_intr), | |||||
DEVMETHOD(pic_pre_ithread, omap4_wugen_pre_ithread), | DEVMETHOD(pic_pre_ithread, omap4_wugen_pre_ithread), | ||||
DEVMETHOD(pic_post_ithread, omap4_wugen_post_ithread), | DEVMETHOD(pic_post_ithread, omap4_wugen_post_ithread), | ||||
DEVMETHOD(pic_post_filter, omap4_wugen_post_filter), | DEVMETHOD(pic_post_filter, omap4_wugen_post_filter), | ||||
#ifdef SMP | #ifdef SMP | ||||
DEVMETHOD(pic_bind, omap4_wugen_bind), | DEVMETHOD(pic_bind_intr, omap4_wugen_bind_intr), | ||||
#endif | #endif | ||||
DEVMETHOD_END | DEVMETHOD_END | ||||
}; | }; | ||||
devclass_t omap4_wugen_devclass; | devclass_t omap4_wugen_devclass; | ||||
DEFINE_CLASS_0(omap4_wugen, omap4_wugen_driver, omap4_wugen_methods, | DEFINE_CLASS_0(omap4_wugen, omap4_wugen_driver, omap4_wugen_methods, | ||||
sizeof(struct omap4_wugen_sc)); | sizeof(struct omap4_wugen_sc)); | ||||
EARLY_DRIVER_MODULE(omap4_wugen, simplebus, omap4_wugen_driver, | EARLY_DRIVER_MODULE(omap4_wugen, simplebus, omap4_wugen_driver, | ||||
omap4_wugen_devclass, NULL, NULL, | omap4_wugen_devclass, NULL, NULL, | ||||
BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE + 1); | BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE + 1); |