All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/0] McBSP changes for OMAP4 platform
@ 2010-05-04 23:37 Jorge Eduardo Candelaria
  2010-05-04 23:37 ` [PATCH 1/2] ARM: McBSP: Fix request for irq in OMAP4 Jorge Eduardo Candelaria
  0 siblings, 1 reply; 9+ messages in thread
From: Jorge Eduardo Candelaria @ 2010-05-04 23:37 UTC (permalink / raw)
  To: linux-omap

The following patches enable McBSP driver to be used along with the
audio driver in SDP4430 and other OMAP4 based boards.

Jorge Eduardo Candelaria (2):
      ARM: McBSP: Fix request for irq in OMAP4
      ARM: OMAP4: Add support for omap4 in McBSP driver

 arch/arm/mach-omap2/mcbsp.c |   12 ++++--------
 arch/arm/plat-omap/mcbsp.c  |   34 +++++++++++++++++++---------------
 2 files changed, 23 insertions(+), 23 deletions(-)


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/2] ARM: McBSP: Fix request for irq in OMAP4
  2010-05-04 23:37 [PATCH 0/0] McBSP changes for OMAP4 platform Jorge Eduardo Candelaria
@ 2010-05-04 23:37 ` Jorge Eduardo Candelaria
  2010-05-04 23:37   ` [PATCH 2/2] ARM: OMAP4: Add support for omap4 in McBSP driver Jorge Eduardo Candelaria
                     ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Jorge Eduardo Candelaria @ 2010-05-04 23:37 UTC (permalink / raw)
  To: linux-omap; +Cc: Jorge Eduardo Candelaria

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>
---
 arch/arm/mach-omap2/mcbsp.c |   12 ++++--------
 arch/arm/plat-omap/mcbsp.c  |   20 ++++++++++++--------
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c
index 2f3cad6..6b550ec 100644
--- a/arch/arm/mach-omap2/mcbsp.c
+++ b/arch/arm/mach-omap2/mcbsp.c
@@ -187,32 +187,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         = INT_44XX_MCBSP1_IRQ,
 		.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         = INT_44XX_MCBSP2_IRQ,
 		.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         = INT_44XX_MCBSP3_IRQ,
 		.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         = INT_44XX_MCBSP4_IRQ,
 		.ops            = &omap2_mcbsp_ops,
 	},
 };
diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c
index e1d0440..6e9660d 100644
--- a/arch/arm/plat-omap/mcbsp.c
+++ b/arch/arm/plat-omap/mcbsp.c
@@ -724,14 +724,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 (!cpu_is_omap44xx) {
+			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;
+			}
 		}
 	}
 
@@ -781,7 +784,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 (!cpu_is_omap44xx())
+			free_irq(mcbsp->rx_irq, (void *)mcbsp);
 		free_irq(mcbsp->tx_irq, (void *)mcbsp);
 	}
 
-- 
1.6.3.3


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/2] ARM: OMAP4: Add support for omap4 in McBSP driver
  2010-05-04 23:37 ` [PATCH 1/2] ARM: McBSP: Fix request for irq in OMAP4 Jorge Eduardo Candelaria
@ 2010-05-04 23:37   ` Jorge Eduardo Candelaria
  2010-05-05  3:02   ` [PATCH 1/2] ARM: McBSP: Fix request for irq in OMAP4 G, Manjunath Kondaiah
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Jorge Eduardo Candelaria @ 2010-05-04 23:37 UTC (permalink / raw)
  To: linux-omap; +Cc: Jorge Eduardo Candelaria, Margarita Olaya Cabrera

McBSP module in OMAP4 needs to be able to set its tx/rx threshold
and enable the transmitter/receiver when starting an audio stream.

Signed-off-by: Jorge Eduardo Candelaria <jorge.candelaria@ti.com>
Signed-off-by: Margarita Olaya Cabrera <magi.olaya@ti.com>
---
 arch/arm/plat-omap/mcbsp.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c
