/* Enable or disable a DMA channel (by index ch: 0 .. 31) by setting a bit in DMA_ERQ.  */
static int __kinetis_dma_ch_enable(int ch, int enable, int single)
/* Enable or disable a DMA channel (by index ch: 0 .. 31) by setting a bit in DMA_ERQ.  */
static int __kinetis_dma_ch_enable(int ch, int enable, int single)
{
	DMAAPI_LOCKED_BEGIN
	if (single)
		KINETIS_DMA->tcd[ch].csr |= (1 << 3);
	if (enable)
		KINETIS_DMA->erq |= 1 << ch;
	else
		KINETIS_DMA->erq &= ~(1 << ch);
	DMAAPI_LOCKED_END
}