aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAdrian McMenamin <adrian@mcmen.demon.co.uk>2007-07-24 00:30:55 -0400
committerPaul Mundt <lethal@linux-sh.org>2007-07-24 00:30:55 -0400
commiteb695dbf00d572a770358305dae4de2a0680db8f (patch)
tree7039762e190ace8af58bb62f6645bee0a2f71221 /arch
parent8cf1a74305688c85fc8d23ab7432a0c447ee6413 (diff)
sh: Fix Dreamcast DMA issues.
The current SH DMA API is somewhat broken, not correctly matching virtual channel to the correct SH DMAC. This wasn't noticeable when using g2 DMA for the sound driver - one channel 0 is as good as any other! - but caused the pvr2 driver to fail. This patch fixes the pvr2 problem and consequently fixes the sound driver to ensure it continues to function. Signed-off by: Adrian McMenamin <adrian@mcmen.demon.co.uk> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/sh/drivers/dma/dma-api.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/sh/drivers/dma/dma-api.c b/arch/sh/drivers/dma/dma-api.c
index cf8e11994330..76ed816d9a24 100644
--- a/arch/sh/drivers/dma/dma-api.c
+++ b/arch/sh/drivers/dma/dma-api.c
@@ -31,8 +31,8 @@ struct dma_info *get_dma_info(unsigned int chan)
31 * the channel is. 31 * the channel is.
32 */ 32 */
33 list_for_each_entry(info, &registered_dmac_list, list) { 33 list_for_each_entry(info, &registered_dmac_list, list) {
34 if ((chan < info->first_channel_nr) || 34 if ((chan < info->first_vchannel_nr) ||
35 (chan >= info->first_channel_nr + info->nr_channels)) 35 (chan >= info->first_vchannel_nr + info->nr_channels))
36 continue; 36 continue;
37 37
38 return info; 38 return info;
@@ -82,7 +82,7 @@ struct dma_channel *get_dma_channel(unsigned int chan)
82 82
83 for (i = 0; i < info->nr_channels; i++) { 83 for (i = 0; i < info->nr_channels; i++) {
84 channel = &info->channels[i]; 84 channel = &info->channels[i];
85 if (channel->chan == chan) 85 if (channel->vchan == chan)
86 return channel; 86 return channel;
87 } 87 }
88 88
@@ -369,6 +369,7 @@ int register_dmac(struct dma_info *info)
369 } 369 }
370 370
371 total_channels = get_nr_channels(); 371 total_channels = get_nr_channels();
372 info->first_vchannel_nr = total_channels;
372 for (i = 0; i < info->nr_channels; i++) { 373 for (i = 0; i < info->nr_channels; i++) {
373 struct dma_channel *chan = &info->channels[i]; 374 struct dma_channel *chan = &info->channels[i];
374 375