index 6e9660d..ea0c364 100644
--- a/arch/arm/plat-omap/mcbsp.c
+++ b/arch/arm/plat-omap/mcbsp.c
@@ -489,7 +489,7 @@ void omap_mcbsp_set_tx_threshold(unsigned int id, u16 threshold)
 {
 	struct omap_mcbsp *mcbsp;
 
-	if (!cpu_is_omap34xx())
+	if (!cpu_is_omap34xx() && !cpu_is_omap44xx())
 		return;
 
 	if (!omap_mcbsp_check_valid_id(id)) {
@@ -511,7 +511,7 @@ void omap_mcbsp_set_rx_threshold(unsigned int id, u16 threshold)
 {
 	struct omap_mcbsp *mcbsp;
 
-	if (!cpu_is_omap34xx())
+	if (!cpu_is_omap34xx() && !cpu_is_omap44xx())
 		return;
 
 	if (!omap_mcbsp_check_valid_id(id)) {
@@ -587,7 +587,7 @@ static inline void omap34xx_mcbsp_request(struct omap_mcbsp *mcbsp)
 	 * Enable wakup behavior, smart idle and all wakeups
 	 * REVISIT: some wakeups may be unnecessary
 	 */
-	if (cpu_is_omap34xx()) {
+	if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
 		u16 syscon;
 
 		syscon = MCBSP_READ(mcbsp, SYSCON);
@@ -610,7 +610,7 @@ static inline void omap34xx_mcbsp_free(struct omap_mcbsp *mcbsp)
 	/*
 	 * Disable wakup behavior, smart idle and all wakeups
 	 */
-	if (cpu_is_omap34xx()) {
+	if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
 		u16 syscon;
 
 		syscon = MCBSP_READ(mcbsp, SYSCON);
@@ -859,7 +859,7 @@ void omap_mcbsp_start(unsigned int id, int tx, int rx)
 		MCBSP_WRITE(mcbsp, SPCR2, w | (1 << 7));
 	}
 
-	if (cpu_is_omap2430() || cpu_is_omap34xx()) {
+	if (cpu_is_omap2430() || cpu_is_omap34xx() || cpu_is_omap44xx()) {
 		/* Release the transmitter and receiver */
 		w = MCBSP_READ_CACHE(mcbsp, XCCR);
 		w &= ~(tx ? XDISABLE : 0);
@@ -889,7 +889,7 @@ void omap_mcbsp_stop(unsigned int id, int tx, int rx)
 
 	/* Reset transmitter */
 	tx &= 1;
-	if (cpu_is_omap2430() || cpu_is_omap34xx()) {
+	if (cpu_is_omap2430() || cpu_is_omap34xx() || cpu_is_omap44xx()) {
 		w = MCBSP_READ_CACHE(mcbsp, XCCR);
 		w |= (tx ? XDISABLE : 0);
 		MCBSP_WRITE(mcbsp, XCCR, w);
@@ -899,7 +899,7 @@ void omap_mcbsp_stop(unsigned int id, int tx, int rx)
 
 	/* Reset receiver */
 	rx &= 1;
-	if (cpu_is_omap2430() || cpu_is_omap34xx()) {
+	if (cpu_is_omap2430() || cpu_is_omap34xx() || cpu_is_omap44xx) {
 		w = MCBSP_READ_CACHE(mcbsp, RCCR);
 		w |= (rx ? RDISABLE : 0);
 		MCBSP_WRITE(mcbsp, RCCR, w);
-- 
1.6.3.3


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* RE: [PATCH 1/2] ARM: McBSP: Fix request for irq in OMAP4
  2010-05-04 23:37 ` [PATCH 1/2] ARM: McBSP: Fix request for irq in OMAP4 Jorge Eduardo Candelaria
  2010-05-04 23:37   ` [PATCH 2/2] ARM: OMAP4: Add support for omap4 in McBSP driver Jorge Eduardo Candelaria
@ 2010-05-05  3:02   ` G, Manjunath Kondaiah
  2010-05-05 10:39     ` Jarkko Nikula
  2010-05-05 10:29   ` Jarkko Nikula
  2010-05-05 21:16   ` Kevin Hilman
  3 siblings, 1 reply; 9+ messages in thread
From: G, Manjunath Kondaiah @ 2010-05-05  3:02 UTC (permalink / raw)
  To: linux-omap; +Cc: Candelaria Villarreal, Jorge



> -----Original Message-----
> From: linux-omap-owner@vger.kernel.org 
> [mailto:linux-omap-owner@vger.kernel.org] On Behalf Of Jorge 
> Eduardo Candelaria
> Sent: Wednesday, May 05, 2010 5:08 AM
> To: linux-omap@vger.kernel.org
> Cc: Candelaria Villarreal, Jorge
> Subject: [PATCH 1/2] 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>
> ---
>  arch/arm/mach-omap2/mcbsp.c |   12 ++++--------
>  arch/arm/plat-omap/mcbsp.c  |   20 ++++++++++++--------
>  2 files changed, 16 insertions(+), 16 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c
> index 2f3cad6..6b550ec 100644
> --- a/arch/arm/mach-omap2/mcbsp.c
> +++ b/arch/arm/mach-omap2/mcbsp.c
> @@ -187,32 +187,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         = INT_44XX_MCBSP1_IRQ,
>  		.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         = INT_44XX_MCBSP2_IRQ,
>  		.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         = INT_44XX_MCBSP3_IRQ,
>  		.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         = INT_44XX_MCBSP4_IRQ,
>  		.ops            = &omap2_mcbsp_ops,
>  	},
>  };
> diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c
> index e1d0440..6e9660d 100644
> --- a/arch/arm/plat-omap/mcbsp.c
> +++ b/arch/arm/plat-omap/mcbsp.c
> @@ -724,14 +724,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 (!cpu_is_omap44xx) {
> +			init_completion(&mcbsp->rx_irq_completion);
> +			err = request_irq(mcbsp->rx_irq,
> +					omap_mcbsp_rx_irq_handler,
>  					0, "McBSP", (void *)mcbsp);

How about using request_threaded_irq?
Refer to: http://lwn.net/Articles/302043/

-Manjunath

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] ARM: McBSP: Fix request for irq in OMAP4
  2010-05-04 23:37 ` [PATCH 1/2] ARM: McBSP: Fix request for irq in OMAP4 Jorge Eduardo Candelaria
  2010-05-04 23:37   ` [PATCH 2/2] ARM: OMAP4: Add support for omap4 in McBSP driver Jorge Eduardo Candelaria
  2010-05-05  3:02   ` [PATCH 1/2] ARM: McBSP: Fix request for irq in OMAP4 G, Manjunath Kondaiah
@ 2010-05-05 10:29   ` Jarkko Nikula
  2010-05-05 11:11     ` Shilimkar, Santosh
  2010-05-05 21:16   ` Kevin Hilman
  3 siblings, 1 reply; 9+ messages in thread
From: Jarkko Nikula @ 2010-05-05 10:29 UTC (permalink / raw)
  To: Jorge Eduardo Candelaria; +Cc: linux-omap

On Tue,  4 May 2010 18:37:49 -0500
Jorge Eduardo Candelaria <jorge.candelaria@ti.com> wrote:

> 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>
> ---
>  arch/arm/mach-omap2/mcbsp.c |   12 ++++--------
>  arch/arm/plat-omap/mcbsp.c  |   20 ++++++++++++--------
>  2 files changed, 16 insertions(+), 16 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c
> index 2f3cad6..6b550ec 100644
> --- a/arch/arm/mach-omap2/mcbsp.c
> +++ b/arch/arm/mach-omap2/mcbsp.c
> @@ -187,32 +187,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         = INT_44XX_MCBSP1_IRQ,
>  		.ops            = &omap2_mcbsp_ops,
>  	},

These INT_44XX_MCBSPx appears to be undefined. Commit
5772ca7d7897722e7ed4c476bafee0b07bd9193e is removing them and I don't
find are there somewhere a patch adding them to irqs-44xx.h.


-- 
Jarkko

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] ARM: McBSP: Fix request for irq in OMAP4
  2010-05-05  3:02   ` [PATCH 1/2] ARM: McBSP: Fix request for irq in OMAP4 G, Manjunath Kondaiah
@ 2010-05-05 10:39     ` Jarkko Nikula
  2010-05-06  0:58       ` Candelaria Villarreal, Jorge
  0 siblings, 1 reply; 9+ messages in thread
From: Jarkko Nikula @ 2010-05-05 10:39 UTC (permalink / raw)
  To: G, Manjunath Kondaiah; +Cc: Candelaria Villarreal, Jorge, linux-omap

On Wed, 5 May 2010 08:32:13 +0530
"G, Manjunath Kondaiah" <manjugk@ti.com> wrote:

> > -		init_completion(&mcbsp->rx_irq_completion);
> > -		err = request_irq(mcbsp->rx_irq, 
> > omap_mcbsp_rx_irq_handler,
> > +		if (!cpu_is_omap44xx) {
> > +			init_completion(&mcbsp->rx_irq_completion);
> > +			err = request_irq(mcbsp->rx_irq,
> > +					omap_mcbsp_rx_irq_handler,
> >  					0, "McBSP", (void *)mcbsp);
> 
> How about using request_threaded_irq?
> Refer to: http://lwn.net/Articles/302043/
> 
Threaded irq conversion would be better to handle as a separate patch
as it does different thing than this patch.

-- 
Jarkko

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH 1/2] ARM: McBSP: Fix request for irq in OMAP4
  2010-05-05 10:29   ` Jarkko Nikula
@ 2010-05-05 11:11     ` Shilimkar, Santosh
  0 siblings, 0 replies; 9+ messages in thread
From: Shilimkar, Santosh @ 2010-05-05 11:11 UTC (permalink / raw)
  To: Jarkko Nikula, Candelaria Villarreal, Jorge; +Cc: linux-omap

> -----Original Message-----
> From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-owner@vger.kernel.org] On Behalf Of Jarkko
> Nikula
> Sent: Wednesday, May 05, 2010 4:00 PM
> To: Candelaria Villarreal, Jorge
> Cc: linux-omap@vger.kernel.org
> Subject: Re: [PATCH 1/2] ARM: McBSP: Fix request for irq in OMAP4
> 
> On Tue,  4 May 2010 18:37:49 -0500
> Jorge Eduardo Candelaria <jorge.candelaria@ti.com> wrote:
> 
> > 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>
> > ---
> >  arch/arm/mach-omap2/mcbsp.c |   12 ++++--------
> >  arch/arm/plat-omap/mcbsp.c  |   20 ++++++++++++--------
> >  2 files changed, 16 insertions(+), 16 deletions(-)
> >
> > diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c
> > index 2f3cad6..6b550ec 100644
> > --- a/arch/arm/mach-omap2/mcbsp.c
> > +++ b/arch/arm/mach-omap2/mcbsp.c
> > @@ -187,32 +187,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         = INT_44XX_MCBSP1_IRQ,
> >  		.ops            = &omap2_mcbsp_ops,
> >  	},
> 
> These INT_44XX_MCBSPx appears to be undefined. Commit
> 5772ca7d7897722e7ed4c476bafee0b07bd9193e is removing them and I don't
> find are there somewhere a patch adding them to irqs-44xx.h.

Name isn't right here. Should be "OMAP44XX_IRQ_MCBSP1" defined
in " arch/arm/plat-omap/include/plat/irqs-44xx.h"

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] ARM: McBSP: Fix request for irq in OMAP4
  2010-05-04 23:37 ` [PATCH 1/2] ARM: McBSP: Fix request for irq in OMAP4 Jorge Eduardo Candelaria
                     ` (2 preceding siblings ...)
  2010-05-05 10:29   ` Jarkko Nikula
@ 2010-05-05 21:16   ` Kevin Hilman
  3 siblings, 0 replies; 9+ messages in thread
From: Kevin Hilman @ 2010-05-05 21:16 UTC (permalink / raw)
  To: Jorge Eduardo Candelaria; +Cc: linux-omap

Jorge Eduardo Candelaria <jorge.candelaria@ti.com> writes:

> 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>
> ---
>  arch/arm/mach-omap2/mcbsp.c |   12 ++++--------
>  arch/arm/plat-omap/mcbsp.c  |   20 ++++++++++++--------
>  2 files changed, 16 insertions(+), 16 deletions(-)
>

[...]

> diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c
> index e1d0440..6e9660d 100644
> --- a/arch/arm/plat-omap/mcbsp.c
> +++ b/arch/arm/plat-omap/mcbsp.c
> @@ -724,14 +724,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 (!cpu_is_omap44xx) {

Instead of cpu_is* here, just use 'if (mcbsp->rx_irq)' which will
be more portable in other cases of no 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;
> +			}
>  		}
>  	}
>  
> @@ -781,7 +784,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 (!cpu_is_omap44xx())

here too

> +			free_irq(mcbsp->rx_irq, (void *)mcbsp);
>  		free_irq(mcbsp->tx_irq, (void *)mcbsp);
>  	}
>  

Kevin

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH 1/2] ARM: McBSP: Fix request for irq in OMAP4
  2010-05-05 10:39     ` Jarkko Nikula
@ 2010-05-06  0:58       ` Candelaria Villarreal, Jorge
  0 siblings, 0 replies; 9+ messages in thread
From: Candelaria Villarreal, Jorge @ 2010-05-06  0:58 UTC (permalink / raw)
  To: Jarkko Nikula, G, Manjunath Kondaiah; +Cc: linux-omap

Jarkko Nikula wrote:
> On Wed, 5 May 2010 08:32:13 +0530
> "G, Manjunath Kondaiah" <manjugk@ti.com> wrote:
> 
>>> -		init_completion(&mcbsp->rx_irq_completion);
>>> -		err = request_irq(mcbsp->rx_irq,
>>> omap_mcbsp_rx_irq_handler,
>>> +		if (!cpu_is_omap44xx) {
>>> +			init_completion(&mcbsp->rx_irq_completion);
>>> +			err = request_irq(mcbsp->rx_irq,
>>> +					omap_mcbsp_rx_irq_handler,
>>>  					0, "McBSP", (void *)mcbsp);
>> 
>> How about using request_threaded_irq?
>> Refer to: http://lwn.net/Articles/302043/
>> 
> Threaded irq conversion would be better to handle as a separate patch
> as it does different thing than this patch.

I will redo this patch without threaded irq for now, and will do the
conversion in a later patch then.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-05-06  0:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-04 23:37 [PATCH 0/0] McBSP changes for OMAP4 platform Jorge Eduardo Candelaria
2010-05-04 23:37 ` [PATCH 1/2] ARM: McBSP: Fix request for irq in OMAP4 Jorge Eduardo Candelaria
2010-05-04 23:37   ` [PATCH 2/2] ARM: OMAP4: Add support for omap4 in McBSP driver Jorge Eduardo Candelaria
2010-05-05  3:02   ` [PATCH 1/2] ARM: McBSP: Fix request for irq in OMAP4 G, Manjunath Kondaiah
2010-05-05 10:39     ` Jarkko Nikula
2010-05-06  0:58       ` Candelaria Villarreal, Jorge
2010-05-05 10:29   ` Jarkko Nikula
2010-05-05 11:11     ` Shilimkar, Santosh
2010-05-05 21:16   ` Kevin Hilman

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.