dmaengine: dw: implement per-channel protection control setting
PATCH 2/2 dmaengine: dw: implement per-channel protection control setting
Quoted 11 lines · CET Andy Shevchenko
Quoted 8 lines · Andy Shevchenko
Review
Quoted 2 lines · Christian Lamparter
(quoted diff) +2
-0+ struct dw_dma *dw = to_dw_dma(dwc->chan.device); + size_t chanidx = (size_t)(dwc - dw->chan);We have mask field, so, index is a first set bit out of mask,
__ffs(mask).unsigned int protctl = dw->pdata->protctl[__ffs(mask)];
dwc->mask, of course.
Ok, will do. I'll sent a v2 later this week.
Quoted 2 lines
Also, it's possible to use (though better to check)
dwc->chan.chan_id, though I dunno if it's reliable.
dwc->chan.chan_id is subjected to the chan_allocation setting. So, if it's set to CHAN_ALLOCATION_DESCENDING the dt prop array values for the protctl would need to be reversed as well in order to match the other per-channel settings (for example multiblock).
So, let's not do that since this gets very confusing.