1a7de7c74SMichael Ellerman #ifndef _POWERPC_SYSDEV_MPIC_H 2a7de7c74SMichael Ellerman #define _POWERPC_SYSDEV_MPIC_H 3a7de7c74SMichael Ellerman 4a7de7c74SMichael Ellerman /* 5a7de7c74SMichael Ellerman * Copyright 2006-2007, Michael Ellerman, IBM Corporation. 6a7de7c74SMichael Ellerman * 7a7de7c74SMichael Ellerman * This program is free software; you can redistribute it and/or 8a7de7c74SMichael Ellerman * modify it under the terms of the GNU General Public License 9a7de7c74SMichael Ellerman * as published by the Free Software Foundation; version 2 of the 10a7de7c74SMichael Ellerman * License. 11a7de7c74SMichael Ellerman * 12a7de7c74SMichael Ellerman */ 13a7de7c74SMichael Ellerman 14a7de7c74SMichael Ellerman #ifdef CONFIG_PCI_MSI 15a7de7c74SMichael Ellerman extern void mpic_msi_reserve_hwirq(struct mpic *mpic, irq_hw_number_t hwirq); 16a7de7c74SMichael Ellerman extern int mpic_msi_init_allocator(struct mpic *mpic); 1705af7bd2SMichael Ellerman extern int mpic_u3msi_init(struct mpic *mpic); 18a7de7c74SMichael Ellerman #else 19a7de7c74SMichael Ellerman static inline void mpic_msi_reserve_hwirq(struct mpic *mpic, 20a7de7c74SMichael Ellerman irq_hw_number_t hwirq) 21a7de7c74SMichael Ellerman { 22a7de7c74SMichael Ellerman return; 23a7de7c74SMichael Ellerman } 2405af7bd2SMichael Ellerman 2505af7bd2SMichael Ellerman static inline int mpic_u3msi_init(struct mpic *mpic) 2605af7bd2SMichael Ellerman { 2705af7bd2SMichael Ellerman return -1; 2805af7bd2SMichael Ellerman } 295af7a6f3SMichael Ellerman #endif 3038958dd9SOlof Johansson 315af7a6f3SMichael Ellerman #if defined(CONFIG_PCI_MSI) && defined(CONFIG_PPC_PASEMI) 325af7a6f3SMichael Ellerman int mpic_pasemi_msi_init(struct mpic *mpic); 335af7a6f3SMichael Ellerman #else 345af7a6f3SMichael Ellerman static inline int mpic_pasemi_msi_init(struct mpic *mpic) { return -1; } 35a7de7c74SMichael Ellerman #endif 36a7de7c74SMichael Ellerman 37835c0553SLennert Buytenhek extern int mpic_set_irq_type(struct irq_data *d, unsigned int flow_type); 3838958dd9SOlof Johansson extern void mpic_set_vector(unsigned int virq, unsigned int vector); 39835c0553SLennert Buytenhek extern int mpic_set_affinity(struct irq_data *d, 40835c0553SLennert Buytenhek const struct cpumask *cpumask, bool force); 4166953ebeSMatthew McClintock extern void mpic_reset_core(int cpu); 4205af7bd2SMichael Ellerman 430a408164SVarun Sethi #ifdef CONFIG_FSL_SOC 440a408164SVarun Sethi extern int mpic_map_error_int(struct mpic *mpic, unsigned int virq, irq_hw_number_t hw); 450a408164SVarun Sethi extern void mpic_err_int_init(struct mpic *mpic, irq_hw_number_t irqnum); 460a408164SVarun Sethi extern int mpic_setup_error_int(struct mpic *mpic, int intvec); 470a408164SVarun Sethi #else 480a408164SVarun Sethi static inline int mpic_map_error_int(struct mpic *mpic, unsigned int virq, irq_hw_number_t hw) 490a408164SVarun Sethi { 500a408164SVarun Sethi return 0; 510a408164SVarun Sethi } 520a408164SVarun Sethi 530a408164SVarun Sethi 540a408164SVarun Sethi static inline void mpic_err_int_init(struct mpic *mpic, irq_hw_number_t irqnum) 550a408164SVarun Sethi { 560a408164SVarun Sethi return; 570a408164SVarun Sethi } 580a408164SVarun Sethi 590a408164SVarun Sethi static inline int mpic_setup_error_int(struct mpic *mpic, int intvec) 600a408164SVarun Sethi { 610a408164SVarun Sethi return -1; 620a408164SVarun Sethi } 630a408164SVarun Sethi #endif 640a408164SVarun Sethi 65a7de7c74SMichael Ellerman #endif /* _POWERPC_SYSDEV_MPIC_H */ 66