aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2010-04-21 11:36:49 -0400
committerPaul Mundt <lethal@linux-sh.org>2010-04-26 02:50:50 -0400
commit5bac942db3d2c4738df04104240d65a5d1eaec6a (patch)
tree253c75407764fc5cb3483283941b14a99fad389a /arch/sh/kernel/cpu/sh4a/setup-sh7724.c
parent6b6b18e62cfba44ce7b6489c7100f12b199232d7 (diff)
SH: constify multiple DMA related objects and references to them
Lists of DMA channels and slaves are not changed, make them constant. Besides, SH7724 channel and slave configuration of both DMA controllers is identical, remove the extra copy of the configuration data. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/cpu/sh4a/setup-sh7724.c')
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7724.c54
1 files changed, 7 insertions, 47 deletions
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
index 8a0a4a99f86b..89fe16d20fdb 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
@@ -31,7 +31,7 @@
31#include <cpu/sh7724.h> 31#include <cpu/sh7724.h>
32 32
33/* DMA */ 33/* DMA */
34static struct sh_dmae_channel sh7724_dmae0_channels[] = { 34static const struct sh_dmae_channel sh7724_dmae_channels[] = {
35 { 35 {
36 .offset = 0, 36 .offset = 0,
37 .dmars = 0, 37 .dmars = 0,
@@ -59,51 +59,11 @@ static struct sh_dmae_channel sh7724_dmae0_channels[] = {
59 } 59 }
60}; 60};
61 61
62static struct sh_dmae_channel sh7724_dmae1_channels[] = { 62static const unsigned int ts_shift[] = TS_SHIFT;
63 {
64 .offset = 0,
65 .dmars = 0,
66 .dmars_bit = 0,
67 }, {
68 .offset = 0x10,
69 .dmars = 0,
70 .dmars_bit = 8,
71 }, {
72 .offset = 0x20,
73 .dmars = 4,
74 .dmars_bit = 0,
75 }, {
76 .offset = 0x30,
77 .dmars = 4,
78 .dmars_bit = 8,
79 }, {
80 .offset = 0x50,
81 .dmars = 8,
82 .dmars_bit = 0,
83 }, {
84 .offset = 0x60,
85 .dmars = 8,
86 .dmars_bit = 8,
87 }
88};
89
90static unsigned int ts_shift[] = TS_SHIFT;
91
92static struct sh_dmae_pdata dma0_platform_data = {
93 .channel = sh7724_dmae0_channels,
94 .channel_num = ARRAY_SIZE(sh7724_dmae0_channels),
95 .ts_low_shift = CHCR_TS_LOW_SHIFT,
96 .ts_low_mask = CHCR_TS_LOW_MASK,
97 .ts_high_shift = CHCR_TS_HIGH_SHIFT,
98 .ts_high_mask = CHCR_TS_HIGH_MASK,
99 .ts_shift = ts_shift,
100 .ts_shift_num = ARRAY_SIZE(ts_shift),
101 .dmaor_init = DMAOR_INIT,
102};
103 63
104static struct sh_dmae_pdata dma1_platform_data = { 64static struct sh_dmae_pdata dma_platform_data = {
105 .channel = sh7724_dmae1_channels, 65 .channel = sh7724_dmae_channels,
106 .channel_num = ARRAY_SIZE(sh7724_dmae1_channels), 66 .channel_num = ARRAY_SIZE(sh7724_dmae_channels),
107 .ts_low_shift = CHCR_TS_LOW_SHIFT, 67 .ts_low_shift = CHCR_TS_LOW_SHIFT,
108 .ts_low_mask = CHCR_TS_LOW_MASK, 68 .ts_low_mask = CHCR_TS_LOW_MASK,
109 .ts_high_shift = CHCR_TS_HIGH_SHIFT, 69 .ts_high_shift = CHCR_TS_HIGH_SHIFT,
@@ -187,7 +147,7 @@ static struct platform_device dma0_device = {
187 .resource = sh7724_dmae0_resources, 147 .resource = sh7724_dmae0_resources,
188 .num_resources = ARRAY_SIZE(sh7724_dmae0_resources), 148 .num_resources = ARRAY_SIZE(sh7724_dmae0_resources),
189 .dev = { 149 .dev = {
190 .platform_data = &dma0_platform_data, 150 .platform_data = &dma_platform_data,
191 }, 151 },
192 .archdata = { 152 .archdata = {
193 .hwblk_id = HWBLK_DMAC0, 153 .hwblk_id = HWBLK_DMAC0,
@@ -200,7 +160,7 @@ static struct platform_device dma1_device = {
200 .resource = sh7724_dmae1_resources, 160 .resource = sh7724_dmae1_resources,
201 .num_resources = ARRAY_SIZE(sh7724_dmae1_resources), 161 .num_resources = ARRAY_SIZE(sh7724_dmae1_resources),
202 .dev = { 162 .dev = {
203 .platform_data = &dma1_platform_data, 163 .platform_data = &dma_platform_data,
204 }, 164 },
205 .archdata = { 165 .archdata = {
206 .hwblk_id = HWBLK_DMAC1, 166 .hwblk_id = HWBLK_DMAC1,