aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/kirkwood/kirkwood-dma.c
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2011-12-07 15:48:07 -0500
committerNicolas Pitre <nico@fluxnic.net>2011-12-13 18:46:55 -0500
commit63a9332b232bdab0df6ef18a9f39e8d58a82bda4 (patch)
tree52906e5888de9e634824d6005d9dbd3eb109bd2d /sound/soc/kirkwood/kirkwood-dma.c
parent45173d5ed4c9a397db31623bf6469efbd3a239cd (diff)
ARM: Orion: Get address map from plat-orion instead of via platform_data
Use an getter function in plat-orion/addr-map.c to get the address map structure, rather than pass it to drivers in the platform_data structures. When the drivers are built for none orion platforms, a dummy function is provided instead which returns NULL. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Tested-by: Michael Walle <michael@walle.cc> Acked-by: Nicolas Pitre <nico@linaro.org> Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Diffstat (limited to 'sound/soc/kirkwood/kirkwood-dma.c')
-rw-r--r--sound/soc/kirkwood/kirkwood-dma.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/sound/soc/kirkwood/kirkwood-dma.c b/sound/soc/kirkwood/kirkwood-dma.c
index cd33de1c5b7a..df12e0993f5a 100644
--- a/sound/soc/kirkwood/kirkwood-dma.c
+++ b/sound/soc/kirkwood/kirkwood-dma.c
@@ -94,9 +94,10 @@ static irqreturn_t kirkwood_dma_irq(int irq, void *dev_id)
94 return IRQ_HANDLED; 94 return IRQ_HANDLED;
95} 95}
96 96
97static void kirkwood_dma_conf_mbus_windows(void __iomem *base, int win, 97static void
98 unsigned long dma, 98kirkwood_dma_conf_mbus_windows(void __iomem *base, int win,
99 struct mbus_dram_target_info *dram) 99 unsigned long dma,
100 const struct mbus_dram_target_info *dram)
100{ 101{
101 int i; 102 int i;
102 103
@@ -106,7 +107,7 @@ static void kirkwood_dma_conf_mbus_windows(void __iomem *base, int win,
106 107
107 /* try to find matching cs for current dma address */ 108 /* try to find matching cs for current dma address */
108 for (i = 0; i < dram->num_cs; i++) { 109 for (i = 0; i < dram->num_cs; i++) {
109 struct mbus_dram_window *cs = dram->cs + i; 110 const struct mbus_dram_window *cs = dram->cs + i;
110 if ((cs->base & 0xffff0000) < (dma & 0xffff0000)) { 111 if ((cs->base & 0xffff0000) < (dma & 0xffff0000)) {
111 writel(cs->base & 0xffff0000, 112 writel(cs->base & 0xffff0000,
112 base + KIRKWOOD_AUDIO_WIN_BASE_REG(win)); 113 base + KIRKWOOD_AUDIO_WIN_BASE_REG(win));
@@ -127,6 +128,7 @@ static int kirkwood_dma_open(struct snd_pcm_substream *substream)
127 struct snd_soc_dai *cpu_dai = soc_runtime->cpu_dai; 128 struct snd_soc_dai *cpu_dai = soc_runtime->cpu_dai;
128 struct kirkwood_dma_data *priv; 129 struct kirkwood_dma_data *priv;
129 struct kirkwood_dma_priv *prdata = snd_soc_platform_get_drvdata(platform); 130 struct kirkwood_dma_priv *prdata = snd_soc_platform_get_drvdata(platform);
131 const struct mbus_dram_target_info *dram;
130 unsigned long addr; 132 unsigned long addr;
131 133
132 priv = snd_soc_dai_get_dma_data(cpu_dai, substream); 134 priv = snd_soc_dai_get_dma_data(cpu_dai, substream);
@@ -175,15 +177,16 @@ static int kirkwood_dma_open(struct snd_pcm_substream *substream)
175 writel((unsigned long)-1, priv->io + KIRKWOOD_ERR_MASK); 177 writel((unsigned long)-1, priv->io + KIRKWOOD_ERR_MASK);
176 } 178 }
177 179
180 dram = mv_mbus_dram_info();
178 addr = virt_to_phys(substream->dma_buffer.area); 181 addr = virt_to_phys(substream->dma_buffer.area);
179 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { 182 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
180 prdata->play_stream = substream; 183 prdata->play_stream = substream;
181 kirkwood_dma_conf_mbus_windows(priv->io, 184 kirkwood_dma_conf_mbus_windows(priv->io,
182 KIRKWOOD_PLAYBACK_WIN, addr, priv->dram); 185 KIRKWOOD_PLAYBACK_WIN, addr, dram);
183 } else { 186 } else {
184 prdata->rec_stream = substream; 187 prdata->rec_stream = substream;
185 kirkwood_dma_conf_mbus_windows(priv->io, 188 kirkwood_dma_conf_mbus_windows(priv->io,
186 KIRKWOOD_RECORD_WIN, addr, priv->dram); 189 KIRKWOOD_RECORD_WIN, addr, dram);
187 } 190 }
188 191
189 return 0; 192 return 0;