Hi Balaji,
Some comments inline.
On 09 Oct 01, balaj...@ti.com wrote:
From: Balaji T K balaj...@ti.com
This version of patch series enables RUN TIME selection of TWL4030 or TWL6030.
CONFIG_TWL4030_CORE and CONFIG_TWL6030_CORE is replaced by CONFIG_TWL_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
Signed-off-by: Rajendra Nayak rna...@ti.com
Signed-off-by: Balaji T K balaj...@ti.com
Signed-off-by: Santosh Shilimkar santosh.shilim...@ti.com
Acked-by: Samuel Ortiz sa...@linux.intel.com
Reviewed-by: Tony Lindgren t...@atomide.com
---
arch/arm/plat-omap/include/mach/irqs.h | 18 ++-
drivers/mfd/Kconfig|6 +-
drivers/mfd/Makefile |2 +-
drivers/mfd/twl-core.c | 124 --
drivers/mfd/twl4030-irq.c |4 +-
drivers/mfd/twl6030-irq.c | 299
include/linux/i2c/twl.h| 62 +++
7 files changed, 495 insertions(+), 20 deletions(-)
create mode 100644 drivers/mfd/twl6030-irq.c
diff --git a/arch/arm/plat-omap/include/mach/irqs.h
b/arch/arm/plat-omap/include/mach/irqs.h
index fb7cb77..e9e0500 100644
--- a/arch/arm/plat-omap/include/mach/irqs.h
+++ b/arch/arm/plat-omap/include/mach/irqs.h
@@ -531,7 +531,7 @@
/* External TWL4030 can handle interrupts on 2430 and 34xx boards */
#define TWL4030_IRQ_BASE(OMAP_FPGA_IRQ_END)
-#ifdef CONFIG_TWL4030_CORE
+#ifdef CONFIG_TWL_CORE
#define TWL4030_BASE_NR_IRQS8
#define TWL4030_PWR_NR_IRQS 8
#else
@@ -551,8 +551,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_TWL_CORE
+#define TWL6030_BASE_NR_IRQS20
+#else
+#define TWL6030_BASE_NR_IRQS0
+#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))
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 491ac0f..c714281 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -94,11 +94,11 @@ config MENELAUS
and other features that are often used in portable devices like
cell phones and PDAs.
-config TWL4030_CORE
- bool Texas Instruments TWL4030/TPS659x0 Support
+config TWL_CORE
+ 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.
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index 4e9d513..c733440 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -22,7 +22,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_TWL_CORE) += twl-core.o twl4030-irq.o
twl6030-irq.o
obj-$(CONFIG_MFD_CORE) += mfd-core.o
diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
index 62ace48..73d50c9 100644
--- a/drivers/mfd/twl-core.c
+++ b/drivers/mfd/twl-core.c
@@ -158,6 +158,33 @@
/* Triton Core internal information (END) */
+/* subchip/slave 0 0x48 - POWER */
+#define TWL6030_BASEADD_RTC 0x
+#define TWL6030_BASEADD_MEM 0x0017
+#define TWL6030_BASEADD_PM_MASTER0x001F
+#define TWL6030_BASEADD_PM_SLAVE_MISC0x0031
+#define TWL6030_BASEADD_PM_SLAVE_SMPS0x0040
+#define TWL6030_BASEADD_PM_SLAVE_LDO 0x0080
+#define TWL6030_BASEADD_PM_SLAVE_RES 0x00AD
+#define TWL6030_BASEADD_PM_MISC 0x00E2
+#define TWL6030_BASEADD_PM_PUPD 0x00F0
+
+/* subchip/slave 1 0x49 - FEATURE */
+#define TWL6030_BASEADD_USB 0x
+#define TWL6030_BASEADD_GPADC_CTRL 0x002E
+#define TWL6030_BASEADD_AUX 0x0090
+#define TWL6030_BASEADD_PWM 0x00BA
+#define TWL6030_BASEADD_GASGAUGE 0x00C0
+#define TWL6030_BASEADD_PIH 0x00D0