ARM: McBSP: Fix request for irq in OMAP4
authorJorge Eduardo Candelaria <jorge.candelaria@ti.com>
Wed, 12 May 2010 17:18:39 +0000 (12:18 -0500)
committerLiam Girdwood <lrg@slimlogic.co.uk>
Fri, 14 May 2010 10:20:01 +0000 (11:20 +0100)
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>
arch/arm/mach-omap2/mcbsp.c
arch/arm/plat-omap/mcbsp.c

index be8fce395a58bf1b76f1b2e3657366076cb8a7b3..016fe60c71ad0e5405497154a4e0d96b4191b524 100644 (file)
@@ -186,32 +186,28 @@ static struct omap_mcbsp_platform_data omap44xx_mcbsp_pdata[] = {
                .phys_base      = OMAP44XX_MCBSP1_BASE,
                .dma_rx_sync    = OMAP44XX_DMA_MCBSP1_RX,
                .dma_tx_sync    = OMAP44XX_DMA_MCBSP1_TX,
-               .rx_irq         = INT_24XX_MCBSP1_IRQ_RX,
-               .tx_irq         = INT_24XX_MCBSP1_IRQ_TX,
+               .tx_irq         = OMAP44XX_IRQ_MCBSP1,
                .ops            = &omap2_mcbsp_ops,
        },
        {
                .phys_base      = OMAP44XX_MCBSP2_BASE,
                .dma_rx_sync    = OMAP44XX_DMA_MCBSP2_RX,
                .dma_tx_sync    = OMAP44XX_DMA_MCBSP2_TX,
-               .rx_irq         = INT_24XX_MCBSP2_IRQ_RX,
-               .tx_irq         = INT_24XX_MCBSP2_IRQ_TX,
+               .tx_irq         = OMAP44XX_IRQ_MCBSP2,
                .ops            = &omap2_mcbsp_ops,
        },
        {
                .phys_base      = OMAP44XX_MCBSP3_BASE,
                .dma_rx_sync    = OMAP44XX_DMA_MCBSP3_RX,
                .dma_tx_sync    = OMAP44XX_DMA_MCBSP3_TX,
-               .rx_irq         = INT_24XX_MCBSP3_IRQ_RX,
-               .tx_irq         = INT_24XX_MCBSP3_IRQ_TX,
+               .tx_irq         = OMAP44XX_IRQ_MCBSP3,
                .ops            = &omap2_mcbsp_ops,
        },
        {
                .phys_base      = OMAP44XX_MCBSP4_BASE,
                .dma_rx_sync    = OMAP44XX_DMA_MCBSP4_RX,
                .dma_tx_sync    = OMAP44XX_DMA_MCBSP4_TX,
-               .rx_irq         = INT_24XX_MCBSP4_IRQ_RX,
-               .tx_irq         = INT_24XX_MCBSP4_IRQ_TX,
+               .tx_irq         = OMAP44XX_IRQ_MCBSP4,
                .ops            = &omap2_mcbsp_ops,
        },
 };
index 4ff7a11b18385f3e062201f3fba22591e5399ad8..8bbbb93e2128d4071ab1f30699deca7d5e2383bd 100644 (file)
@@ -778,14 +778,17 @@ int omap_mcbsp_request(unsigned int id)
                        goto err_clk_disable;
                }
 
-               init_completion(&mcbsp->rx_irq_completion);
-               err = request_irq(mcbsp->rx_irq, omap_mcbsp_rx_irq_handler,
+               if (mcbsp->rx_irq) {
+                       init_completion(&mcbsp->rx_irq_completion);
+                       err = request_irq(mcbsp->rx_irq,
+                                       omap_mcbsp_rx_irq_handler,
                                        0, "McBSP", (void *)mcbsp);
-               if (err != 0) {
-                       dev_err(mcbsp->dev, "Unable to request RX IRQ %d "
-                                       "for McBSP%d\n", mcbsp->rx_irq,
-                                       mcbsp->id);
-                       goto err_free_irq;
+                       if (err != 0) {
+                               dev_err(mcbsp->dev, "Unable to request RX IRQ %d "
+                                               "for McBSP%d\n", mcbsp->rx_irq,
+                                               mcbsp->id);
+                               goto err_free_irq;
+                       }
                }
        }
 
@@ -835,7 +838,8 @@ void omap_mcbsp_free(unsigned int id)
 
        if (mcbsp->io_type == OMAP_MCBSP_IRQ_IO) {
                /* 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);
        }