summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJarkko Nikula <jarkko.nikula@nokia.com>2008-10-08 09:01:41 +0200
committerTony Lindgren <tony@atomide.com>2008-10-08 09:01:41 +0200
commit5a07055a3849574f4fbe5d0ce7cd2d26ab9a37c1 (patch)
tree90760a649788efc7a42ff344e39d581655421e95 /arch
parentARM: OMAP: Add support for OMAP2430 in McBSP (diff)
downloadlinux-5a07055a3849574f4fbe5d0ce7cd2d26ab9a37c1.tar.xz
linux-5a07055a3849574f4fbe5d0ce7cd2d26ab9a37c1.zip
ARM: OMAP: Fixes to omap_mcbsp_request function
Bootloader may let McBSP logic running so make sure that block is idle before requesting IRQs. Also make sure that TX and RX waitqueues are initialized before request_irq. Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/plat-omap/mcbsp.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c
index f27e641bf814..af33fc713e1a 100644
--- a/arch/arm/plat-omap/mcbsp.c
+++ b/arch/arm/plat-omap/mcbsp.c
@@ -234,8 +234,16 @@ int omap_mcbsp_request(unsigned int id)
mcbsp->free = 0;
spin_unlock(&mcbsp->lock);
+ /*
+ * Make sure that transmitter, receiver and sample-rate generator are
+ * not running before activating IRQs.
+ */
+ OMAP_MCBSP_WRITE(mcbsp->io_base, SPCR1, 0);
+ OMAP_MCBSP_WRITE(mcbsp->io_base, SPCR2, 0);
+
if (mcbsp->io_type == OMAP_MCBSP_IRQ_IO) {
/* We need to get IRQs here */
+ init_completion(&mcbsp->tx_irq_completion);
err = request_irq(mcbsp->tx_irq, omap_mcbsp_tx_irq_handler,
0, "McBSP", (void *)mcbsp);
if (err != 0) {
@@ -245,8 +253,7 @@ int omap_mcbsp_request(unsigned int id)
return err;
}
- init_completion(&mcbsp->tx_irq_completion);
-
+ init_completion(&mcbsp->rx_irq_completion);
err = request_irq(mcbsp->rx_irq, omap_mcbsp_rx_irq_handler,
0, "McBSP", (void *)mcbsp);
if (err != 0) {
@@ -256,8 +263,6 @@ int omap_mcbsp_request(unsigned int id)
free_irq(mcbsp->tx_irq, (void *)mcbsp);
return err;
}
-
- init_completion(&mcbsp->rx_irq_completion);
}
return 0;