Commit 260bf2c5f69f419b04b6861ca91565b5fb16ce48
Committed by
Paul Mundt
1 parent
e76c3af873
Exists in
master
and in
6 other branches
dmaengine: shdma: add .needs_tend_set / .no_dmars flags
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Showing 2 changed files with 10 additions and 0 deletions Side-by-side Diff
drivers/dma/shdma.c
... | ... | @@ -194,6 +194,9 @@ |
194 | 194 | struct sh_dmae_device *shdev = to_sh_dev(sh_chan); |
195 | 195 | u32 chcr = chcr_read(sh_chan); |
196 | 196 | |
197 | + if (shdev->pdata->needs_tend_set) | |
198 | + sh_dmae_writel(sh_chan, 0xFFFFFFFF, TEND); | |
199 | + | |
197 | 200 | chcr |= CHCR_DE | shdev->chcr_ie_bit; |
198 | 201 | chcr_write(sh_chan, chcr & ~CHCR_TE); |
199 | 202 | } |
... | ... | @@ -241,6 +244,9 @@ |
241 | 244 | |
242 | 245 | if (dmae_is_busy(sh_chan)) |
243 | 246 | return -EBUSY; |
247 | + | |
248 | + if (pdata->no_dmars) | |
249 | + return 0; | |
244 | 250 | |
245 | 251 | /* in the case of a missing DMARS resource use first memory window */ |
246 | 252 | if (!addr) |
include/linux/sh_dma.h
... | ... | @@ -66,6 +66,8 @@ |
66 | 66 | u32 chcr_ie_bit; |
67 | 67 | |
68 | 68 | unsigned int dmaor_is_32bit:1; |
69 | + unsigned int needs_tend_set:1; | |
70 | + unsigned int no_dmars:1; | |
69 | 71 | }; |
70 | 72 | |
71 | 73 | /* DMA register */ |
... | ... | @@ -74,6 +76,8 @@ |
74 | 76 | #define TCR 0x08 |
75 | 77 | #define CHCR 0x0C |
76 | 78 | #define DMAOR 0x40 |
79 | + | |
80 | +#define TEND 0x18 /* USB-DMAC */ | |
77 | 81 | |
78 | 82 | /* DMAOR definitions */ |
79 | 83 | #define DMAOR_AE 0x00000004 |