This patches the AICA sound driver for the Dreamcast to handle the
well known flakiness of the Dreamcast's G2 bus.
This is dependent on getting Maple bus support (see
http://lkml.org/lkml/2007/9/9/70) into the kernel.
Signed-off by: Adrian McMenamin <[email protected]>
diff --git a/sound/sh/aica.c b/sound/sh/aica.c
index 7397865..a42c58f 100644
--- a/sound/sh/aica.c
+++ b/sound/sh/aica.c
@@ -35,6 +35,7 @@
#include <linux/timer.h>
#include <linux/delay.h>
#include <linux/workqueue.h>
+#include <linux/maple.h>
#include <sound/driver.h>
#include <sound/core.h>
#include <sound/control.h>
@@ -43,7 +44,7 @@
#include <sound/info.h>
#include <asm/io.h>
#include <asm/dma.h>
-#include <asm/dreamcast/sysasic.h>
+#include <asm/mach/sysasic.h>
#include "aica.h"
MODULE_AUTHOR("Adrian McMenamin <[email protected]>");
@@ -218,6 +219,12 @@ static int aica_dma_transfer(int channels, int buffer_size,
period_offset = dreamcastcard->clicks;
period_offset %= (AICA_PERIOD_NUMBER / channels);
runtime = substream->runtime;
+ /* If maple dma is running, wait for it to finish */
+ do{ cpu_relax();}
+ while (!maple_dma_done());
+ /* Turn off the maple dma now */
+ ctrl_outl(0, MAPLE_ENABLE);
+ local_irq_disable();
for (q = 0; q < channels; q++) {
err = dma_xfer(AICA_DMA_CHANNEL,
(unsigned long) (runtime->dma_area +
@@ -232,6 +239,9 @@ static int aica_dma_transfer(int channels, int buffer_size,
break;
dma_wait_for_completion(AICA_DMA_CHANNEL);
}
+ /* restore maple dma */
+ local_irq_enable();
+ maplebus_init_hardware();
return err;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]