diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2011-06-17 04:20:56 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2011-06-21 04:56:07 -0400 |
commit | e76c3af873025f5a704d56a28882be761e15657b (patch) | |
tree | c5dbbd3433b0c676e1d86ddd9442e301ffa41b0c | |
parent | 67c6269e5c998b53c2c08ce2befbbe20a7b6f57f (diff) |
dmaengine: shdma: add dmaor_is_32bit flag
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r-- | drivers/dma/shdma.c | 14 | ||||
-rw-r--r-- | include/linux/sh_dma.h | 2 |
2 files changed, 14 insertions, 2 deletions
diff --git a/drivers/dma/shdma.c b/drivers/dma/shdma.c index 9412de3ef899..6a21cd843ab7 100644 --- a/drivers/dma/shdma.c +++ b/drivers/dma/shdma.c | |||
@@ -70,12 +70,22 @@ static u32 sh_dmae_readl(struct sh_dmae_chan *sh_dc, u32 reg) | |||
70 | 70 | ||
71 | static u16 dmaor_read(struct sh_dmae_device *shdev) | 71 | static u16 dmaor_read(struct sh_dmae_device *shdev) |
72 | { | 72 | { |
73 | return __raw_readw(shdev->chan_reg + DMAOR / sizeof(u32)); | 73 | u32 __iomem *addr = shdev->chan_reg + DMAOR / sizeof(u32); |
74 | |||
75 | if (shdev->pdata->dmaor_is_32bit) | ||
76 | return __raw_readl(addr); | ||
77 | else | ||
78 | return __raw_readw(addr); | ||
74 | } | 79 | } |
75 | 80 | ||
76 | static void dmaor_write(struct sh_dmae_device *shdev, u16 data) | 81 | static void dmaor_write(struct sh_dmae_device *shdev, u16 data) |
77 | { | 82 | { |
78 | __raw_writew(data, shdev->chan_reg + DMAOR / sizeof(u32)); | 83 | u32 __iomem *addr = shdev->chan_reg + DMAOR / sizeof(u32); |
84 | |||
85 | if (shdev->pdata->dmaor_is_32bit) | ||
86 | __raw_writel(data, addr); | ||
87 | else | ||
88 | __raw_writew(data, addr); | ||
79 | } | 89 | } |
80 | 90 | ||
81 | static void chcr_write(struct sh_dmae_chan *sh_dc, u32 data) | 91 | static void chcr_write(struct sh_dmae_chan *sh_dc, u32 data) |
diff --git a/include/linux/sh_dma.h b/include/linux/sh_dma.h index 96803aa7b6bd..f25afc61e1c6 100644 --- a/include/linux/sh_dma.h +++ b/include/linux/sh_dma.h | |||
@@ -64,6 +64,8 @@ struct sh_dmae_pdata { | |||
64 | u16 dmaor_init; | 64 | u16 dmaor_init; |
65 | unsigned int chcr_offset; | 65 | unsigned int chcr_offset; |
66 | u32 chcr_ie_bit; | 66 | u32 chcr_ie_bit; |
67 | |||
68 | unsigned int dmaor_is_32bit:1; | ||
67 | }; | 69 | }; |
68 | 70 | ||
69 | /* DMA register */ | 71 | /* DMA register */ |