Lines Matching refs:dma
49 static int sandbox_dma_of_xlate(struct dma *dma, in sandbox_dma_of_xlate() argument
52 struct sandbox_dma_dev *ud = dev_get_priv(dma->dev); in sandbox_dma_of_xlate()
60 dma->id = args->args[0]; in sandbox_dma_of_xlate()
62 uc = &ud->channels[dma->id]; in sandbox_dma_of_xlate()
64 if (dma->id == 1) in sandbox_dma_of_xlate()
66 else if (dma->id == 2) in sandbox_dma_of_xlate()
70 debug("%s(dma id=%lu dir=%d)\n", __func__, dma->id, uc->dir); in sandbox_dma_of_xlate()
75 static int sandbox_dma_request(struct dma *dma) in sandbox_dma_request() argument
77 struct sandbox_dma_dev *ud = dev_get_priv(dma->dev); in sandbox_dma_request()
80 if (dma->id >= SANDBOX_DMA_CH_CNT) in sandbox_dma_request()
83 uc = &ud->channels[dma->id]; in sandbox_dma_request()
88 debug("%s(dma id=%lu in_use=%d)\n", __func__, dma->id, uc->in_use); in sandbox_dma_request()
93 static int sandbox_dma_rfree(struct dma *dma) in sandbox_dma_rfree() argument
95 struct sandbox_dma_dev *ud = dev_get_priv(dma->dev); in sandbox_dma_rfree()
98 if (dma->id >= SANDBOX_DMA_CH_CNT) in sandbox_dma_rfree()
101 uc = &ud->channels[dma->id]; in sandbox_dma_rfree()
108 debug("%s(dma id=%lu in_use=%d)\n", __func__, dma->id, uc->in_use); in sandbox_dma_rfree()
113 static int sandbox_dma_enable(struct dma *dma) in sandbox_dma_enable() argument
115 struct sandbox_dma_dev *ud = dev_get_priv(dma->dev); in sandbox_dma_enable()
118 if (dma->id >= SANDBOX_DMA_CH_CNT) in sandbox_dma_enable()
121 uc = &ud->channels[dma->id]; in sandbox_dma_enable()
128 debug("%s(dma id=%lu enabled=%d)\n", __func__, dma->id, uc->enabled); in sandbox_dma_enable()
133 static int sandbox_dma_disable(struct dma *dma) in sandbox_dma_disable() argument
135 struct sandbox_dma_dev *ud = dev_get_priv(dma->dev); in sandbox_dma_disable()
138 if (dma->id >= SANDBOX_DMA_CH_CNT) in sandbox_dma_disable()
141 uc = &ud->channels[dma->id]; in sandbox_dma_disable()
148 debug("%s(dma id=%lu enabled=%d)\n", __func__, dma->id, uc->enabled); in sandbox_dma_disable()
153 static int sandbox_dma_send(struct dma *dma, in sandbox_dma_send() argument
156 struct sandbox_dma_dev *ud = dev_get_priv(dma->dev); in sandbox_dma_send()
159 if (dma->id >= SANDBOX_DMA_CH_CNT) in sandbox_dma_send()
164 debug("%s(dma id=%lu)\n", __func__, dma->id); in sandbox_dma_send()
166 uc = &ud->channels[dma->id]; in sandbox_dma_send()
181 __func__, dma->id, len, ud->meta); in sandbox_dma_send()
186 static int sandbox_dma_receive(struct dma *dma, void **dst, void *metadata) in sandbox_dma_receive() argument
188 struct sandbox_dma_dev *ud = dev_get_priv(dma->dev); in sandbox_dma_receive()
191 if (dma->id >= SANDBOX_DMA_CH_CNT) in sandbox_dma_receive()
196 uc = &ud->channels[dma->id]; in sandbox_dma_receive()
216 __func__, dma->id, ud->data_len, ud->meta, *dst); in sandbox_dma_receive()
221 static int sandbox_dma_prepare_rcv_buf(struct dma *dma, void *dst, size_t size) in sandbox_dma_prepare_rcv_buf() argument
223 struct sandbox_dma_dev *ud = dev_get_priv(dma->dev); in sandbox_dma_prepare_rcv_buf()