diff options
author | Jarkko Nikula <jarkko.nikula@nokia.com> | 2008-10-08 03:01:41 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2008-10-08 03:01:41 -0400 |
commit | 5a07055a3849574f4fbe5d0ce7cd2d26ab9a37c1 (patch) | |
tree | 90760a649788efc7a42ff344e39d581655421e95 /arch/arm/plat-omap/mcbsp.c | |
parent | 05228c35c67995c745ae3c768eaf90740c643fa9 (diff) |
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/arm/plat-omap/mcbsp.c')
-rw-r--r-- | 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 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) | |||
234 | mcbsp->free = 0; | 234 | mcbsp->free = 0; |
235 | spin_unlock(&mcbsp->lock); | 235 | spin_unlock(&mcbsp->lock); |
236 | 236 | ||
237 | /* | ||
238 | * Make sure that transmitter, receiver and sample-rate generator are | ||
239 | * not running before activating IRQs. | ||
240 | */ | ||
241 | OMAP_MCBSP_WRITE(mcbsp->io_base, SPCR1, 0); | ||
242 | OMAP_MCBSP_WRITE(mcbsp->io_base, SPCR2, 0); | ||
243 | |||
237 | if (mcbsp->io_type == OMAP_MCBSP_IRQ_IO) { | 244 | if (mcbsp->io_type == OMAP_MCBSP_IRQ_IO) { |
238 | /* We need to get IRQs here */ | 245 | /* We need to get IRQs here */ |
246 | init_completion(&mcbsp->tx_irq_completion); | ||
239 | err = request_irq(mcbsp->tx_irq, omap_mcbsp_tx_irq_handler, | 247 | err = request_irq(mcbsp->tx_irq, omap_mcbsp_tx_irq_handler, |
240 | 0, "McBSP", (void *)mcbsp); | 248 | 0, "McBSP", (void *)mcbsp); |
241 | if (err != 0) { | 249 | if (err != 0) { |
@@ -245,8 +253,7 @@ int omap_mcbsp_request(unsigned int id) | |||
245 | return err; | 253 | return err; |
246 | } | 254 | } |
247 | 255 | ||
248 | init_completion(&mcbsp->tx_irq_completion); | 256 | init_completion(&mcbsp->rx_irq_completion); |
249 | |||
250 | err = request_irq(mcbsp->rx_irq, omap_mcbsp_rx_irq_handler, | 257 | err = request_irq(mcbsp->rx_irq, omap_mcbsp_rx_irq_handler, |
251 | 0, "McBSP", (void *)mcbsp); | 258 | 0, "McBSP", (void *)mcbsp); |
252 | if (err != 0) { | 259 | if (err != 0) { |
@@ -256,8 +263,6 @@ int omap_mcbsp_request(unsigned int id) | |||
256 | free_irq(mcbsp->tx_irq, (void *)mcbsp); | 263 | free_irq(mcbsp->tx_irq, (void *)mcbsp); |
257 | return err; | 264 | return err; |
258 | } | 265 | } |
259 | |||
260 | init_completion(&mcbsp->rx_irq_completion); | ||
261 | } | 266 | } |
262 | 267 | ||
263 | return 0; | 268 | return 0; |