From: Tony Lindgren <tony@atomide.com>
To: linux-arm-kernel@lists.arm.linux.org.uk
Cc: linux-omap@vger.kernel.org,
Jarkko Nikula <jarkko.nikula@nokia.com>,
Tony Lindgren <tony@atomide.com>
Subject: [PATCH 3/3] ARM: OMAP: Fixes to omap_mcbsp_request function
Date: Wed, 24 Sep 2008 12:52:23 +0300 [thread overview]
Message-ID: <1222249943-19435-4-git-send-email-tony@atomide.com> (raw)
In-Reply-To: <1222249943-19435-3-git-send-email-tony@atomide.com>
From: Jarkko Nikula <jarkko.nikula@nokia.com>
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>
---
arch/arm/plat-omap/mcbsp.c | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c
index 7d32437..798c91e 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;
--
1.5.6.rc3.21.g8c6b5
next prev parent reply other threads:[~2008-09-24 9:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-24 9:52 [PATCH 0/3] Omap McBSP updates from linux-omap tree Tony Lindgren
2008-09-24 9:52 ` [PATCH 1/3] ARM: OMAP: Allocate McBSP devices dynamically, add 34xx support Tony Lindgren
2008-09-24 9:52 ` [PATCH 2/3] ARM: OMAP: Add support for OMAP2430 in McBSP Tony Lindgren
2008-09-24 9:52 ` Tony Lindgren [this message]
2008-09-24 11:58 ` [PATCH 1/3] ARM: OMAP: Allocate McBSP devices dynamically, add 34xx support Uwe Kleine-König
2008-09-24 12:10 ` Tony Lindgren
2008-09-24 12:32 ` Tony Lindgren
2008-09-24 11:45 ` [PATCH 0/3] Omap McBSP updates from linux-omap tree Uwe Kleine-König
2008-09-24 12:02 ` Tony Lindgren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1222249943-19435-4-git-send-email-tony@atomide.com \
--to=tony@atomide.com \
--cc=jarkko.nikula@nokia.com \
--cc=linux-arm-kernel@lists.arm.linux.org.uk \
--cc=linux-omap@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.