aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/amba-pl08x.c
diff options
context:
space:
mode:
authorTomasz Figa <tomasz.figa@gmail.com>2013-08-11 13:59:16 -0400
committerVinod Koul <vinod.koul@intel.com>2013-09-02 02:19:56 -0400
commit48924e4224540b249e56d82e58dee5bcaabfe52b (patch)
treea9dd22b524a869c934dd55d2a17b48ebfa9e5199 /drivers/dma/amba-pl08x.c
parentba6785ffc85bcf967b0646f4e8b9b13fdbad3254 (diff)
dmaengine: PL08x: Move LLI dumping code into separate function
This patch refactors debugging code that dumps LLI entries by moving it into separate function, which is stubbed when VERBOSE_DEBUG is not selected. This allows us to get rid of the ugly ifdef from the body of pl08x_fill_llis_for_desc(). No functional change is introduced by this patch. 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>
Diffstat (limited to 'drivers/dma/amba-pl08x.c')
-rw-r--r--drivers/dma/amba-pl08x.c41
1 files changed, 24 insertions, 17 deletions
diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c
index d3399c2c090f..1fa05d618141 100644
--- a/drivers/dma/amba-pl08x.c
+++ b/drivers/dma/amba-pl08x.c
@@ -814,6 +814,29 @@ static inline void prep_byte_width_lli(struct pl08x_driver_data *pl08x,
814 (*total_bytes) += len; 814 (*total_bytes) += len;
815} 815}
816 816
817#ifdef VERBOSE_DEBUG
818static void pl08x_dump_lli(struct pl08x_driver_data *pl08x,
819 const u32 *llis_va, int num_llis)
820{
821 int i;
822
823 dev_vdbg(&pl08x->adev->dev,
824 "%-3s %-9s %-10s %-10s %-10s %s\n",
825 "lli", "", "csrc", "cdst", "clli", "cctl");
826 for (i = 0; i < num_llis; i++) {
827 dev_vdbg(&pl08x->adev->dev,
828 "%3d @%p: 0x%08x 0x%08x 0x%08x 0x%08x\n",
829 i, llis_va, llis_va[PL080_LLI_SRC],
830 llis_va[PL080_LLI_DST], llis_va[PL080_LLI_LLI],
831 llis_va[PL080_LLI_CCTL]);
832 llis_va += pl08x->lli_words;
833 }
834}
835#else
836static inline void pl08x_dump_lli(struct pl08x_driver_data *pl08x,
837 const u32 *llis_va, int num_llis) {}
838#endif
839
817/* 840/*
818 * This fills in the table of LLIs for the transfer descriptor 841 * This fills in the table of LLIs for the transfer descriptor
819 * Note that we assume we never have to change the burst sizes 842 * Note that we assume we never have to change the burst sizes
@@ -1033,23 +1056,7 @@ static int pl08x_fill_llis_for_desc(struct pl08x_driver_data *pl08x,
1033 /* The final LLI element shall also fire an interrupt. */ 1056 /* The final LLI element shall also fire an interrupt. */
1034 last_lli[PL080_LLI_CCTL] |= PL080_CONTROL_TC_IRQ_EN; 1057 last_lli[PL080_LLI_CCTL] |= PL080_CONTROL_TC_IRQ_EN;
1035 1058
1036#ifdef VERBOSE_DEBUG 1059 pl08x_dump_lli(pl08x, llis_va, num_llis);
1037 {
1038 int i;
1039
1040 dev_vdbg(&pl08x->adev->dev,
1041 "%-3s %-9s %-10s %-10s %-10s %s\n",
1042 "lli", "", "csrc", "cdst", "clli", "cctl");
1043 for (i = 0; i < num_llis; i++) {
1044 dev_vdbg(&pl08x->adev->dev,
1045 "%3d @%p: 0x%08x 0x%08x 0x%08x 0x%08x\n",
1046 i, llis_va, llis_va[PL080_LLI_SRC],
1047 llis_va[PL080_LLI_DST], llis_va[PL080_LLI_LLI],
1048 llis_va[PL080_LLI_CCTL]);
1049 llis_va += pl08x->lli_words;
1050 }
1051 }
1052#endif
1053 1060
1054 return num_llis; 1061 return num_llis;
1055} 1062}