Skip to contentSkip to conversation

OMAP4: PMIC: Add support for twl6030 irq framework

PATCH In review [email protected] 1 participant 1 message Dec 11, 2009

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v4 5/8 OMAP4: PMIC: Add support for twl6030 irq framework

From: Balaji T K <[email protected]>

This version of patch series enables RUN TIME selection of TWL4030 or TWL6030. CONFIG_TWL4030_CORE and CONFIG_TWL6030_CORE is replaced by CONFIG_TWL4030_CORE

This patch adds support for phoenix interrupt framework. New Interrupt status register A, B, C are introduced in Phoenix and are cleared on write. Due to difference in interrupt handling with respect to TWL4030, twl6030-irq.c is created for TWL6030 PMIC

---
 arch/arm/plat-omap/include/plat/irqs.h |   16 ++-
 drivers/mfd/Kconfig                    |    4 +-
 drivers/mfd/Makefile                   |    2 +-
 drivers/mfd/twl-core.c                 |  113 +++++++++++--
 drivers/mfd/twl4030-irq.c              |    4 +-
 drivers/mfd/twl6030-irq.c              |  297 ++++++++++++++++++++++++++++++++
 include/linux/i2c/twl.h                |   64 +++++++
 7 files changed, 482 insertions(+), 18 deletions(-)
 create mode 100644 drivers/mfd/twl6030-irq.c
arch/arm/plat-omap/include/plat/irqs.h +15 -1
index ce5dd2d..97d6c50 100644
@@ -472,8 +472,22 @@
 #endif
 #define TWL4030_GPIO_IRQ_END	(TWL4030_GPIO_IRQ_BASE + TWL4030_GPIO_NR_IRQS)
 
+#define	TWL6030_IRQ_BASE	(OMAP_FPGA_IRQ_END)
+#ifdef CONFIG_TWL4030_CORE
+#define	TWL6030_BASE_NR_IRQS	20
+#else
+#define	TWL6030_BASE_NR_IRQS	0
+#endif
+#define TWL6030_IRQ_END		(TWL6030_IRQ_BASE + TWL6030_BASE_NR_IRQS)
+
 /* Total number of interrupts depends on the enabled blocks above */
-#define NR_IRQS			TWL4030_GPIO_IRQ_END
+#if (TWL4030_GPIO_IRQ_END > TWL6030_IRQ_END)
+#define TWL_IRQ_END 		TWL4030_GPIO_IRQ_END
+#else
+#define TWL_IRQ_END		TWL6030_IRQ_END
+#endif
+
+#define NR_IRQS			TWL_IRQ_END
 
 #define OMAP_IRQ_BIT(irq)	(1 << ((irq) % 32))
 
drivers/mfd/Kconfig +2 -2
index 08f2d07..9ee2ea4 100644
@@ -95,10 +95,10 @@ config MENELAUS
 	  cell phones and PDAs.
 
 config TWL4030_CORE
-	bool "Texas Instruments TWL4030/TPS659x0 Support"
+	bool "Texas Instruments TWL4030/TWL5030/TWL6030/TPS659x0 Support"
 	depends on I2C=y && GENERIC_HARDIRQS
 	help
-	  Say yes here if you have TWL4030 family chip on your board.
+	  Say yes here if you have TWL4030 / TWL6030 family chip on your board.
 	  This core driver provides register access and IRQ handling
 	  facilities, and registers devices for the various functions
 	  so that function-specific drivers can bind to them.
drivers/mfd/Makefile +1 -1
index 986adfc..5f7fc28 100644
@@ -24,7 +24,7 @@ obj-$(CONFIG_MFD_WM8350_I2C)	+= wm8350-i2c.o
 obj-$(CONFIG_TPS65010)		+= tps65010.o
 obj-$(CONFIG_MENELAUS)		+= menelaus.o
 
-obj-$(CONFIG_TWL4030_CORE)	+= twl-core.o twl4030-irq.o
+obj-$(CONFIG_TWL4030_CORE)	+= twl-core.o twl4030-irq.o twl6030-irq.o
 obj-$(CONFIG_TWL4030_POWER)    += twl4030-power.o
 obj-$(CONFIG_TWL4030_CODEC)	+= twl4030-codec.o
 
drivers/mfd/twl-core.c +101 -12

225 lines not on this page · raw message

drivers/mfd/twl4030-irq.c +2 -2
index ef04922..94a29e8 100644
@@ -668,7 +668,7 @@ int twl4030_sih_setup(int module)
 /* FIXME pass in which interrupt line we'll use ... */
 #define twl_irq_line	0
 
-int twl_init_irq(int irq_num, unsigned irq_base, unsigned irq_end)
+int twl4030_init_irq(int irq_num, unsigned irq_base, unsigned irq_end)
 {
 	static struct irq_chip	twl4030_irq_chip;
 
@@ -747,7 +747,7 @@ fail:
 	return status;
 }
 
-int twl_exit_irq(void)
+int twl4030_exit_irq(void)
 {
 	/* FIXME undo twl_init_irq() */
 	if (twl4030_irq_base) {
drivers/mfd/twl6030-irq.c new file +297 -0

297 lines not on this page · raw message

include/linux/i2c/twl.h +64 -0

76 lines not on this page · raw message

Signature · 1 line
1.5.4.7