public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC/PATCH] twl4030: Set irq number based upon cpu type rather than requiring #define in board.h files
@ 2008-05-06 19:14 Steve Sakoman
  2008-05-06 21:28 ` Tony Lindgren
  0 siblings, 1 reply; 4+ messages in thread
From: Steve Sakoman @ 2008-05-06 19:14 UTC (permalink / raw)
  To: linux-omap@vger.kernel.org

From: Steve Sakoman <steve@sakoman.com>

Set twl4030 irq number based upon cpu type rather than requiring
#define in board.h files

Signed-off-by: Steve Sakoman <steve@sakoman.com>
---
diff -uprN a/drivers/i2c/chips/twl4030-core.c b/drivers/i2c/chips/twl4030-core.c
--- a/drivers/i2c/chips/twl4030-core.c	2008-05-06 10:45:14.000000000 -0700
+++ b/drivers/i2c/chips/twl4030-core.c	2008-05-06 10:57:01.000000000 -0700
@@ -716,6 +716,7 @@ static void twl_init_irq(void)
 	int	i = 0;
 	int	res = 0;
 	char	*msg = "Unable to register interrupt subsystem";
+	unsigned int irq_num;

 	/*
 	 * We end up with interrupts from other modules before
@@ -880,10 +881,12 @@ static void twl_init_irq(void)
 		set_irq_flags(i, IRQF_VALID);
 	}

+	irq_num = (cpu_is_omap2430()) ? INT_24XX_SYS_NIRQ : INT_34XX_SYS_NIRQ;
+
 	/* install an irq handler to demultiplex the TWL4030 interrupt */
-	set_irq_data(TWL4030_IRQNUM, start_twl4030_irq_thread(TWL4030_IRQNUM));
-	set_irq_type(TWL4030_IRQNUM, IRQT_FALLING);
-	set_irq_chained_handler(TWL4030_IRQNUM, do_twl4030_irq);
+	set_irq_data(irq_num, start_twl4030_irq_thread(irq_num));
+	set_irq_type(irq_num, IRQT_FALLING);
+	set_irq_chained_handler(irq_num, do_twl4030_irq);

 	res = power_companion_init();
 	if (res < 0)
diff -uprN a/include/asm-arm/arch-omap/board-2430osk.h
b/include/asm-arm/arch-omap/board-2430osk.h
--- a/include/asm-arm/arch-omap/board-2430osk.h	2008-05-05
22:30:26.000000000 -0700
+++ b/include/asm-arm/arch-omap/board-2430osk.h	2008-05-06
11:02:37.000000000 -0700
@@ -33,6 +33,4 @@
 #define OMAP24XX_ETHR_START		0x08000300
 #define OMAP24XX_ETHR_GPIO_IRQ		149

-#define TWL4030_IRQNUM			INT_24XX_SYS_NIRQ
-
 #endif /* __ASM_ARCH_OMAP_2430OSK_H */
diff -uprN a/include/asm-arm/arch-omap/board-2430sdp.h
b/include/asm-arm/arch-omap/board-2430sdp.h
--- a/include/asm-arm/arch-omap/board-2430sdp.h	2008-05-05
22:30:26.000000000 -0700
+++ b/include/asm-arm/arch-omap/board-2430sdp.h	2008-05-06
11:02:57.000000000 -0700
@@ -34,8 +34,6 @@
 #define OMAP24XX_ETHR_GPIO_IRQ		149
 #define SDP2430_CS0_BASE		0x04000000

-#define TWL4030_IRQNUM			INT_24XX_SYS_NIRQ
-
 /* Function prototypes */
 extern void sdp2430_flash_init(void);
 extern void sdp2430_usb_init(void);
diff -uprN a/include/asm-arm/arch-omap/board-3430sdp.h
b/include/asm-arm/arch-omap/board-3430sdp.h
--- a/include/asm-arm/arch-omap/board-3430sdp.h	2008-05-05
22:30:26.000000000 -0700
+++ b/include/asm-arm/arch-omap/board-3430sdp.h	2008-05-06
11:03:17.000000000 -0700
@@ -66,7 +66,5 @@ extern void sdp3430_usb_init(void);
 #define FLASH_SIZE_SDPV1	SZ_64M
 #define FLASH_SIZE_SDPV2	SZ_128M

-#define TWL4030_IRQNUM INT_34XX_SYS_NIRQ
-
 #endif /* __ASM_ARCH_OMAP_3430SDP_H */

diff -uprN a/include/asm-arm/arch-omap/board-omap3beagle.h
b/include/asm-arm/arch-omap/board-omap3beagle.h
--- a/include/asm-arm/arch-omap/board-omap3beagle.h	2008-05-05
22:30:26.000000000 -0700
+++ b/include/asm-arm/arch-omap/board-omap3beagle.h	2008-05-06
11:03:34.000000000 -0700
@@ -29,7 +29,5 @@
 #ifndef __ASM_ARCH_OMAP3_BEAGLE_H
 #define __ASM_ARCH_OMAP3_BEAGLE_H

-#define TWL4030_IRQNUM		INT_34XX_SYS_NIRQ
-
 #endif /* __ASM_ARCH_OMAP3_BEAGLE_H */

diff -uprN a/include/asm-arm/arch-omap/board-omap3evm.h
b/include/asm-arm/arch-omap/board-omap3evm.h
--- a/include/asm-arm/arch-omap/board-omap3evm.h	2008-05-05
22:30:26.000000000 -0700
+++ b/include/asm-arm/arch-omap/board-omap3evm.h	2008-05-06
11:04:01.000000000 -0700
@@ -31,8 +31,6 @@

 extern void omap3evm_flash_init(void);

-#define TWL4030_IRQNUM		INT_34XX_SYS_NIRQ
-
 #define ONENAND_MAP		0x20000000

 #endif /* __ASM_ARCH_OMAP3_EVM_H */

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

* Re: [RFC/PATCH] twl4030: Set irq number based upon cpu type rather than requiring #define in board.h files
  2008-05-06 19:14 [RFC/PATCH] twl4030: Set irq number based upon cpu type rather than requiring #define in board.h files Steve Sakoman
@ 2008-05-06 21:28 ` Tony Lindgren
  2008-05-06 22:38   ` Felipe Balbi
  0 siblings, 1 reply; 4+ messages in thread
From: Tony Lindgren @ 2008-05-06 21:28 UTC (permalink / raw)
  To: Steve Sakoman; +Cc: linux-omap@vger.kernel.org

* Steve Sakoman <sakoman@gmail.com> [080506 12:15]:
> From: Steve Sakoman <steve@sakoman.com>
> 
> Set twl4030 irq number based upon cpu type rather than requiring
> #define in board.h files

Thanks, looks good to me until we have a patch that passes the irq
in struct i2c_board_info.

Tony

> Signed-off-by: Steve Sakoman <steve@sakoman.com>
> ---
> diff -uprN a/drivers/i2c/chips/twl4030-core.c b/drivers/i2c/chips/twl4030-core.c
> --- a/drivers/i2c/chips/twl4030-core.c	2008-05-06 10:45:14.000000000 -0700
> +++ b/drivers/i2c/chips/twl4030-core.c	2008-05-06 10:57:01.000000000 -0700
> @@ -716,6 +716,7 @@ static void twl_init_irq(void)
>  	int	i = 0;
>  	int	res = 0;
>  	char	*msg = "Unable to register interrupt subsystem";
> +	unsigned int irq_num;
> 
>  	/*
>  	 * We end up with interrupts from other modules before
> @@ -880,10 +881,12 @@ static void twl_init_irq(void)
>  		set_irq_flags(i, IRQF_VALID);
>  	}
> 
> +	irq_num = (cpu_is_omap2430()) ? INT_24XX_SYS_NIRQ : INT_34XX_SYS_NIRQ;
> +
>  	/* install an irq handler to demultiplex the TWL4030 interrupt */
> -	set_irq_data(TWL4030_IRQNUM, start_twl4030_irq_thread(TWL4030_IRQNUM));
> -	set_irq_type(TWL4030_IRQNUM, IRQT_FALLING);
> -	set_irq_chained_handler(TWL4030_IRQNUM, do_twl4030_irq);
> +	set_irq_data(irq_num, start_twl4030_irq_thread(irq_num));
> +	set_irq_type(irq_num, IRQT_FALLING);
> +	set_irq_chained_handler(irq_num, do_twl4030_irq);
> 
>  	res = power_companion_init();
>  	if (res < 0)
> diff -uprN a/include/asm-arm/arch-omap/board-2430osk.h
> b/include/asm-arm/arch-omap/board-2430osk.h
> --- a/include/asm-arm/arch-omap/board-2430osk.h	2008-05-05
> 22:30:26.000000000 -0700
> +++ b/include/asm-arm/arch-omap/board-2430osk.h	2008-05-06
> 11:02:37.000000000 -0700
> @@ -33,6 +33,4 @@
>  #define OMAP24XX_ETHR_START		0x08000300
>  #define OMAP24XX_ETHR_GPIO_IRQ		149
> 
> -#define TWL4030_IRQNUM			INT_24XX_SYS_NIRQ
> -
>  #endif /* __ASM_ARCH_OMAP_2430OSK_H */
> diff -uprN a/include/asm-arm/arch-omap/board-2430sdp.h
> b/include/asm-arm/arch-omap/board-2430sdp.h
> --- a/include/asm-arm/arch-omap/board-2430sdp.h	2008-05-05
> 22:30:26.000000000 -0700
> +++ b/include/asm-arm/arch-omap/board-2430sdp.h	2008-05-06
> 11:02:57.000000000 -0700
> @@ -34,8 +34,6 @@
>  #define OMAP24XX_ETHR_GPIO_IRQ		149
>  #define SDP2430_CS0_BASE		0x04000000
> 
> -#define TWL4030_IRQNUM			INT_24XX_SYS_NIRQ
> -
>  /* Function prototypes */
>  extern void sdp2430_flash_init(void);
>  extern void sdp2430_usb_init(void);
> diff -uprN a/include/asm-arm/arch-omap/board-3430sdp.h
> b/include/asm-arm/arch-omap/board-3430sdp.h
> --- a/include/asm-arm/arch-omap/board-3430sdp.h	2008-05-05
> 22:30:26.000000000 -0700
> +++ b/include/asm-arm/arch-omap/board-3430sdp.h	2008-05-06
> 11:03:17.000000000 -0700
> @@ -66,7 +66,5 @@ extern void sdp3430_usb_init(void);
>  #define FLASH_SIZE_SDPV1	SZ_64M
>  #define FLASH_SIZE_SDPV2	SZ_128M
> 
> -#define TWL4030_IRQNUM INT_34XX_SYS_NIRQ
> -
>  #endif /* __ASM_ARCH_OMAP_3430SDP_H */
> 
> diff -uprN a/include/asm-arm/arch-omap/board-omap3beagle.h
> b/include/asm-arm/arch-omap/board-omap3beagle.h
> --- a/include/asm-arm/arch-omap/board-omap3beagle.h	2008-05-05
> 22:30:26.000000000 -0700
> +++ b/include/asm-arm/arch-omap/board-omap3beagle.h	2008-05-06
> 11:03:34.000000000 -0700
> @@ -29,7 +29,5 @@
>  #ifndef __ASM_ARCH_OMAP3_BEAGLE_H
>  #define __ASM_ARCH_OMAP3_BEAGLE_H
> 
> -#define TWL4030_IRQNUM		INT_34XX_SYS_NIRQ
> -
>  #endif /* __ASM_ARCH_OMAP3_BEAGLE_H */
> 
> diff -uprN a/include/asm-arm/arch-omap/board-omap3evm.h
> b/include/asm-arm/arch-omap/board-omap3evm.h
> --- a/include/asm-arm/arch-omap/board-omap3evm.h	2008-05-05
> 22:30:26.000000000 -0700
> +++ b/include/asm-arm/arch-omap/board-omap3evm.h	2008-05-06
> 11:04:01.000000000 -0700
> @@ -31,8 +31,6 @@
> 
>  extern void omap3evm_flash_init(void);
> 
> -#define TWL4030_IRQNUM		INT_34XX_SYS_NIRQ
> -
>  #define ONENAND_MAP		0x20000000
> 
>  #endif /* __ASM_ARCH_OMAP3_EVM_H */
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [RFC/PATCH] twl4030: Set irq number based upon cpu type rather than requiring #define in board.h files
  2008-05-06 21:28 ` Tony Lindgren
