FreeBSD/sys/arm/ti/ti_sdma.c
/**
 *	ti_sdma_disable_channel_irq - disables IRQ's on the given channel
 *	@ch: the channel to disable IRQ's on
 *
 *	Disable interrupt generation for the given channel.
 *
 *	LOCKING:
 *	DMA registers protected by internal mutex
 *
 *	RETURNS:
 *	EH_HANDLED or EH_NOT_HANDLED
 */
disables IRQ's on the given channel
@ch: the channel to disable IRQ's on

Disable interrupt generation for the given channel.

DMA registers protected by internal mutex


disables IRQ ' s on the given channel @ch : the channel to disable IRQ ' s on Disable interrupt generation for the given channel . DMA registers protected by internal mutex
int
ti_sdma_disable_channel_irq(unsigned int ch)
{
	struct ti_sdma_softc *sc = ti_sdma_sc;
	uint32_t irq_enable;
	unsigned int j;
	if (sc == NULL)
		return (ENOMEM);
	TI_SDMA_LOCK(sc);
	if ((sc->sc_active_channels & (1 << ch)) == 0) {
		TI_SDMA_UNLOCK(sc);
		return (EINVAL);
	}
	sc->sc_channel[ch].reg_cicr = 0x0000;
	ti_sdma_write_4(sc, DMA4_CICR(ch), 0x0000);
	for (j = 0; j < NUM_DMA_IRQS; j++) {
		irq_enable = ti_sdma_read_4(sc, DMA4_IRQENABLE_L(j));
		irq_enable &= ~(1 << ch);
		ti_sdma_write_4(sc, DMA4_IRQENABLE_L(j), irq_enable);
	}
	sc->sc_channel[ch].need_reg_write = 1;
	TI_SDMA_UNLOCK(sc);
	return (0);
}
int ti_sdma_disable_channel_irq ( unsigned int ch ) { struct ti_sdma_softc * sc = ti_sdma_sc ; uint32_t irq_enable ; unsigned int j ; if ( sc == NULL ) return ( ENOMEM ) ; TI_SDMA_LOCK ( sc ) ; if ( ( sc -> sc_active_channels & ( 1 << ch ) ) == 0 ) { TI_SDMA_UNLOCK ( sc ) ; return ( EINVAL ) ; } sc -> sc_channel [ ch ] . reg_cicr = 0x0000 ; ti_sdma_write_4 ( sc , DMA4_CICR ( ch ) , 0x0000 ) ; for ( j = 0 ; j < NUM_DMA_IRQS ; j ++ ) { irq_enable = ti_sdma_read_4 ( sc , DMA4_IRQENABLE_L ( j ) ) ; irq_enable &= ~ ( 1 << ch ) ; ti_sdma_write_4 ( sc , DMA4_IRQENABLE_L ( j ) , irq_enable ) ; } sc -> sc_channel [ ch ] . need_reg_write = 1 ; TI_SDMA_UNLOCK ( sc ) ; return ( 0 ) ; }
ti_sdma_disable_channel_irq - disables IRQ's on the given channel
      @ch: the channel to disable IRQ's on
ti_sdma_disable_channel_irq - disables IRQ ' s on the given channel @ch : the channel to disable IRQ ' s on
/* Sanity check */ /* Disable all the individual error conditions */ /* Disable the channel interrupt enable */ /* Indicate the registers need to be rewritten on the next transaction */