13 #include <linux/kernel.h>
14 #include <linux/errno.h>
17 #include <linux/export.h>
21 static unsigned samsung_dmadev_request(
enum dma_ch dma_ch,
39 static int samsung_dmadev_release(
unsigned ch,
void *param)
46 static int samsung_dmadev_config(
unsigned ch,
67 pr_warn(
"unsupported direction\n");
74 static int samsung_dmadev_prepare(
unsigned ch,
89 desc = dmaengine_prep_slave_sg(chan,
93 desc = dmaengine_prep_dma_cyclic(chan, param->
buf,
98 dev_err(&chan->
dev->device,
"unsupported format\n");
103 dev_err(&chan->
dev->device,
"cannot prepare cyclic dma\n");
115 static inline int samsung_dmadev_trigger(
unsigned ch)
117 dma_async_issue_pending((
struct dma_chan *)ch);
122 static inline int samsung_dmadev_flush(
unsigned ch)
124 return dmaengine_terminate_all((
struct dma_chan *)ch);
128 .request = samsung_dmadev_request,
129 .release = samsung_dmadev_release,
130 .config = samsung_dmadev_config,
131 .prepare = samsung_dmadev_prepare,
132 .trigger = samsung_dmadev_trigger,
134 .flush = samsung_dmadev_flush,
135 .stop = samsung_dmadev_flush,