@ 2008-05-06 22:38   ` Felipe Balbi
  2008-05-06 23:29     ` Tony Lindgren
  0 siblings, 1 reply; 4+ messages in thread
From: Felipe Balbi @ 2008-05-06 22:38 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Steve Sakoman, linux-omap@vger.kernel.org

On Tue, May 06, 2008 at 02:28:09PM -0700, Tony Lindgren wrote:
> * Steve Sakoman <sakoman@gmail.com> [080506 12:15]:
> > From: Steve Sakoman <steve@sakoman.com>
> > 
> > Set twl4030 irq number based upon cpu type rather than requiring
> > #define in board.h files
> 
> Thanks, looks good to me until we have a patch that passes the irq
> in struct i2c_board_info.

I started working on this, but it's really a lot of work. Any changes in
twl4030-core seems to break other modules. So i'll try to make it not
too invasive on the current code for now.

Anyway, try to make it before 2.6.27 :-p

-- 
Best Regards,

Felipe Balbi
me@felipebalbi.com
http://blog.felipebalbi.com

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

* Re: [RFC/PATCH] twl4030: Set irq number based upon cpu type rather than requiring #define in board.h files
  2008-05-06 22:38   ` Felipe Balbi
@ 2008-05-06 23:29     ` Tony Lindgren
  0 siblings, 0 replies; 4+ messages in thread
