mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
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>
This commit is contained in:
parent
05228c35c6
commit
5a07055a38
1 changed files with 9 additions and 4 deletions
|
@ -234,8 +234,16 @@ int omap_mcbsp_request(unsigned int id)
|
||||||
mcbsp->free = 0;
|
mcbsp->free = 0;
|
||||||
spin_unlock(&mcbsp->lock);
|
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) {
|
if (mcbsp->io_type == OMAP_MCBSP_IRQ_IO) {
|
||||||
/* We need to get IRQs here */
|
/* We need to get IRQs here */
|
||||||
|
init_completion(&mcbsp->tx_irq_completion);
|
||||||
err = request_irq(mcbsp->tx_irq, omap_mcbsp_tx_irq_handler,
|
err = request_irq(mcbsp->tx_irq, omap_mcbsp_tx_irq_handler,
|
||||||
0, "McBSP", (void *)mcbsp);
|
0, "McBSP", (void *)mcbsp);
|
||||||
if (err != 0) {
|
if (err != 0) {
|
||||||
|
@ -245,8 +253,7 @@ int omap_mcbsp_request(unsigned int id)
|
||||||
return err;
|
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,
|
err = request_irq(mcbsp->rx_irq, omap_mcbsp_rx_irq_handler,
|
||||||
0, "McBSP", (void *)mcbsp);
|
0, "McBSP", (void *)mcbsp);
|
||||||
if (err != 0) {
|
if (err != 0) {
|
||||||
|
@ -256,8 +263,6 @@ int omap_mcbsp_request(unsigned int id)
|
||||||
free_irq(mcbsp->tx_irq, (void *)mcbsp);
|
free_irq(mcbsp->tx_irq, (void *)mcbsp);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
init_completion(&mcbsp->rx_irq_completion);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue