aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlban Bedel <alban.bedel@avionic-design.de>2013-08-11 13:59:19 -0400
committerVinod Koul <vinod.koul@intel.com>2013-09-02 02:19:56 -0400
commitf3287a5206cae1244601d50a4d2a9a96a521c1ee (patch)
treeb963749b7277eaaa080c4b201adb8a7343421ec7
parent5110e51d127221c93f331841e601612b187b60f4 (diff)
dmaengine: PL08x: Fix reading the byte count in cctl
There are more fields than just SWIDTH in CH_CONTROL register, so read register value must be masked in addition to shifting. Signed-off-by: Alban Bedel <alban.bedel@avionic-design.de> Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-rw-r--r--drivers/dma/amba-pl08x.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c
index 4e4c3df7f151..6b9cba2fd7f1 100644
--- a/drivers/dma/amba-pl08x.c
+++ b/drivers/dma/amba-pl08x.c
@@ -480,6 +480,8 @@ static inline u32 get_bytes_in_cctl(u32 cctl)
480 /* The source width defines the number of bytes */ 480 /* The source width defines the number of bytes */
481 u32 bytes = cctl & PL080_CONTROL_TRANSFER_SIZE_MASK; 481 u32 bytes = cctl & PL080_CONTROL_TRANSFER_SIZE_MASK;
482 482
483 cctl &= PL080_CONTROL_SWIDTH_MASK;
484
483 switch (cctl >> PL080_CONTROL_SWIDTH_SHIFT) { 485 switch (cctl >> PL080_CONTROL_SWIDTH_SHIFT) {
484 case PL080_WIDTH_8BIT: 486 case PL080_WIDTH_8BIT:
485 break; 487 break;
@@ -498,6 +500,8 @@ static inline u32 get_bytes_in_cctl_pl080s(u32 cctl, u32 cctl1)
498 /* The source width defines the number of bytes */ 500 /* The source width defines the number of bytes */
499 u32 bytes = cctl1 & PL080S_CONTROL_TRANSFER_SIZE_MASK; 501 u32 bytes = cctl1 & PL080S_CONTROL_TRANSFER_SIZE_MASK;
500 502
503 cctl &= PL080_CONTROL_SWIDTH_MASK;
504
501 switch (cctl >> PL080_CONTROL_SWIDTH_SHIFT) { 505 switch (cctl >> PL080_CONTROL_SWIDTH_SHIFT) {
502 case PL080_WIDTH_8BIT: 506 case PL080_WIDTH_8BIT:
503 break; 507 break;