ARM: McBSP: Fix request for irq in OMAP4

In OMAP4, there is only one irq line for TX and RX paths. Use
the correct irq line to avoid errors at runtime.

Also, request irq line only once (instead of requesting for TX
and RX).

Signed-off-by: Jorge Eduardo Candelaria <jorge.candelaria@ti.com>
Acked-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
This commit is contained in:
Jorge Eduardo Candelaria 2010-05-12 12:18:39 -05:00 committed by Liam Girdwood
parent d98508a121
commit 9319b9da35
2 changed files with 16 additions and 16 deletions

View File

@ -186,32 +186,28 @@ static struct omap_mcbsp_platform_data omap44xx_mcbsp_pdata[] = {
.phys_base = OMAP44XX_MCBSP1_BASE, .phys_base = OMAP44XX_MCBSP1_BASE,
.dma_rx_sync = OMAP44XX_DMA_MCBSP1_RX, .dma_rx_sync = OMAP44XX_DMA_MCBSP1_RX,
.dma_tx_sync = OMAP44XX_DMA_MCBSP1_TX, .dma_tx_sync = OMAP44XX_DMA_MCBSP1_TX,
.rx_irq = INT_24XX_MCBSP1_IRQ_RX, .tx_irq = OMAP44XX_IRQ_MCBSP1,
.tx_irq = INT_24XX_MCBSP1_IRQ_TX,
.ops = &omap2_mcbsp_ops, .ops = &omap2_mcbsp_ops,
}, },
{ {
.phys_base = OMAP44XX_MCBSP2_BASE, .phys_base = OMAP44XX_MCBSP2_BASE,
.dma_rx_sync = OMAP44XX_DMA_MCBSP2_RX, .dma_rx_sync = OMAP44XX_DMA_MCBSP2_RX,
.dma_tx_sync = OMAP44XX_DMA_MCBSP2_TX, .dma_tx_sync = OMAP44XX_DMA_MCBSP2_TX,
.rx_irq = INT_24XX_MCBSP2_IRQ_RX, .tx_irq = OMAP44XX_IRQ_MCBSP2,
.tx_irq = INT_24XX_MCBSP2_IRQ_TX,
.ops = &omap2_mcbsp_ops, .ops = &omap2_mcbsp_ops,
}, },
{ {
.phys_base = OMAP44XX_MCBSP3_BASE, .phys_base = OMAP44XX_MCBSP3_BASE,
.dma_rx_sync = OMAP44XX_DMA_MCBSP3_RX, .dma_rx_sync = OMAP44XX_DMA_MCBSP3_RX,
.dma_tx_sync = OMAP44XX_DMA_MCBSP3_TX, .dma_tx_sync = OMAP44XX_DMA_MCBSP3_TX,
.rx_irq = INT_24XX_MCBSP3_IRQ_RX, .tx_irq = OMAP44XX_IRQ_MCBSP3,
.tx_irq = INT_24XX_MCBSP3_IRQ_TX,
.ops = &omap2_mcbsp_ops, .ops = &omap2_mcbsp_ops,
}, },
{ {
.phys_base = OMAP44XX_MCBSP4_BASE, .phys_base = OMAP44XX_MCBSP4_BASE,
.dma_rx_sync = OMAP44XX_DMA_MCBSP4_RX, .dma_rx_sync = OMAP44XX_DMA_MCBSP4_RX,
.dma_tx_sync = OMAP44XX_DMA_MCBSP4_TX, .dma_tx_sync = OMAP44XX_DMA_MCBSP4_TX,
.rx_irq = INT_24XX_MCBSP4_IRQ_RX, .tx_irq = OMAP44XX_IRQ_MCBSP4,
.tx_irq = INT_24XX_MCBSP4_IRQ_TX,
.ops = &omap2_mcbsp_ops, .ops = &omap2_mcbsp_ops,
}, },
}; };

View File

@ -778,14 +778,17 @@ int omap_mcbsp_request(unsigned int id)
goto err_clk_disable; goto err_clk_disable;
} }
init_completion(&mcbsp->rx_irq_completion); if (mcbsp->rx_irq) {
err = request_irq(mcbsp->rx_irq, omap_mcbsp_rx_irq_handler, init_completion(&mcbsp->rx_irq_completion);
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) {
dev_err(mcbsp->dev, "Unable to request RX IRQ %d " dev_err(mcbsp->dev, "Unable to request RX IRQ %d "
"for McBSP%d\n", mcbsp->rx_irq, "for McBSP%d\n", mcbsp->rx_irq,
mcbsp->id); mcbsp->id);
goto err_free_irq; goto err_free_irq;
}
} }
} }
@ -835,7 +838,8 @@ void omap_mcbsp_free(unsigned int id)
if (mcbsp->io_type == OMAP_MCBSP_IRQ_IO) { if (mcbsp->io_type == OMAP_MCBSP_IRQ_IO) {
/* Free IRQs */ /* Free IRQs */
free_irq(mcbsp->rx_irq, (void *)mcbsp); if (mcbsp->rx_irq)
free_irq(mcbsp->rx_irq, (void *)mcbsp);
free_irq(mcbsp->tx_irq, (void *)mcbsp); free_irq(mcbsp->tx_irq, (void *)mcbsp);
} }