tegra_lic.c (302408) | tegra_lic.c (308333) |
---|---|
1/*- 2 * Copyright (c) 2016 Michal Meloun <mmel@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2016 Michal Meloun <mmel@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: stable/11/sys/arm/nvidia/tegra_lic.c 300149 2016-05-18 15:05:44Z andrew $"); | 28__FBSDID("$FreeBSD: stable/11/sys/arm/nvidia/tegra_lic.c 308333 2016-11-05 10:23:02Z mmel $"); |
29 30/* 31 * Local interrupt controller driver for Tegra SoCs. 32 */ 33#include <sys/param.h> 34#include <sys/module.h> 35#include <sys/systm.h> 36#include <sys/bus.h> --- 46 unchanged lines hidden (view full) --- 83 84struct tegra_lic_sc { 85 device_t dev; 86 struct resource *mem_res[nitems(lic_spec)]; 87 device_t parent; 88}; 89 90static int | 29 30/* 31 * Local interrupt controller driver for Tegra SoCs. 32 */ 33#include <sys/param.h> 34#include <sys/module.h> 35#include <sys/systm.h> 36#include <sys/bus.h> --- 46 unchanged lines hidden (view full) --- 83 84struct tegra_lic_sc { 85 device_t dev; 86 struct resource *mem_res[nitems(lic_spec)]; 87 device_t parent; 88}; 89 90static int |
91tegra_lic_alloc_intr(device_t dev, struct intr_irqsrc *isrc, | 91tegra_lic_activate_intr(device_t dev, struct intr_irqsrc *isrc, |
92 struct resource *res, struct intr_map_data *data) 93{ 94 struct tegra_lic_sc *sc = device_get_softc(dev); 95 | 92 struct resource *res, struct intr_map_data *data) 93{ 94 struct tegra_lic_sc *sc = device_get_softc(dev); 95 |
96 return (PIC_ALLOC_INTR(sc->parent, isrc, res, data)); | 96 return (PIC_ACTIVATE_INTR(sc->parent, isrc, res, data)); |
97} 98 99static void 100tegra_lic_disable_intr(device_t dev, struct intr_irqsrc *isrc) 101{ 102 struct tegra_lic_sc *sc = device_get_softc(dev); 103 104 PIC_DISABLE_INTR(sc->parent, isrc); --- 12 unchanged lines hidden (view full) --- 117 struct intr_irqsrc **isrcp) 118{ 119 struct tegra_lic_sc *sc = device_get_softc(dev); 120 121 return (PIC_MAP_INTR(sc->parent, data, isrcp)); 122} 123 124static int | 97} 98 99static void 100tegra_lic_disable_intr(device_t dev, struct intr_irqsrc *isrc) 101{ 102 struct tegra_lic_sc *sc = device_get_softc(dev); 103 104 PIC_DISABLE_INTR(sc->parent, isrc); --- 12 unchanged lines hidden (view full) --- 117 struct intr_irqsrc **isrcp) 118{ 119 struct tegra_lic_sc *sc = device_get_softc(dev); 120 121 return (PIC_MAP_INTR(sc->parent, data, isrcp)); 122} 123 124static int |
125tegra_lic_release_intr(device_t dev, struct intr_irqsrc *isrc, | 125tegra_lic_deactivate_intr(device_t dev, struct intr_irqsrc *isrc, |
126 struct resource *res, struct intr_map_data *data) 127{ 128 struct tegra_lic_sc *sc = device_get_softc(dev); 129 | 126 struct resource *res, struct intr_map_data *data) 127{ 128 struct tegra_lic_sc *sc = device_get_softc(dev); 129 |
130 return (PIC_RELEASE_INTR(sc->parent, isrc, res, data)); | 130 return (PIC_DEACTIVATE_INTR(sc->parent, isrc, res, data)); |
131} 132 133static int 134tegra_lic_setup_intr(device_t dev, struct intr_irqsrc *isrc, 135 struct resource *res, struct intr_map_data *data) 136{ 137 struct tegra_lic_sc *sc = device_get_softc(dev); 138 --- 122 unchanged lines hidden (view full) --- 261} 262 263static device_method_t tegra_lic_methods[] = { 264 DEVMETHOD(device_probe, tegra_lic_probe), 265 DEVMETHOD(device_attach, tegra_lic_attach), 266 DEVMETHOD(device_detach, tegra_lic_detach), 267 268 /* Interrupt controller interface */ | 131} 132 133static int 134tegra_lic_setup_intr(device_t dev, struct intr_irqsrc *isrc, 135 struct resource *res, struct intr_map_data *data) 136{ 137 struct tegra_lic_sc *sc = device_get_softc(dev); 138 --- 122 unchanged lines hidden (view full) --- 261} 262 263static device_method_t tegra_lic_methods[] = { 264 DEVMETHOD(device_probe, tegra_lic_probe), 265 DEVMETHOD(device_attach, tegra_lic_attach), 266 DEVMETHOD(device_detach, tegra_lic_detach), 267 268 /* Interrupt controller interface */ |
269 DEVMETHOD(pic_alloc_intr, tegra_lic_alloc_intr), | 269 DEVMETHOD(pic_activate_intr, tegra_lic_activate_intr), |
270 DEVMETHOD(pic_disable_intr, tegra_lic_disable_intr), 271 DEVMETHOD(pic_enable_intr, tegra_lic_enable_intr), 272 DEVMETHOD(pic_map_intr, tegra_lic_map_intr), | 270 DEVMETHOD(pic_disable_intr, tegra_lic_disable_intr), 271 DEVMETHOD(pic_enable_intr, tegra_lic_enable_intr), 272 DEVMETHOD(pic_map_intr, tegra_lic_map_intr), |
273 DEVMETHOD(pic_release_intr, tegra_lic_release_intr), | 273 DEVMETHOD(pic_deactivate_intr, tegra_lic_deactivate_intr), |
274 DEVMETHOD(pic_setup_intr, tegra_lic_setup_intr), 275 DEVMETHOD(pic_teardown_intr, tegra_lic_teardown_intr), 276 DEVMETHOD(pic_pre_ithread, tegra_lic_pre_ithread), 277 DEVMETHOD(pic_post_ithread, tegra_lic_post_ithread), 278 DEVMETHOD(pic_post_filter, tegra_lic_post_filter), 279#ifdef SMP 280 DEVMETHOD(pic_bind_intr, tegra_lic_bind_intr), 281#endif 282 DEVMETHOD_END 283}; 284devclass_t tegra_lic_devclass; 285DEFINE_CLASS_0(tegra_lic, tegra_lic_driver, tegra_lic_methods, 286 sizeof(struct tegra_lic_sc)); 287EARLY_DRIVER_MODULE(tegra_lic, simplebus, tegra_lic_driver, tegra_lic_devclass, 288 NULL, NULL, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE + 1); | 274 DEVMETHOD(pic_setup_intr, tegra_lic_setup_intr), 275 DEVMETHOD(pic_teardown_intr, tegra_lic_teardown_intr), 276 DEVMETHOD(pic_pre_ithread, tegra_lic_pre_ithread), 277 DEVMETHOD(pic_post_ithread, tegra_lic_post_ithread), 278 DEVMETHOD(pic_post_filter, tegra_lic_post_filter), 279#ifdef SMP 280 DEVMETHOD(pic_bind_intr, tegra_lic_bind_intr), 281#endif 282 DEVMETHOD_END 283}; 284devclass_t tegra_lic_devclass; 285DEFINE_CLASS_0(tegra_lic, tegra_lic_driver, tegra_lic_methods, 286 sizeof(struct tegra_lic_sc)); 287EARLY_DRIVER_MODULE(tegra_lic, simplebus, tegra_lic_driver, tegra_lic_devclass, 288 NULL, NULL, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE + 1); |