fsldma: Add device_prep_dma_interrupt support to fsldma.c

This is a bug that I assigned DMA_INTERRUPT capability to fsldma
but missing device_prep_dma_interrupt function. For a bug in
dmaengine.c the driver passed BUG_ON() checking. The patch fixes it.

Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>

authored by Zhang Wei and committed by Dan Williams 2187c269 9b941c66

+27
+27
drivers/dma/fsldma.c
··· 406 dma_pool_destroy(fsl_chan->desc_pool); 407 } 408 409 static struct dma_async_tx_descriptor *fsl_dma_prep_memcpy( 410 struct dma_chan *chan, dma_addr_t dma_dest, dma_addr_t dma_src, 411 size_t len, unsigned long flags) ··· 1046 dma_cap_set(DMA_INTERRUPT, fdev->common.cap_mask); 1047 fdev->common.device_alloc_chan_resources = fsl_dma_alloc_chan_resources; 1048 fdev->common.device_free_chan_resources = fsl_dma_free_chan_resources; 1049 fdev->common.device_prep_dma_memcpy = fsl_dma_prep_memcpy; 1050 fdev->common.device_is_tx_complete = fsl_dma_is_complete; 1051 fdev->common.device_issue_pending = fsl_dma_memcpy_issue_pending;
··· 406 dma_pool_destroy(fsl_chan->desc_pool); 407 } 408 409 + static struct dma_async_tx_descriptor * 410 + fsl_dma_prep_interrupt(struct dma_chan *chan) 411 + { 412 + struct fsl_dma_chan *fsl_chan; 413 + struct fsl_desc_sw *new; 414 + 415 + if (!chan) 416 + return NULL; 417 + 418 + fsl_chan = to_fsl_chan(chan); 419 + 420 + new = fsl_dma_alloc_descriptor(fsl_chan); 421 + if (!new) { 422 + dev_err(fsl_chan->dev, "No free memory for link descriptor\n"); 423 + return NULL; 424 + } 425 + 426 + new->async_tx.cookie = -EBUSY; 427 + new->async_tx.ack = 0; 428 + 429 + /* Set End-of-link to the last link descriptor of new list*/ 430 + set_ld_eol(fsl_chan, new); 431 + 432 + return &new->async_tx; 433 + } 434 + 435 static struct dma_async_tx_descriptor *fsl_dma_prep_memcpy( 436 struct dma_chan *chan, dma_addr_t dma_dest, dma_addr_t dma_src, 437 size_t len, unsigned long flags) ··· 1020 dma_cap_set(DMA_INTERRUPT, fdev->common.cap_mask); 1021 fdev->common.device_alloc_chan_resources = fsl_dma_alloc_chan_resources; 1022 fdev->common.device_free_chan_resources = fsl_dma_free_chan_resources; 1023 + fdev->common.device_prep_dma_interrupt = fsl_dma_prep_interrupt; 1024 fdev->common.device_prep_dma_memcpy = fsl_dma_prep_memcpy; 1025 fdev->common.device_is_tx_complete = fsl_dma_is_complete; 1026 fdev->common.device_issue_pending = fsl_dma_memcpy_issue_pending;