Skip to content

Commit

Permalink
dma: at_xdmac: change chunk size default value
Browse files Browse the repository at this point in the history
Some devices don't set the maxburst value, in this case it is safer to
use a chunk of 1 instead of 16. For example, atmel_serial doesn't
set maxburst and having a chunk of 16 causes receiving 4 characters
intstead of 1.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
  • Loading branch information
ldesroches committed Oct 2, 2014
1 parent a698d39 commit 0d1ba33
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/dma/at_xdmac.h
Expand Up @@ -286,10 +286,7 @@ static inline u32 at_xdmac_csize(u32 maxburst)
{
u32 csize;

switch (ffs(maxburst) -1) {
case 0:
csize = AT_XDMAC_CC_CSIZE_CHK_1;
break;
switch (ffs(maxburst) - 1) {
case 1:
csize = AT_XDMAC_CC_CSIZE_CHK_2;
break;
Expand All @@ -299,8 +296,11 @@ static inline u32 at_xdmac_csize(u32 maxburst)
case 3:
csize = AT_XDMAC_CC_CSIZE_CHK_8;
break;
default:
case 4:
csize = AT_XDMAC_CC_CSIZE_CHK_16;
break;
default:
csize = AT_XDMAC_CC_CSIZE_CHK_1;
}

return csize;
Expand Down

0 comments on commit 0d1ba33

Please sign in to comment.