Deleted Added
full compact
omap4_wugen.c (302408) omap4_wugen.c (308333)
1/*-
2 * Copyright (c) 2016 Svatopluk Kraus
3 * Copyright (c) 2016 Michal Meloun
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 12 unchanged lines hidden (view full) ---

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2016 Svatopluk Kraus
3 * Copyright (c) 2016 Michal Meloun
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 12 unchanged lines hidden (view full) ---

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
29__FBSDID("$FreeBSD: stable/11/sys/arm/ti/omap4/omap4_wugen.c 300149 2016-05-18 15:05:44Z andrew $");
29__FBSDID("$FreeBSD: stable/11/sys/arm/ti/omap4/omap4_wugen.c 308333 2016-11-05 10:23:02Z mmel $");
30
31#include <sys/param.h>
32#include <sys/bus.h>
33#include <sys/conf.h>
34#include <sys/kernel.h>
35#include <sys/module.h>
36#include <sys/rman.h>
37#include <sys/systm.h>

--- 14 unchanged lines hidden (view full) ---

52
53struct omap4_wugen_sc {
54 device_t sc_dev;
55 struct resource *sc_mem_res;
56 device_t sc_parent;
57};
58
59static int
30
31#include <sys/param.h>
32#include <sys/bus.h>
33#include <sys/conf.h>
34#include <sys/kernel.h>
35#include <sys/module.h>
36#include <sys/rman.h>
37#include <sys/systm.h>

--- 14 unchanged lines hidden (view full) ---

52
53struct omap4_wugen_sc {
54 device_t sc_dev;
55 struct resource *sc_mem_res;
56 device_t sc_parent;
57};
58
59static int
60omap4_wugen_alloc_intr(device_t dev, struct intr_irqsrc *isrc,
60omap4_wugen_activate_intr(device_t dev, struct intr_irqsrc *isrc,
61 struct resource *res, struct intr_map_data *data)
62{
63 struct omap4_wugen_sc *sc = device_get_softc(dev);
64
61 struct resource *res, struct intr_map_data *data)
62{
63 struct omap4_wugen_sc *sc = device_get_softc(dev);
64
65 return (PIC_ALLOC_INTR(sc->sc_parent, isrc, res, data));
65 return (PIC_ACTIVATE_INTR(sc->sc_parent, isrc, res, data));
66}
67
68static void
69omap4_wugen_disable_intr(device_t dev, struct intr_irqsrc *isrc)
70{
71 struct omap4_wugen_sc *sc = device_get_softc(dev);
72
73 PIC_DISABLE_INTR(sc->sc_parent, isrc);

--- 12 unchanged lines hidden (view full) ---

86 struct intr_irqsrc **isrcp)
87{
88 struct omap4_wugen_sc *sc = device_get_softc(dev);
89
90 return (PIC_MAP_INTR(sc->sc_parent, data, isrcp));
91}
92
93static int
66}
67
68static void
69omap4_wugen_disable_intr(device_t dev, struct intr_irqsrc *isrc)
70{
71 struct omap4_wugen_sc *sc = device_get_softc(dev);
72
73 PIC_DISABLE_INTR(sc->sc_parent, isrc);

--- 12 unchanged lines hidden (view full) ---

86 struct intr_irqsrc **isrcp)
87{
88 struct omap4_wugen_sc *sc = device_get_softc(dev);
89
90 return (PIC_MAP_INTR(sc->sc_parent, data, isrcp));
91}
92
93static int
94omap4_wugen_release_intr(device_t dev, struct intr_irqsrc *isrc,
94omap4_wugen_deactivate_intr(device_t dev, struct intr_irqsrc *isrc,
95 struct resource *res, struct intr_map_data *data)
96{
97 struct omap4_wugen_sc *sc = device_get_softc(dev);
98
95 struct resource *res, struct intr_map_data *data)
96{
97 struct omap4_wugen_sc *sc = device_get_softc(dev);
98
99 return (PIC_RELEASE_INTR(sc->sc_parent, isrc, res, data));
99 return (PIC_DEACTIVATE_INTR(sc->sc_parent, isrc, res, data));
100}
101
102static int
103omap4_wugen_setup_intr(device_t dev, struct intr_irqsrc *isrc,
104 struct resource *res, struct intr_map_data *data)
105{
106 struct omap4_wugen_sc *sc = device_get_softc(dev);
107

--- 114 unchanged lines hidden (view full) ---

222}
223
224static device_method_t omap4_wugen_methods[] = {
225 DEVMETHOD(device_probe, omap4_wugen_probe),
226 DEVMETHOD(device_attach, omap4_wugen_attach),
227 DEVMETHOD(device_detach, omap4_wugen_detach),
228
229 /* Interrupt controller interface */
100}
101
102static int
103omap4_wugen_setup_intr(device_t dev, struct intr_irqsrc *isrc,
104 struct resource *res, struct intr_map_data *data)
105{
106 struct omap4_wugen_sc *sc = device_get_softc(dev);
107

--- 114 unchanged lines hidden (view full) ---

222}
223
224static device_method_t omap4_wugen_methods[] = {
225 DEVMETHOD(device_probe, omap4_wugen_probe),
226 DEVMETHOD(device_attach, omap4_wugen_attach),
227 DEVMETHOD(device_detach, omap4_wugen_detach),
228
229 /* Interrupt controller interface */
230 DEVMETHOD(pic_alloc_intr, omap4_wugen_alloc_intr),
230 DEVMETHOD(pic_activate_intr, omap4_wugen_activate_intr),
231 DEVMETHOD(pic_disable_intr, omap4_wugen_disable_intr),
232 DEVMETHOD(pic_enable_intr, omap4_wugen_enable_intr),
233 DEVMETHOD(pic_map_intr, omap4_wugen_map_intr),
231 DEVMETHOD(pic_disable_intr, omap4_wugen_disable_intr),
232 DEVMETHOD(pic_enable_intr, omap4_wugen_enable_intr),
233 DEVMETHOD(pic_map_intr, omap4_wugen_map_intr),
234 DEVMETHOD(pic_release_intr, omap4_wugen_release_intr),
234 DEVMETHOD(pic_deactivate_intr, omap4_wugen_deactivate_intr),
235 DEVMETHOD(pic_setup_intr, omap4_wugen_setup_intr),
236 DEVMETHOD(pic_teardown_intr, omap4_wugen_teardown_intr),
237 DEVMETHOD(pic_pre_ithread, omap4_wugen_pre_ithread),
238 DEVMETHOD(pic_post_ithread, omap4_wugen_post_ithread),
239 DEVMETHOD(pic_post_filter, omap4_wugen_post_filter),
240#ifdef SMP
241 DEVMETHOD(pic_bind_intr, omap4_wugen_bind_intr),
242#endif
243 DEVMETHOD_END
244};
245devclass_t omap4_wugen_devclass;
246DEFINE_CLASS_0(omap4_wugen, omap4_wugen_driver, omap4_wugen_methods,
247 sizeof(struct omap4_wugen_sc));
248EARLY_DRIVER_MODULE(omap4_wugen, simplebus, omap4_wugen_driver,
249 omap4_wugen_devclass, NULL, NULL,
250 BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE + 1);
235 DEVMETHOD(pic_setup_intr, omap4_wugen_setup_intr),
236 DEVMETHOD(pic_teardown_intr, omap4_wugen_teardown_intr),
237 DEVMETHOD(pic_pre_ithread, omap4_wugen_pre_ithread),
238 DEVMETHOD(pic_post_ithread, omap4_wugen_post_ithread),
239 DEVMETHOD(pic_post_filter, omap4_wugen_post_filter),
240#ifdef SMP
241 DEVMETHOD(pic_bind_intr, omap4_wugen_bind_intr),
242#endif
243 DEVMETHOD_END
244};
245devclass_t omap4_wugen_devclass;
246DEFINE_CLASS_0(omap4_wugen, omap4_wugen_driver, omap4_wugen_methods,
247 sizeof(struct omap4_wugen_sc));
248EARLY_DRIVER_MODULE(omap4_wugen, simplebus, omap4_wugen_driver,
249 omap4_wugen_devclass, NULL, NULL,
250 BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE + 1);