Lines Matching refs:md
70 struct milbeaut_hdmac_desc *md; member
103 mc->md = NULL; in milbeaut_hdmac_next_desc()
109 mc->md = to_milbeaut_hdmac_desc(vd); in milbeaut_hdmac_next_desc()
111 return mc->md; in milbeaut_hdmac_next_desc()
116 struct milbeaut_hdmac_desc *md) in milbeaut_chan_start() argument
122 sg = &md->sgl[md->sg_cur]; in milbeaut_chan_start()
126 if (md->dir == DMA_MEM_TO_DEV) { in milbeaut_chan_start()
164 struct milbeaut_hdmac_desc *md; in milbeaut_hdmac_start() local
166 md = milbeaut_hdmac_next_desc(mc); in milbeaut_hdmac_start()
167 if (md) in milbeaut_hdmac_start()
168 milbeaut_chan_start(mc, md); in milbeaut_hdmac_start()
174 struct milbeaut_hdmac_desc *md; in milbeaut_hdmac_interrupt() local
187 md = mc->md; in milbeaut_hdmac_interrupt()
188 if (!md) in milbeaut_hdmac_interrupt()
191 md->sg_cur++; in milbeaut_hdmac_interrupt()
193 if (md->sg_cur >= md->sg_len) { in milbeaut_hdmac_interrupt()
194 vchan_cookie_complete(&md->vd); in milbeaut_hdmac_interrupt()
195 md = milbeaut_hdmac_next_desc(mc); in milbeaut_hdmac_interrupt()
196 if (!md) in milbeaut_hdmac_interrupt()
200 milbeaut_chan_start(mc, md); in milbeaut_hdmac_interrupt()
262 struct milbeaut_hdmac_desc *md; in milbeaut_hdmac_prep_slave_sg() local
268 md = kzalloc(sizeof(*md), GFP_NOWAIT); in milbeaut_hdmac_prep_slave_sg()
269 if (!md) in milbeaut_hdmac_prep_slave_sg()
272 md->sgl = kzalloc(sizeof(*sgl) * sg_len, GFP_NOWAIT); in milbeaut_hdmac_prep_slave_sg()
273 if (!md->sgl) { in milbeaut_hdmac_prep_slave_sg()
274 kfree(md); in milbeaut_hdmac_prep_slave_sg()
279 md->sgl[i] = sgl[i]; in milbeaut_hdmac_prep_slave_sg()
281 md->sg_len = sg_len; in milbeaut_hdmac_prep_slave_sg()
282 md->dir = direction; in milbeaut_hdmac_prep_slave_sg()
284 return vchan_tx_prep(vc, &md->vd, flags); in milbeaut_hdmac_prep_slave_sg()
302 if (mc->md) { in milbeaut_hdmac_terminate_all()
303 vchan_terminate_vdesc(&mc->md->vd); in milbeaut_hdmac_terminate_all()
304 mc->md = NULL; in milbeaut_hdmac_terminate_all()
328 struct milbeaut_hdmac_desc *md = NULL; in milbeaut_hdmac_tx_status() local
345 if (mc->md && mc->md->vd.tx.cookie == cookie) { in milbeaut_hdmac_tx_status()
349 md = mc->md; in milbeaut_hdmac_tx_status()
350 sg = &md->sgl[md->sg_cur]; in milbeaut_hdmac_tx_status()
352 if (md->dir == DMA_DEV_TO_MEM) in milbeaut_hdmac_tx_status()
363 if (!md) { in milbeaut_hdmac_tx_status()
366 md = to_milbeaut_hdmac_desc(vd); in milbeaut_hdmac_tx_status()
369 if (md) { in milbeaut_hdmac_tx_status()
371 for (i = md->sg_cur; i < md->sg_len; i++) in milbeaut_hdmac_tx_status()
372 txstate->residue += sg_dma_len(&md->sgl[i]); in milbeaut_hdmac_tx_status()
388 if (vchan_issue_pending(vc) && !mc->md) in milbeaut_hdmac_issue_pending()
396 struct milbeaut_hdmac_desc *md = to_milbeaut_hdmac_desc(vd); in milbeaut_hdmac_desc_free() local
398 kfree(md->sgl); in milbeaut_hdmac_desc_free()
399 kfree(md); in milbeaut_hdmac_desc_free()