diff options
-rw-r--r-- | drivers/dma/amba-pl08x.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c index 4bcf6036f35d..f70aa574c58f 100644 --- a/drivers/dma/amba-pl08x.c +++ b/drivers/dma/amba-pl08x.c | |||
@@ -499,34 +499,24 @@ struct pl08x_lli_build_data { | |||
499 | * byte data), slave is still not aligned, then its width will be reduced to | 499 | * byte data), slave is still not aligned, then its width will be reduced to |
500 | * BYTE. | 500 | * BYTE. |
501 | * - prefers the destination bus if both available | 501 | * - prefers the destination bus if both available |
502 | * - if fixed address on one bus the other will be chosen | 502 | * - prefers bus with fixed address (i.e. peripheral) |
503 | */ | 503 | */ |
504 | static void pl08x_choose_master_bus(struct pl08x_lli_build_data *bd, | 504 | static void pl08x_choose_master_bus(struct pl08x_lli_build_data *bd, |
505 | struct pl08x_bus_data **mbus, struct pl08x_bus_data **sbus, u32 cctl) | 505 | struct pl08x_bus_data **mbus, struct pl08x_bus_data **sbus, u32 cctl) |
506 | { | 506 | { |
507 | if (!(cctl & PL080_CONTROL_DST_INCR)) { | 507 | if (!(cctl & PL080_CONTROL_DST_INCR)) { |
508 | *mbus = &bd->srcbus; | ||
509 | *sbus = &bd->dstbus; | ||
510 | } else if (!(cctl & PL080_CONTROL_SRC_INCR)) { | ||
511 | *mbus = &bd->dstbus; | 508 | *mbus = &bd->dstbus; |
512 | *sbus = &bd->srcbus; | 509 | *sbus = &bd->srcbus; |
510 | } else if (!(cctl & PL080_CONTROL_SRC_INCR)) { | ||
511 | *mbus = &bd->srcbus; | ||
512 | *sbus = &bd->dstbus; | ||
513 | } else { | 513 | } else { |
514 | if (bd->dstbus.buswidth == 4) { | 514 | if (bd->dstbus.buswidth >= bd->srcbus.buswidth) { |
515 | *mbus = &bd->dstbus; | ||
516 | *sbus = &bd->srcbus; | ||
517 | } else if (bd->srcbus.buswidth == 4) { | ||
518 | *mbus = &bd->srcbus; | ||
519 | *sbus = &bd->dstbus; | ||
520 | } else if (bd->dstbus.buswidth == 2) { | ||
521 | *mbus = &bd->dstbus; | 515 | *mbus = &bd->dstbus; |
522 | *sbus = &bd->srcbus; | 516 | *sbus = &bd->srcbus; |
523 | } else if (bd->srcbus.buswidth == 2) { | 517 | } else { |
524 | *mbus = &bd->srcbus; | 518 | *mbus = &bd->srcbus; |
525 | *sbus = &bd->dstbus; | 519 | *sbus = &bd->dstbus; |
526 | } else { | ||
527 | /* bd->srcbus.buswidth == 1 */ | ||
528 | *mbus = &bd->dstbus; | ||
529 | *sbus = &bd->srcbus; | ||
530 | } | 520 | } |
531 | } | 521 | } |
532 | } | 522 | } |