[PATCH] dmaengine: bcm2835: Add slave dma support

Noralf Trønnes noralf at tronnes.org
Thu Apr 16 15:09:28 PDT 2015


Den 15.04.2015 21:00, skrev Stefan Wahren:
> Hi Noralf,
>
> Am 15.04.2015 um 11:56 schrieb Noralf Trønnes:
>> Add slave transfer capability to BCM2835 dmaengine driver.
>> This patch is pulled from the bcm2708-dmaengine driver in the
>> Raspberry Pi repo. The work was done by Gellert Weisz.
>>
>> Tested with the bcm2835-mmc driver from the same repo.
>
> why not with the upstream kernel?
>

See my answer to Alexander Stein.

>> +    unsigned int i, j, splitct, max_size;
>
> I think "split_cnt" would be better.
>
>> +        es = BCM2835_DMA_DATA_TYPE_S32;
>
> Looks like "es" is never used.
>
>> +        break;
>> +    default:
>
> A dev_err() might be useful here.
>
>> +        d->frames += 1 + len / max_size;
>
> If it's correct this should be more intuitive:
>
> d->frames += len / max_size + 1;
>
>> +    for_each_sg(sgl, sgent, sg_len, i) {
>> +        dma_addr_t addr = sg_dma_address(sgent);
>> +        unsigned int len = sg_dma_len(sgent);
>> +
>> +        for (j = 0; j < len; j += max_size) {
>
> It should be possible to move declaration of "j" down here.
>
>> +            if (sync_type != 0)
>
> if (sync_type) ?
>

Thanks for your comments Stefan, I'll make a new version of the patch.


Noralf.




More information about the linux-rpi-kernel mailing list