From: Tony Lindgren @ 2008-05-06 23:29 UTC (permalink / raw)
  To: Felipe Balbi; +Cc: Steve Sakoman, linux-omap@vger.kernel.org

* Felipe Balbi <me@felipebalbi.com> [080506 15:37]:
> On Tue, May 06, 2008 at 02:28:09PM -0700, Tony Lindgren wrote:
> > * Steve Sakoman <sakoman@gmail.com> [080506 12:15]:
> > > From: Steve Sakoman <steve@sakoman.com>
> > > 
> > > Set twl4030 irq number based upon cpu type rather than requiring
> > > #define in board.h files
> > 
> > Thanks, looks good to me until we have a patch that passes the irq
> > in struct i2c_board_info.
> 
> I started working on this, but it's really a lot of work. Any changes in
> twl4030-core seems to break other modules. So i'll try to make it not
> too invasive on the current code for now.
> 
> Anyway, try to make it before 2.6.27 :-p

OK, good to hear you're working on it. I'll push Steve's patch
meanwhile.

Tony

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

end of thread, other threads:[~2008-05-06 23:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-06 19:14 [RFC/PATCH] twl4030: Set irq number based upon cpu type rather than requiring #define in board.h files Steve Sakoman
2008-05-06 21:28 ` Tony Lindgren
2008-05-06 22:38   ` Felipe Balbi
2008-05-06 23:29     ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox