aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/shdma.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/dma/shdma.c')
-rw-r--r--drivers/dma/shdma.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/dma/shdma.c b/drivers/dma/shdma.c
index 427c3effc432..3e1037c5ebd1 100644
--- a/drivers/dma/shdma.c
+++ b/drivers/dma/shdma.c
@@ -105,10 +105,14 @@ static bool dmae_is_busy(struct sh_dmae_chan *sh_chan)
105 return false; /* waiting */ 105 return false; /* waiting */
106} 106}
107 107
108static unsigned int ts_shift[] = TS_SHIFT;
108static inline unsigned int calc_xmit_shift(struct sh_dmae_chan *sh_chan) 109static inline unsigned int calc_xmit_shift(struct sh_dmae_chan *sh_chan)
109{ 110{
110 u32 chcr = sh_dmae_readl(sh_chan, CHCR); 111 u32 chcr = sh_dmae_readl(sh_chan, CHCR);
111 return ts_shift[(chcr & CHCR_TS_MASK) >> CHCR_TS_SHIFT]; 112 int cnt = ((chcr & CHCR_TS_LOW_MASK) >> CHCR_TS_LOW_SHIFT) |
113 ((chcr & CHCR_TS_HIGH_MASK) >> CHCR_TS_HIGH_SHIFT);
114
115 return ts_shift[cnt];
112} 116}
113 117
114static void dmae_set_reg(struct sh_dmae_chan *sh_chan, struct sh_dmae_regs *hw) 118static void dmae_set_reg(struct sh_dmae_chan *sh_chan, struct sh_dmae_regs *hw)