FreeBSD/sys/arm/cavium/cns11xx/econa.c
/*
 * Configure interrupt trigger level to be Active High/Low
 * or Rising/Falling Edge
 */
Configure interrupt trigger level to be Active High/Low
or Rising/Falling Edge
Configure interrupt trigger level to be Active High / Low or Rising / Falling Edge
static inline void
econa_set_irq_level(struct econa_softc * sc,
    unsigned int irq, unsigned int level)
{
	unsigned int val;
	if ((level != INTC_ACTIVE_HIGH) &&
	    (level != INTC_ACTIVE_LOW) &&
	    (level != INTC_RISING_EDGE) &&
	    (level != INTC_FALLING_EDGE)) {
		return;
	}
	val = read_4(sc, INTC_INTERRUPT_TRIGGER_LEVEL_REG_OFFSET);
	if ((level == INTC_ACTIVE_HIGH) || (level == INTC_RISING_EDGE)) {
		if (val & (1UL << irq)) {
			val &= ~(1UL << irq);
			write_4(sc, INTC_INTERRUPT_TRIGGER_LEVEL_REG_OFFSET,
			    val);
		}
	} else {
		if (!(val & (1UL << irq))) {
			val |= (1UL << irq);
			write_4(sc, INTC_INTERRUPT_TRIGGER_LEVEL_REG_OFFSET,
			    val);
		}
	}
}
static inline void econa_set_irq_level ( struct econa_softc * sc , unsigned int irq , unsigned int level ) { unsigned int val ; if ( ( level != INTC_ACTIVE_HIGH ) && ( level != INTC_ACTIVE_LOW ) && ( level != INTC_RISING_EDGE ) && ( level != INTC_FALLING_EDGE ) ) { return ; } val = read_4 ( sc , INTC_INTERRUPT_TRIGGER_LEVEL_REG_OFFSET ) ; if ( ( level == INTC_ACTIVE_HIGH ) || ( level == INTC_RISING_EDGE ) ) { if ( val & ( 1UL << irq ) ) { val &= ~ ( 1UL << irq ) ; write_4 ( sc , INTC_INTERRUPT_TRIGGER_LEVEL_REG_OFFSET , val ) ; } } else { if ( ! ( val & ( 1UL << irq ) ) ) { val |= ( 1UL << irq ) ; write_4 ( sc , INTC_INTERRUPT_TRIGGER_LEVEL_REG_OFFSET , val ) ; } } }
Configure interrupt trigger level to be Active High/Low
 or Rising/Falling Edge
Configure interrupt trigger level to be Active High / Low or Rising / Falling Edge