public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2 RFC]OMAP3430: hwmod FW for GPIO
@ 2010-02-12 13:39 Varadarajan, Charulatha
  2010-02-12 13:39 ` [PATCH 1/2 RFC]OMAP3430: hwmod: add GPIO hwmods Varadarajan, Charulatha
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Varadarajan, Charulatha @ 2010-02-12 13:39 UTC (permalink / raw)
  To: linux-omap; +Cc: Charulatha V

From: Charulatha V <charu@ti.com>

This patch series makes the OMAP3430 GPIO module
use hwmod framework.

This patch series applies on top of pm branch
and it requires my previous patch set which converts
GPIO into an early init device. 

They are boot tested on SDP 3430 and compile tested
for OMAP 2420 and 2430.

Charulatha V (2):
  OMAP3: hwmod: add GPIO hwmods for OMAP3430
  OMAP3: hwmod: Adapt HWMOD FW for GPIO OMAP3430

 arch/arm/mach-omap2/gpio.c             |  901 ++++----------------------------
 arch/arm/mach-omap2/omap_hwmod_34xx.h  |  410 +++++++++++++++
 arch/arm/plat-omap/include/plat/gpio.h |   25 +-
 3 files changed, 533 insertions(+), 803 deletions(-)


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

* [PATCH 1/2 RFC]OMAP3430: hwmod: add GPIO hwmods
  2010-02-12 13:39 [PATCH 0/2 RFC]OMAP3430: hwmod FW for GPIO Varadarajan, Charulatha
@ 2010-02-12 13:39 ` Varadarajan, Charulatha
  2010-02-12 13:39   ` [PATCH 2/2 RFC]OMAP3430: hwmod: Adapt GPIO to use HWMOD FW Varadarajan, Charulatha
  2010-02-12 21:50 ` [PATCH 0/2 RFC]OMAP3430: hwmod FW for GPIO Paul Walmsley
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: Varadarajan, Charulatha @ 2010-02-12 13:39 UTC (permalink / raw)
  To: linux-omap; +Cc: Charulatha V, Rajendra Nayak

From: Charulatha V <charu@ti.com>

Add hwmod structures for GPIO module on OMAP3430.

Signed-off-by: Charulatha V <charu@ti.com>
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
---
 arch/arm/mach-omap2/omap_hwmod_34xx.h |  410 +++++++++++++++++++++++++++++++++
 1 files changed, 410 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_34xx.h b/arch/arm/mach-omap2/omap_hwmod_34xx.h
index 2e629dc..b22b458 100644
--- a/arch/arm/mach-omap2/omap_hwmod_34xx.h
+++ b/arch/arm/mach-omap2/omap_hwmod_34xx.h
@@ -18,6 +18,7 @@
 #include <mach/irqs.h>
 #include <plat/cpu.h>
 #include <plat/dma.h>
+#include <plat/gpio.h>
 
 #include "prm-regbits-34xx.h"
 
@@ -25,6 +26,12 @@ static struct omap_hwmod omap34xx_mpu_hwmod;
 static struct omap_hwmod omap34xx_l3_hwmod;
 static struct omap_hwmod omap34xx_l4_core_hwmod;
 static struct omap_hwmod omap34xx_l4_per_hwmod;
+static struct omap_hwmod omap34xx_gpio1_hwmod;
+static struct omap_hwmod omap34xx_gpio2_hwmod;
+static struct omap_hwmod omap34xx_gpio3_hwmod;
+static struct omap_hwmod omap34xx_gpio4_hwmod;
+static struct omap_hwmod omap34xx_gpio5_hwmod;
+static struct omap_hwmod omap34xx_gpio6_hwmod;
 
 /* L3 -> L4_CORE interface */
 static struct omap_hwmod_ocp_if omap34xx_l3__l4_core = {
@@ -70,6 +77,168 @@ static struct omap_hwmod omap34xx_l3_hwmod = {
 
 static struct omap_hwmod omap34xx_l4_wkup_hwmod;
 
+/*
+ * GPIO1 interface data
+ */
+
+static struct omap_hwmod_addr_space omap34xx_gpio1_addr_space[] = {
+	{
+		.pa_start	= OMAP34XX_GPIO1_BASE,
+		.pa_end		= OMAP34XX_GPIO1_BASE + OMAP3_GPIO_AS_LEN - 1,
+		.flags		= ADDR_TYPE_RT
+	},
+};
+
+/* GPIO1 <- L4_WKUP interface */
+static struct omap_hwmod_ocp_if omap34xx_l4_wkup__gpio1 = {
+	.master		= &omap34xx_l4_wkup_hwmod,
+	.slave		= &omap34xx_gpio1_hwmod,
+	.clkdev_dev_id	= NULL,
+	.clkdev_con_id	= "gpio1_ick",
+	.addr		= omap34xx_gpio1_addr_space,
+	.addr_cnt	= ARRAY_SIZE(omap34xx_gpio1_addr_space),
+	.user		= OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+static struct omap_hwmod_ocp_if *omap34xx_gpio1_slaves[] = {
+	&omap34xx_l4_wkup__gpio1,
+};
+
+/*
+ * GPIO2 interface data
+ */
+
+static struct omap_hwmod_addr_space omap34xx_gpio2_addr_space[] = {
+	{
+		.pa_start	= OMAP34XX_GPIO2_BASE,
+		.pa_end		= OMAP34XX_GPIO2_BASE + OMAP3_GPIO_AS_LEN - 1,
+		.flags		= ADDR_TYPE_RT
+	},
+};
+
+/* GPIO2 <- L4_PER interface */
+static struct omap_hwmod_ocp_if omap34xx_l4_per__gpio2 = {
+	.master		= &omap34xx_l4_per_hwmod,
+	.slave		= &omap34xx_gpio2_hwmod,
+	.clkdev_dev_id	= NULL,
+	.clkdev_con_id	= "gpio2_ick",
+	.addr		= omap34xx_gpio2_addr_space,
+	.addr_cnt	= ARRAY_SIZE(omap34xx_gpio2_addr_space),
+	.user		= OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+static struct omap_hwmod_ocp_if *omap34xx_gpio2_slaves[] = {
+	&omap34xx_l4_per__gpio2,
+};
+
+/*
+ * GPIO3 interface data
+ */
+
+static struct omap_hwmod_addr_space omap34xx_gpio3_addr_space[] = {
+	{
+		.pa_start	= OMAP34XX_GPIO3_BASE,
+		.pa_end		= OMAP34XX_GPIO3_BASE + OMAP3_GPIO_AS_LEN - 1,
+		.flags		= ADDR_TYPE_RT
+	},
+};
+
+/* GPIO3 <- L4_PER interface */
+static struct omap_hwmod_ocp_if omap34xx_l4_per__gpio3 = {
+	.master		= &omap34xx_l4_per_hwmod,
+	.slave		= &omap34xx_gpio3_hwmod,
+	.clkdev_dev_id	= NULL,
+	.clkdev_con_id	= "gpio3_ick",
+	.addr		= omap34xx_gpio3_addr_space,
+	.addr_cnt	= ARRAY_SIZE(omap34xx_gpio3_addr_space),
+	.user		= OCP_USER_MPU | OCP_USER_SDMA,
+};
+static struct omap_hwmod_ocp_if *omap34xx_gpio3_slaves[] = {
+	&omap34xx_l4_per__gpio3,
+};
+
+/*
+ * GPIO4 interface data
+ */
+
+static struct omap_hwmod_addr_space omap34xx_gpio4_addr_space[] = {
+	{
+		.pa_start	= OMAP34XX_GPIO4_BASE,
+		.pa_end		= OMAP34XX_GPIO4_BASE + OMAP3_GPIO_AS_LEN - 1,
+		.flags		= ADDR_TYPE_RT
+	},
+};
+
+/* GPIO4 <- L4_PER interface */
+static struct omap_hwmod_ocp_if omap34xx_l4_per__gpio4 = {
+	.master		= &omap34xx_l4_per_hwmod,
+	.slave		= &omap34xx_gpio4_hwmod,
+	.clkdev_dev_id	= NULL,
+	.clkdev_con_id	= "gpio4_ick",
+	.addr		= omap34xx_gpio4_addr_space,
+	.addr_cnt	= ARRAY_SIZE(omap34xx_gpio4_addr_space),
+	.user		= OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+static struct omap_hwmod_ocp_if *omap34xx_gpio4_slaves[] = {
+	&omap34xx_l4_per__gpio4,
+};
+
+/*
+ * GPIO5 interface data
+ */
+
+static struct omap_hwmod_addr_space omap34xx_gpio5_addr_space[] = {
+	{
+		.pa_start	= OMAP34XX_GPIO5_BASE,
+		.pa_end		= OMAP34XX_GPIO5_BASE + OMAP3_GPIO_AS_LEN - 1,
+		.flags		= ADDR_TYPE_RT
+	},
+};
+
+/* GPIO5 <- L4_PER interface */
+static struct omap_hwmod_ocp_if omap34xx_l4_per__gpio5 = {
+	.master		= &omap34xx_l4_per_hwmod,
+	.slave		= &omap34xx_gpio5_hwmod,
+	.clkdev_dev_id	= NULL,
+	.clkdev_con_id	= "gpio5_ick",
+	.addr		= omap34xx_gpio5_addr_space,
+	.addr_cnt	= ARRAY_SIZE(omap34xx_gpio5_addr_space),
+	.user		= OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+static struct omap_hwmod_ocp_if *omap34xx_gpio5_slaves[] = {
+	&omap34xx_l4_per__gpio5,
+};
+
+/*
+ * GPIO6 interface data
+ */
+
+static struct omap_hwmod_addr_space omap34xx_gpio6_addr_space[] = {
+	{
+		.pa_start	= OMAP34XX_GPIO6_BASE,
+		.pa_end		= OMAP34XX_GPIO6_BASE + OMAP3_GPIO_AS_LEN - 1,
+		.flags		= ADDR_TYPE_RT
+	},
+};
+
+/* GPIO6 <- L4_PER interface */
+static struct omap_hwmod_ocp_if omap34xx_l4_per__gpio6 = {
+	.master		= &omap34xx_l4_per_hwmod,
+	.slave		= &omap34xx_gpio6_hwmod,
+	.clkdev_dev_id	= NULL,
+	.clkdev_con_id	= "gpio6_ick",
+	.addr		= omap34xx_gpio6_addr_space,
+	.addr_cnt	= ARRAY_SIZE(omap34xx_gpio6_addr_space),
+	.user		= OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+static struct omap_hwmod_ocp_if *omap34xx_gpio6_slaves[] = {
+	&omap34xx_l4_per__gpio6,
+};
+
+
 /* L4_CORE -> L4_WKUP interface */
 static struct omap_hwmod_ocp_if omap34xx_l4_core__l4_wkup = {
 	.master	= &omap34xx_l4_core_hwmod,
@@ -104,6 +273,11 @@ static struct omap_hwmod_ocp_if *omap34xx_l4_per_slaves[] = {
 
 /* Master interfaces on the L4_PER interconnect */
 static struct omap_hwmod_ocp_if *omap34xx_l4_per_masters[] = {
+	&omap34xx_l4_per__gpio2,
+	&omap34xx_l4_per__gpio3,
+	&omap34xx_l4_per__gpio4,
+	&omap34xx_l4_per__gpio5,
+	&omap34xx_l4_per__gpio6,
 };
 
 /* L4 PER */
@@ -119,10 +293,12 @@ static struct omap_hwmod omap34xx_l4_per_hwmod = {
 /* Slave interfaces on the L4_WKUP interconnect */
 static struct omap_hwmod_ocp_if *omap34xx_l4_wkup_slaves[] = {
 	&omap34xx_l4_core__l4_wkup,
+	&omap34xx_l4_wkup__gpio1,
 };
 
 /* Master interfaces on the L4_WKUP interconnect */
 static struct omap_hwmod_ocp_if *omap34xx_l4_wkup_masters[] = {
+	&omap34xx_l4_wkup__gpio1,
 };
 
 /* L4 WKUP */
@@ -150,12 +326,246 @@ static struct omap_hwmod omap34xx_mpu_hwmod = {
 	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
 };
 
+/*
+ * GPIO1 (GPIO1)
+ */
+
+static struct omap_hwmod_sysconfig gpio_if_ctrl = {
+	.rev_offs	= 0x0000,
+	.sysc_offs	= 0x0010,
+	.syss_offs	= 0x0014,
+	.sysc_flags	= (SYSC_HAS_SIDLEMODE |
+			   SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
+			   SYSC_HAS_AUTOIDLE),
+	.idlemodes	= (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
+};
+
+static struct omap_hwmod_irq_info omap34xx_gpio1_mpu_irqs[] = {
+	{ .name = "gpio_mpu_irq", .irq = INT_34XX_GPIO_BANK1 },
+};
+
+static struct omap_hwmod_opt_clk omap34xx_gpio1_opt_clk[] = {
+	{
+		.role = "gpio1_dbclk",
+		.clkdev_dev_id	= NULL,
+		.clkdev_con_id	= "gpio1_dbck",
+	},
+};
+
+static struct omap_hwmod omap34xx_gpio1_hwmod = {
+	.name		= "gpio1_hwmod",
+	.mpu_irqs	= omap34xx_gpio1_mpu_irqs,
+	.mpu_irqs_cnt	= ARRAY_SIZE(omap34xx_gpio1_mpu_irqs),
+	.clkdev_dev_id	= NULL,
+	.clkdev_con_id	= NULL,
+	.opt_clks	= omap34xx_gpio1_opt_clk,
+	.opt_clks_cnt	= ARRAY_SIZE(omap34xx_gpio1_opt_clk),
+	.prcm		= {
+		.omap2 = {
+			.prcm_reg_id = 1,
+			.module_bit = OMAP3430_EN_GPIO1_SHIFT,
+		},
+	},
+	.slaves		= omap34xx_gpio1_slaves,
+	.slaves_cnt	= ARRAY_SIZE(omap34xx_gpio1_slaves),
+	.sysconfig	= &gpio_if_ctrl,
+	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+/*
+ * GPIO2 (GPIO2)
+ */
+
+static struct omap_hwmod_irq_info omap34xx_gpio2_mpu_irqs[] = {
+	{ .name = "gpio_mpu_irq", .irq = INT_34XX_GPIO_BANK2 },
+};
+
+static struct omap_hwmod_opt_clk omap34xx_gpio2_opt_clk[] = {
+	{
+		.role = "gpio2_dbclk",
+		.clkdev_dev_id	= NULL,
+		.clkdev_con_id	= "gpio2_dbck",
+	},
+};
+
+static struct omap_hwmod omap34xx_gpio2_hwmod = {
+	.name		= "gpio2_hwmod",
+	.mpu_irqs	= omap34xx_gpio2_mpu_irqs,
+	.mpu_irqs_cnt	= ARRAY_SIZE(omap34xx_gpio2_mpu_irqs),
+	.clkdev_dev_id	= NULL,
+	.clkdev_con_id	= NULL,
+	.opt_clks	= omap34xx_gpio2_opt_clk,
+	.opt_clks_cnt	= ARRAY_SIZE(omap34xx_gpio2_opt_clk),
+	.prcm		= {
+		.omap2 = {
+			.prcm_reg_id = 1,
+			.module_bit = OMAP3430_EN_GPIO2_SHIFT,
+		},
+	},
+	.slaves		= omap34xx_gpio2_slaves,
+	.slaves_cnt	= ARRAY_SIZE(omap34xx_gpio2_slaves),
+	.sysconfig	= &gpio_if_ctrl,
+	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+/*
+ * GPIO3 (GPIO3)
+ */
+
+static struct omap_hwmod_irq_info omap34xx_gpio3_mpu_irqs[] = {
+	{ .name = "gpio_mpu_irq", .irq = INT_34XX_GPIO_BANK3 },
+};
+
+static struct omap_hwmod_opt_clk omap34xx_gpio3_opt_clk[] = {
+	{
+		.role = "gpio3_dbclk",
+		.clkdev_dev_id	= NULL,
+		.clkdev_con_id	= "gpio3_dbck",
+	},
+};
+
+static struct omap_hwmod omap34xx_gpio3_hwmod = {
+	.name		= "gpio3_hwmod",
+	.mpu_irqs	= omap34xx_gpio3_mpu_irqs,
+	.mpu_irqs_cnt	= ARRAY_SIZE(omap34xx_gpio3_mpu_irqs),
+	.clkdev_dev_id	= NULL,
+	.clkdev_con_id	= NULL,
+	.opt_clks	= omap34xx_gpio3_opt_clk,
+	.opt_clks_cnt	= ARRAY_SIZE(omap34xx_gpio3_opt_clk),
+	.prcm		= {
+		.omap2 = {
+			.prcm_reg_id = 1,
+			.module_bit = OMAP3430_EN_GPIO3_SHIFT,
+		},
+	},
+	.slaves		= omap34xx_gpio3_slaves,
+	.slaves_cnt	= ARRAY_SIZE(omap34xx_gpio3_slaves),
+	.sysconfig	= &gpio_if_ctrl,
+	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+
+/*
+ * GPIO4 (GPIO4)
+ */
+
+static struct omap_hwmod_irq_info omap34xx_gpio4_mpu_irqs[] = {
+	{ .name = "gpio_mpu_irq", .irq = INT_34XX_GPIO_BANK4 },
+};
+
+static struct omap_hwmod_opt_clk omap34xx_gpio4_opt_clk[] = {
+	{
+		.role = "gpio4_dbclk",
+		.clkdev_dev_id	= NULL,
+		.clkdev_con_id	= "gpio4_dbck",
+	},
+};
+
+static struct omap_hwmod omap34xx_gpio4_hwmod = {
+	.name		= "gpio4_hwmod",
+	.mpu_irqs	= omap34xx_gpio4_mpu_irqs,
+	.mpu_irqs_cnt	= ARRAY_SIZE(omap34xx_gpio4_mpu_irqs),
+	.clkdev_dev_id	= NULL,
+	.clkdev_con_id	= NULL,
+	.opt_clks	= omap34xx_gpio4_opt_clk,
+	.opt_clks_cnt	= ARRAY_SIZE(omap34xx_gpio4_opt_clk),
+	.prcm		= {
+		.omap2 = {
+			.prcm_reg_id = 1,
+			.module_bit = OMAP3430_EN_GPIO4_SHIFT,
+		},
+	},
+	.slaves		= omap34xx_gpio4_slaves,
+	.slaves_cnt	= ARRAY_SIZE(omap34xx_gpio4_slaves),
+	.sysconfig	= &gpio_if_ctrl,
+	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+
+/*
+ * GPIO5 (GPIO5)
+ */
+
+static struct omap_hwmod_irq_info omap34xx_gpio5_mpu_irqs[] = {
+	{ .name = "gpio_mpu_irq", .irq = INT_34XX_GPIO_BANK5 },
+};
+
+static struct omap_hwmod_opt_clk omap34xx_gpio5_opt_clk[] = {
+	{
+		.role = "gpio5_dbclk",
+		.clkdev_dev_id	= NULL,
+		.clkdev_con_id	= "gpio5_dbck",
+	},
+};
+
+static struct omap_hwmod omap34xx_gpio5_hwmod = {
+	.name		= "gpio5_hwmod",
+	.mpu_irqs	= omap34xx_gpio5_mpu_irqs,
+	.mpu_irqs_cnt	= ARRAY_SIZE(omap34xx_gpio5_mpu_irqs),
+	.clkdev_dev_id	= NULL,
+	.clkdev_con_id	= NULL,
+	.opt_clks	= omap34xx_gpio5_opt_clk,
+	.opt_clks_cnt	= ARRAY_SIZE(omap34xx_gpio5_opt_clk),
+	.prcm		= {
+		.omap2 = {
+			.prcm_reg_id = 1,
+			.module_bit = OMAP3430_EN_GPIO5_SHIFT,
+		},
+	},
+	.slaves		= omap34xx_gpio5_slaves,
+	.slaves_cnt	= ARRAY_SIZE(omap34xx_gpio5_slaves),
+	.sysconfig	= &gpio_if_ctrl,
+	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+/*
+ * GPIO6 (GPIO6)
+ */
+
+static struct omap_hwmod_irq_info omap34xx_gpio6_mpu_irqs[] = {
+	{ .name = "gpio_mpu_irq", .irq = INT_34XX_GPIO_BANK6 },
+};
+
+static struct omap_hwmod_opt_clk omap34xx_gpio6_opt_clk[] = {
+	{
+		.role = "gpio6_dbclk",
+		.clkdev_dev_id	= NULL,
+		.clkdev_con_id	= "gpio6_dbck",
+	},
+};
+
+static struct omap_hwmod omap34xx_gpio6_hwmod = {
+	.name		= "gpio6_hwmod",
+	.mpu_irqs	= omap34xx_gpio6_mpu_irqs,
+	.mpu_irqs_cnt	= ARRAY_SIZE(omap34xx_gpio6_mpu_irqs),
+	.clkdev_dev_id	= NULL,
+	.clkdev_con_id	= NULL,
+	.opt_clks	= omap34xx_gpio6_opt_clk,
+	.opt_clks_cnt	= ARRAY_SIZE(omap34xx_gpio6_opt_clk),
+	.prcm		= {
+		.omap2 = {
+			.prcm_reg_id = 1,
+			.module_bit = OMAP3430_EN_GPIO6_SHIFT,
+		},
+	},
+	.slaves		= omap34xx_gpio6_slaves,
+	.slaves_cnt	= ARRAY_SIZE(omap34xx_gpio6_slaves),
+	.sysconfig	= &gpio_if_ctrl,
+	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
 static __initdata struct omap_hwmod *omap34xx_hwmods[] = {
 	&omap34xx_l3_hwmod,
 	&omap34xx_l4_core_hwmod,
 	&omap34xx_l4_per_hwmod,
 	&omap34xx_l4_wkup_hwmod,
 	&omap34xx_mpu_hwmod,
+	&omap34xx_gpio1_hwmod,
+	&omap34xx_gpio2_hwmod,
+	&omap34xx_gpio3_hwmod,
+	&omap34xx_gpio4_hwmod,
+	&omap34xx_gpio5_hwmod,
+	&omap34xx_gpio6_hwmod,
 	NULL,
 };
 
-- 
1.6.3.3


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

* [PATCH 2/2 RFC]OMAP3430: hwmod: Adapt GPIO to use HWMOD FW
  2010-02-12 13:39 ` [PATCH 1/2 RFC]OMAP3430: hwmod: add GPIO hwmods Varadarajan, Charulatha
@ 2010-02-12 13:39   ` Varadarajan, Charulatha
  0 siblings, 0 replies; 9+ messages in thread
From: Varadarajan, Charulatha @ 2010-02-12 13:39 UTC (permalink / raw)
  To: linux-omap; +Cc: Charulatha V

From: Charulatha V <charu@ti.com>

HWmod framework is used for OMAP3430 GPIO driver.

Signed-off-by: Charulatha V <charu@ti.com>
---
 arch/arm/mach-omap2/gpio.c             |  901 ++++----------------------------
 arch/arm/plat-omap/include/plat/gpio.h |   25 +-
 2 files changed, 123 insertions(+), 803 deletions(-)

diff --git a/arch/arm/mach-omap2/gpio.c b/arch/arm/mach-omap2/gpio.c
index f28900f..7b00a1e 100644
--- a/arch/arm/mach-omap2/gpio.c
+++ b/arch/arm/mach-omap2/gpio.c
@@ -31,689 +31,15 @@
 #include <asm/mach/irq.h>
 #include <plat/powerdomain.h>
 #include <plat/mux.h>
+#include <plat/omap_hwmod.h>
+#include <plat/omap_device.h>
 
-/*
- * OMAP242X GPIO1 interface data
- */
-static struct __initdata resource omap242x_gpio1_resources[] = {
-	{
-		.start	= OMAP242X_GPIO1_BASE,
-		.end	= OMAP242X_GPIO1_BASE + OMAP2_GPIO_AS_LEN - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= INT_24XX_GPIO_BANK1,
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-static struct __initdata omap_gpio_platform_data omap242x_gpio1_config = {
-	.ick_name = "gpios_ick",
-	.fck_name = "gpios_fck",
-	.virtual_irq_start = IH_GPIO_BASE,
-};
-
-static struct __initdata platform_device omap242x_gpio1 = {
-	.name           = "omap-gpio",
-	.id             = 0,
-	.dev            = {
-		.platform_data = &omap242x_gpio1_config,
-	},
-	.num_resources = ARRAY_SIZE(omap242x_gpio1_resources),
-	.resource = omap242x_gpio1_resources,
-};
-
-/*
- * OMAP242X GPIO2 interface data
- */
-static struct __initdata resource omap242x_gpio2_resources[] = {
-	{
-		.start	= OMAP242X_GPIO2_BASE,
-		.end	= OMAP242X_GPIO2_BASE + OMAP2_GPIO_AS_LEN - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= INT_24XX_GPIO_BANK2,
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-static struct __initdata omap_gpio_platform_data omap242x_gpio2_config = {
-	.ick_name = "gpios_ick",
-	.fck_name = "gpios_fck",
-	.virtual_irq_start = IH_GPIO_BASE + 32,
-};
-
-static struct __initdata platform_device omap242x_gpio2 = {
-	.name           = "omap-gpio",
-	.id             = 1,
-	.dev            = {
-		.platform_data = &omap242x_gpio2_config,
-	},
-	.num_resources = ARRAY_SIZE(omap242x_gpio2_resources),
-	.resource = omap242x_gpio2_resources,
-};
-
-/*
- * OMAP242X GPIO3 interface data
- */
-static struct __initdata resource omap242x_gpio3_resources[] = {
-	{
-		.start	= OMAP242X_GPIO3_BASE,
-		.end	= OMAP242X_GPIO3_BASE + OMAP2_GPIO_AS_LEN - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= INT_24XX_GPIO_BANK3,
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-static struct __initdata omap_gpio_platform_data omap242x_gpio3_config = {
-	.ick_name = "gpios_ick",
-	.fck_name = "gpios_fck",
-	.virtual_irq_start = IH_GPIO_BASE + 64,
-};
-
-static struct __initdata platform_device omap242x_gpio3 = {
-	.name           = "omap-gpio",
-	.id             = 2,
-	.dev            = {
-		.platform_data = &omap242x_gpio3_config,
+struct omap_device_pm_latency omap_gpio_latency[] = {
+	[0] = {
+		.deactivate_func = omap_device_idle_hwmods,
+		.activate_func   = omap_device_enable_hwmods,
+		.flags		 = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
 	},
-	.num_resources = ARRAY_SIZE(omap242x_gpio3_resources),
-	.resource = omap242x_gpio3_resources,
-};
-
-/*
- * OMAP242X GPIO4 interface data
- */
-static struct __initdata resource omap242x_gpio4_resources[] = {
-	{
-		.start	= OMAP242X_GPIO4_BASE,
-		.end	= OMAP242X_GPIO4_BASE + OMAP2_GPIO_AS_LEN - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= INT_24XX_GPIO_BANK4,
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-static struct __initdata omap_gpio_platform_data omap242x_gpio4_config = {
-	.ick_name = "gpios_ick",
-	.fck_name = "gpios_fck",
-	.virtual_irq_start = IH_GPIO_BASE + 96,
-};
-
-static struct __initdata platform_device omap242x_gpio4 = {
-	.name           = "omap-gpio",
-	.id             = 3,
-	.dev            = {
-		.platform_data = &omap242x_gpio4_config,
-	},
-	.num_resources = ARRAY_SIZE(omap242x_gpio4_resources),
-	.resource = omap242x_gpio4_resources,
-};
-
-/*
- * OMAP243X GPIO1 interface data
- */
-static struct __initdata resource omap243x_gpio1_resources[] = {
-	{
-		.start	= OMAP243X_GPIO1_BASE,
-		.end	= OMAP243X_GPIO1_BASE + OMAP2_GPIO_AS_LEN - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= INT_24XX_GPIO_BANK1,
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-static struct __initdata omap_gpio_platform_data omap243x_gpio1_config = {
-	.ick_name = "gpios_ick",
-	.fck_name = "gpios_fck",
-	.virtual_irq_start = IH_GPIO_BASE,
-};
-
-static struct __initdata platform_device omap243x_gpio1 = {
-	.name           = "omap-gpio",
-	.id             = 0,
-	.dev            = {
-		.platform_data = &omap243x_gpio1_config,
-	},
-	.num_resources = ARRAY_SIZE(omap243x_gpio1_resources),
-	.resource = omap243x_gpio1_resources,
-};
-
-/*
- * OMAP243X GPIO2 interface data
- */
-static struct __initdata resource omap243x_gpio2_resources[] = {
-	{
-		.start	= OMAP243X_GPIO2_BASE,
-		.end	= OMAP243X_GPIO2_BASE + OMAP2_GPIO_AS_LEN - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= INT_24XX_GPIO_BANK2,
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-static struct __initdata omap_gpio_platform_data omap243x_gpio2_config = {
-	.ick_name = "gpios_ick",
-	.fck_name = "gpios_fck",
-	.virtual_irq_start = IH_GPIO_BASE + 32,
-};
-
-static struct __initdata platform_device omap243x_gpio2 = {
-	.name           = "omap-gpio",
-	.id             = 1,
-	.dev            = {
-		.platform_data = &omap243x_gpio2_config,
-	},
-	.num_resources = ARRAY_SIZE(omap243x_gpio2_resources),
-	.resource = omap243x_gpio2_resources,
-};
-
-/*
- * OMAP243X GPIO3 interface data
- */
-static struct __initdata resource omap243x_gpio3_resources[] = {
-	{
-		.start	= OMAP243X_GPIO3_BASE,
-		.end	= OMAP243X_GPIO3_BASE + OMAP2_GPIO_AS_LEN - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= INT_24XX_GPIO_BANK3,
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-static struct __initdata omap_gpio_platform_data omap243x_gpio3_config = {
-	.ick_name = "gpios_ick",
-	.fck_name = "gpios_fck",
-	.virtual_irq_start = IH_GPIO_BASE + 64,
-};
-
-static struct __initdata platform_device omap243x_gpio3 = {
-	.name           = "omap-gpio",
-	.id             = 2,
-	.dev            = {
-		.platform_data = &omap243x_gpio3_config,
-	},
-	.num_resources = ARRAY_SIZE(omap243x_gpio3_resources),
-	.resource = omap243x_gpio3_resources,
-};
-
-/*
- * OMAP243X GPIO4 interface data
- */
-static struct __initdata resource omap243x_gpio4_resources[] = {
-	{
-		.start	= OMAP243X_GPIO4_BASE,
-		.end	= OMAP243X_GPIO4_BASE + OMAP2_GPIO_AS_LEN - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= INT_24XX_GPIO_BANK4,
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-static struct __initdata omap_gpio_platform_data omap243x_gpio4_config = {
-	.ick_name = "gpios_ick",
-	.fck_name = "gpios_fck",
-	.virtual_irq_start = IH_GPIO_BASE + 96,
-};
-
-static struct __initdata platform_device omap243x_gpio4 = {
-	.name           = "omap-gpio",
-	.id             = 3,
-	.dev            = {
-		.platform_data = &omap243x_gpio4_config,
-	},
-	.num_resources = ARRAY_SIZE(omap243x_gpio4_resources),
-	.resource = omap243x_gpio4_resources,
-};
-
-/*
- * OMAP243X GPIO5 interface data
- */
-static struct __initdata resource omap243x_gpio5_resources[] = {
-	{
-		.start	= OMAP243X_GPIO5_BASE,
-		.end	= OMAP243X_GPIO5_BASE + OMAP2_GPIO_AS_LEN - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= INT_24XX_GPIO_BANK5,
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-static struct __initdata omap_gpio_platform_data omap243x_gpio5_config = {
-	.ick_name = "gpio5_ick",
-	.fck_name = "gpio5_fck",
-	.virtual_irq_start = IH_GPIO_BASE + 128,
-};
-
-static struct __initdata platform_device omap243x_gpio5 = {
-	.name           = "omap-gpio",
-	.id             = 4,
-	.dev            = {
-		.platform_data = &omap243x_gpio5_config,
-	},
-	.num_resources = ARRAY_SIZE(omap243x_gpio5_resources),
-	.resource = omap243x_gpio5_resources,
-};
-
-/*
- * OMAP3 GPIO1 interface data
- */
-static struct __initdata resource omap3_gpio1_resources[] = {
-	{
-		.start	= OMAP34XX_GPIO1_BASE,
-		.end	= OMAP34XX_GPIO1_BASE + OMAP3_GPIO_AS_LEN - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= INT_34XX_GPIO_BANK1,
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-static struct __initdata omap_gpio_platform_data omap3_gpio1_config = {
-	.ick_name = "gpio1_ick",
-	.dbck_name = "gpio1_dbck",
-	.virtual_irq_start = IH_GPIO_BASE,
-};
-
-static struct __initdata platform_device omap3_gpio1 = {
-	.name           = "omap-gpio",
-	.id             = 0,
-	.dev            = {
-		.platform_data = &omap3_gpio1_config,
-	},
-	.num_resources = ARRAY_SIZE(omap3_gpio1_resources),
-	.resource = omap3_gpio1_resources,
-};
-
-/*
- * OMAP3 GPIO2 interface data
- */
-static struct __initdata resource omap3_gpio2_resources[] = {
-	{
-		.start	= OMAP34XX_GPIO2_BASE,
-		.end	= OMAP34XX_GPIO2_BASE + OMAP3_GPIO_AS_LEN - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= INT_34XX_GPIO_BANK2,
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-static struct __initdata omap_gpio_platform_data omap3_gpio2_config = {
-	.ick_name = "gpio2_ick",
-	.dbck_name = "gpio2_dbck",
-	.virtual_irq_start = IH_GPIO_BASE + 32,
-};
-
-static struct __initdata platform_device omap3_gpio2 = {
-	.name           = "omap-gpio",
-	.id             = 1,
-	.dev            = {
-		.platform_data = &omap3_gpio2_config,
-	},
-	.num_resources = ARRAY_SIZE(omap3_gpio2_resources),
-	.resource = omap3_gpio2_resources,
-};
-
-/*
- * OMAP3 GPIO3 interface data
- */
-static struct __initdata resource omap3_gpio3_resources[] = {
-	{
-		.start	= OMAP34XX_GPIO3_BASE,
-		.end	= OMAP34XX_GPIO3_BASE + OMAP3_GPIO_AS_LEN - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= INT_34XX_GPIO_BANK3,
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-static struct __initdata omap_gpio_platform_data omap3_gpio3_config = {
-	.ick_name = "gpio3_ick",
-	.dbck_name = "gpio3_dbck",
-	.virtual_irq_start = IH_GPIO_BASE + 64,
-};
-
-static struct __initdata platform_device omap3_gpio3 = {
-	.name           = "omap-gpio",
-	.id             = 2,
-	.dev            = {
-		.platform_data = &omap3_gpio3_config,
-	},
-	.num_resources = ARRAY_SIZE(omap3_gpio3_resources),
-	.resource = omap3_gpio3_resources,
-};
-
-/*
- * OMAP3 GPIO4 interface data
- */
-static struct __initdata resource omap3_gpio4_resources[] = {
-	{
-		.start	= OMAP34XX_GPIO4_BASE,
-		.end	= OMAP34XX_GPIO4_BASE + OMAP3_GPIO_AS_LEN - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= INT_34XX_GPIO_BANK4,
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-static struct __initdata omap_gpio_platform_data omap3_gpio4_config = {
-	.ick_name = "gpio4_ick",
-	.dbck_name = "gpio4_dbck",
-	.virtual_irq_start = IH_GPIO_BASE + 96,
-};
-
-static struct __initdata platform_device omap3_gpio4 = {
-	.name           = "omap-gpio",
-	.id             = 3,
-	.dev            = {
-		.platform_data = &omap3_gpio4_config,
-	},
-	.num_resources = ARRAY_SIZE(omap3_gpio4_resources),
-	.resource = omap3_gpio4_resources,
-};
-
-/*
- * OMAP3 GPIO5 interface data
- */
-static struct __initdata resource omap3_gpio5_resources[] = {
-	{
-		.start	= OMAP34XX_GPIO5_BASE,
-		.end	= OMAP34XX_GPIO5_BASE + OMAP3_GPIO_AS_LEN - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= INT_34XX_GPIO_BANK5,
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-static struct __initdata omap_gpio_platform_data omap3_gpio5_config = {
-	.ick_name = "gpio5_ick",
-	.dbck_name = "gpio5_dbck",
-	.virtual_irq_start = IH_GPIO_BASE + 128,
-};
-
-static struct __initdata platform_device omap3_gpio5 = {
-	.name           = "omap-gpio",
-	.id             = 4,
-	.dev            = {
-		.platform_data = &omap3_gpio5_config,
-	},
-	.num_resources = ARRAY_SIZE(omap3_gpio5_resources),
-	.resource = omap3_gpio5_resources,
-};
-
-/*
- * OMAP3 GPIO6 interface data
- */
-static struct __initdata resource omap3_gpio6_resources[] = {
-	{
-		.start	= OMAP34XX_GPIO6_BASE,
-		.end	= OMAP34XX_GPIO6_BASE + OMAP3_GPIO_AS_LEN - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= INT_34XX_GPIO_BANK4,
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-static struct __initdata omap_gpio_platform_data omap3_gpio6_config = {
-	.ick_name = "gpio6_ick",
-	.dbck_name = "gpio6_dbck",
-	.virtual_irq_start = IH_GPIO_BASE + 160,
-};
-
-static struct __initdata platform_device omap3_gpio6 = {
-	.name           = "omap-gpio",
-	.id             = 5,
-	.dev            = {
-		.platform_data = &omap3_gpio6_config,
-	},
-	.num_resources = ARRAY_SIZE(omap3_gpio6_resources),
-	.resource = omap3_gpio6_resources,
-};
-
-/*
- * OMAP44XX GPIO1 interface data
- */
-static struct __initdata resource omap4_gpio1_resources[] = {
-	{
-		.start	= OMAP44XX_GPIO1_BASE,
-		.end	= OMAP44XX_GPIO1_BASE + OMAP4_GPIO_AS_LEN - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= INT_44XX_GPIO_BANK1,
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-static struct __initdata omap_gpio_platform_data omap4_gpio1_config = {
-	.ick_name = "gpio1_ick",
-	.dbck_name = "gpio1_dbck",
-	.virtual_irq_start = IH_GPIO_BASE,
-};
-
-static struct __initdata platform_device omap4_gpio1 = {
-	.name           = "omap-gpio",
-	.id             = 0,
-	.dev            = {
-		.platform_data = &omap4_gpio1_config,
-	},
-	.num_resources = ARRAY_SIZE(omap4_gpio1_resources),
-	.resource = omap4_gpio1_resources,
-};
-
-/*
- * OMAP44XX GPIO2 interface data
- */
-static struct __initdata resource omap4_gpio2_resources[] = {
-	{
-		.start	= OMAP44XX_GPIO2_BASE,
-		.end	= OMAP44XX_GPIO2_BASE + OMAP4_GPIO_AS_LEN - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= INT_44XX_GPIO_BANK2,
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-static struct __initdata omap_gpio_platform_data omap4_gpio2_config = {
-	.ick_name = "gpio2_ick",
-	.dbck_name = "gpio2_dbck",
-	.virtual_irq_start = IH_GPIO_BASE + 32,
-};
-
-static struct __initdata platform_device omap4_gpio2 = {
-	.name           = "omap-gpio",
-	.id             = 1,
-	.dev            = {
-		.platform_data = &omap4_gpio2_config,
-	},
-	.num_resources = ARRAY_SIZE(omap4_gpio2_resources),
-	.resource = omap4_gpio2_resources,
-};
-
-/*
- * OMAP44XX GPIO3 interface data
- */
-static struct __initdata resource omap4_gpio3_resources[] = {
-	{
-		.start	= OMAP44XX_GPIO3_BASE,
-		.end	= OMAP44XX_GPIO3_BASE + OMAP4_GPIO_AS_LEN - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= INT_44XX_GPIO_BANK3,
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-static struct __initdata omap_gpio_platform_data omap4_gpio3_config = {
-	.ick_name = "gpio3_ick",
-	.dbck_name = "gpio3_dbck",
-	.virtual_irq_start = IH_GPIO_BASE + 64,
-};
-
-static struct __initdata platform_device omap4_gpio3 = {
-	.name           = "omap-gpio",
-	.id             = 2,
-	.dev            = {
-		.platform_data = &omap4_gpio3_config,
-	},
-	.num_resources = ARRAY_SIZE(omap4_gpio3_resources),
-	.resource = omap4_gpio3_resources,
-};
-
-/*
- * OMAP44XX GPIO4 interface data
- */
-static struct __initdata resource omap4_gpio4_resources[] = {
-	{
-		.start	= OMAP44XX_GPIO4_BASE,
-		.end	= OMAP44XX_GPIO4_BASE + OMAP4_GPIO_AS_LEN - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= INT_44XX_GPIO_BANK4,
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-static struct __initdata omap_gpio_platform_data omap4_gpio4_config = {
-	.ick_name = "gpio4_ick",
-	.dbck_name = "gpio4_dbck",
-	.virtual_irq_start = IH_GPIO_BASE + 96,
-};
-
-static struct __initdata platform_device omap4_gpio4 = {
-	.name           = "omap-gpio",
-	.id             = 3,
-	.dev            = {
-		.platform_data = &omap4_gpio4_config,
-	},
-	.num_resources = ARRAY_SIZE(omap4_gpio4_resources),
-	.resource = omap4_gpio4_resources,
-};
-
-/*
- * OMAP44XX GPIO5 interface data
-  */
-static struct __initdata resource omap4_gpio5_resources[] = {
-	{
-		.start	= OMAP44XX_GPIO5_BASE,
-		.end	= OMAP44XX_GPIO5_BASE + OMAP4_GPIO_AS_LEN - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= INT_44XX_GPIO_BANK5,
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-static struct __initdata omap_gpio_platform_data omap4_gpio5_config = {
-	.ick_name = "gpio5_ick",
-	.dbck_name = "gpio5_dbck",
-	.virtual_irq_start = IH_GPIO_BASE + 128,
-};
-
-static struct __initdata platform_device omap4_gpio5 = {
-	.name           = "omap-gpio",
-	.id             = 4,
-	.dev            = {
-		.platform_data = &omap4_gpio5_config,
-	},
-	.num_resources = ARRAY_SIZE(omap4_gpio5_resources),
-	.resource = omap4_gpio5_resources,
-};
-
-/*
- * OMAP44XX GPIO6 interface data
-  */
-static struct __initdata resource omap4_gpio6_resources[] = {
-	{
-		.start	= OMAP44XX_GPIO6_BASE,
-		.end	= OMAP44XX_GPIO6_BASE + OMAP4_GPIO_AS_LEN - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= INT_44XX_GPIO_BANK6,
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-static struct __initdata omap_gpio_platform_data omap4_gpio6_config = {
-	.ick_name = "gpio6_ick",
-	.dbck_name = "gpio6_dbck",
-	.virtual_irq_start = IH_GPIO_BASE + 160,
-};
-
-static struct __initdata platform_device omap4_gpio6 = {
-	.name           = "omap-gpio",
-	.id             = 5,
-	.dev            = {
-		.platform_data = &omap4_gpio6_config,
-	},
-	.num_resources = ARRAY_SIZE(omap4_gpio6_resources),
-	.resource = omap4_gpio6_resources,
-};
-
-static struct __initdata platform_device * omap242x_gpio_early_dev[] = {
-	&omap242x_gpio1,
-	&omap242x_gpio2,
-	&omap242x_gpio3,
-	&omap242x_gpio4
-};
-
-static struct __initdata platform_device * omap243x_gpio_early_dev[] = {
-	&omap243x_gpio1,
-	&omap243x_gpio2,
-	&omap243x_gpio3,
-	&omap243x_gpio4,
-	&omap243x_gpio5
-};
-
-static struct __initdata platform_device * omap3_gpio_early_dev[] = {
-	&omap3_gpio1,
-	&omap3_gpio2,
-	&omap3_gpio3,
-	&omap3_gpio4,
-	&omap3_gpio5,
-	&omap3_gpio6
-};
-
-static struct __initdata platform_device * omap4_gpio_early_dev[] = {
-	&omap4_gpio1,
-	&omap4_gpio2,
-	&omap4_gpio3,
-	&omap4_gpio4,
-	&omap4_gpio5,
-	&omap4_gpio6
 };
 
 struct omap3_gpio_regs {
@@ -731,7 +57,7 @@ struct omap3_gpio_regs {
 };
 
 #ifdef CONFIG_ARCH_OMAP3
-static struct omap3_gpio_regs gpio_context[OMAP34XX_NR_GPIOS];
+static struct omap3_gpio_regs gpio_context[OMAP_NR_GPIOS];
 #endif
 
 /* GPIO -> PAD init configuration struct */
@@ -785,13 +111,13 @@ struct gpio_pad {
 	u16 save;
 };
 
-#define OMAP34XX_GPIO_AMT	(32 * OMAP34XX_NR_GPIOS)
+#define OMAP34XX_GPIO_AMT	(32 * OMAP_NR_GPIOS)
 
 #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
 static struct gpio_pad *gpio_pads;
 #endif
 static u16 gpio_pad_map[OMAP34XX_GPIO_AMT];
-static struct gpio_bank gpio_bank[OMAP_MAX_NR_GPIOS];
+static struct gpio_bank gpio_bank[OMAP_NR_GPIOS];
 static int gpio_bank_count;
 
 static inline struct gpio_bank *get_gpio_bank(int gpio)
@@ -1836,7 +1162,7 @@ void omap_gpio_save_context(void)
 	u16 offset, conf;
 	u32 out, pin;
 	struct gpio_pad *pad;
-	u32 tmp_oe[OMAP34XX_NR_GPIOS];
+	u32 tmp_oe[OMAP_NR_GPIOS];
 
 	/* saving banks from 2-6 only since GPIO1 is in WKUP */
 	for (i = 1; i < gpio_bank_count; i++) {
@@ -1978,17 +1304,8 @@ static int __devexit omap_gpio_remove(struct platform_device *pdev)
 		return 0;
 
 	bank = &gpio_bank[id];
-	if (cpu_is_omap24xx()) {
-		clk_disable(bank->fck);
-		clk_put(bank->fck);
-	}
-	clk_disable(bank->ick);
-	clk_put(bank->ick);
-
-	bank->ick = NULL;
-	bank->fck = NULL;
+	bank->device_shutdown(pdev);
 	bank->initialized = 0;
-	iounmap(bank->base);
 
 	return 0;
 }
@@ -1998,7 +1315,6 @@ static int __devinit omap_gpio_probe(struct platform_device *pdev)
 	static int show_rev_once;
 	struct omap_gpio_platform_data *pdata = pdev->dev.platform_data;
 	struct gpio_bank *bank;
-	struct resource *res;
 	int id, i;
 
 	if (!pdev || !pdata) {
@@ -2007,14 +1323,11 @@ static int __devinit omap_gpio_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
+	gpio_bank_count = OMAP_NR_GPIOS;
+#ifdef CONFIG_ARCH_OMAP2
 	if (cpu_is_omap242x())
 		gpio_bank_count = OMAP242X_NR_GPIOS;
-	else if (cpu_is_omap243x())
-		gpio_bank_count = OMAP243X_NR_GPIOS;
-	else if (cpu_is_omap34xx())
-		gpio_bank_count = OMAP34XX_NR_GPIOS;
-	else if (cpu_is_omap44xx())
-		gpio_bank_count = OMAP44XX_NR_GPIOS;
+#endif
 
 	id = pdev->id;
 	if (id > gpio_bank_count) {
@@ -2028,47 +1341,17 @@ static int __devinit omap_gpio_probe(struct platform_device *pdev)
 		return 0;
 
 	bank->virtual_irq_start = pdata->virtual_irq_start;
-
-	bank->ick = clk_get(NULL, pdata->ick_name);
-	if (IS_ERR(bank->ick))
-		pr_err("Could not get %s\n", pdata->ick_name);
-	else
-		clk_enable(bank->ick);
-
-	if (cpu_is_omap24xx()) {
-		bank->fck = clk_get(NULL, pdata->fck_name);
-		if (IS_ERR(bank->fck))
-			pr_err("Could not get %s\n", pdata->fck_name);
-		else
-			clk_enable(bank->fck);
-	}
+	bank->base = pdata->base;
+	bank->device_enable = pdata->device_enable;
+	bank->device_idle = pdata->device_idle;
+	bank->device_shutdown = pdata->device_shutdown;
 
 	spin_lock_init(&bank->lock);
-
-	/* Static mapping, never released */
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (unlikely(!res)) {
-		pr_err("GPIO Bank %i Invalid mem resource\n", id);
-		return -ENODEV;
-	}
-
-	bank->base = ioremap(res->start, resource_size(res));
-	if (!bank->base) {
-		pr_err("Could not ioremap gpio bank%i\n", id);
-		return -ENOMEM;
-	}
-
-	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-	if (unlikely(!res)) {
-		pr_err("GPIO Bank %i Invalid irq resource\n", id);
-		return -ENODEV;
-	}
+	pdata->device_enable(pdev);
 
 	if (cpu_is_omap44xx()) {
 		__raw_writel(0xffffffff, bank->base +
 					OMAP4_GPIO_IRQSTATUSCLR0);
-		__raw_writew(0x0015, bank->base +
-					OMAP4_GPIO_SYSCONFIG);
 		__raw_writel(0x00000000, bank->base +
 					 OMAP4_GPIO_DEBOUNCENABLE);
 		/* Initialize interface clk ungated, module enabled */
@@ -2078,8 +1361,6 @@ static int __devinit omap_gpio_probe(struct platform_device *pdev)
 					OMAP24XX_GPIO_IRQENABLE1);
 		__raw_writel(0xffffffff, bank->base +
 					OMAP24XX_GPIO_IRQSTATUS1);
-		__raw_writew(0x0015, bank->base +
-					OMAP24XX_GPIO_SYSCONFIG);
 		__raw_writel(0x00000000, bank->base +
 					OMAP24XX_GPIO_DEBOUNCE_EN);
 
@@ -2120,13 +1401,16 @@ static int __devinit omap_gpio_probe(struct platform_device *pdev)
 		set_irq_handler(i, handle_simple_irq);
 		set_irq_flags(i, IRQF_VALID);
 	}
-	set_irq_chained_handler(res->start, gpio_irq_handler);
-	set_irq_data(res->start, bank);
+	set_irq_chained_handler(pdata->irq, gpio_irq_handler);
+	set_irq_data(pdata->irq, bank);
 
+	/* XXX TODO: Remove once hwmod supports getting opt_clk details */
 	if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
-		bank->dbck = clk_get(NULL, pdata->dbck_name);
+		char clk_name[11];
+		sprintf(clk_name, "gpio%d_dbck", id + 1);
+		bank->dbck = clk_get(NULL, clk_name);
 		if (IS_ERR(bank->dbck))
-			pr_err("Could not get %s\n", pdata->dbck_name);
+			pr_err("Could not get %s\n", clk_name);
 	}
 
 	/* Enable autoidle for the OCP interface */
@@ -2147,64 +1431,96 @@ static int __devinit omap_gpio_probe(struct platform_device *pdev)
 
 void __init omap_gpio_early_init(void)
 {
-	struct platform_device **pdev;
+	int i = 0;
 
-	if (cpu_is_omap242x()) {
-		pdev = omap242x_gpio_early_dev;
+	gpio_bank_count = OMAP_NR_GPIOS;
+#ifdef CONFIG_ARCH_OMAP2
+	if (cpu_is_omap242x())
 		gpio_bank_count = OMAP242X_NR_GPIOS;
-	} else if (cpu_is_omap243x()) {
-		pdev = omap243x_gpio_early_dev;
-		gpio_bank_count = OMAP243X_NR_GPIOS;
-	} else if (cpu_is_omap34xx()) {
-		pdev = omap3_gpio_early_dev;
-		gpio_bank_count = OMAP34XX_NR_GPIOS;
-	} else if (cpu_is_omap44xx()) {
-		pdev = omap4_gpio_early_dev;
-		gpio_bank_count = OMAP44XX_NR_GPIOS;
-	}
+#endif
+
+	do {
+		struct omap_device *od;
+		struct omap_hwmod *oh;
+		int hw_mod_name_len = 16;
+		int l;
+		char oh_name[hw_mod_name_len];
+		struct omap_gpio_platform_data *pdata;
+		char *name = "omap-gpio";
+
+		l = snprintf(oh_name, hw_mod_name_len, "gpio%d_hwmod", i + 1);
+		WARN(l >= hw_mod_name_len,
+			"String buffer overflow in GPIO device setup\n");
+
+		oh = omap_hwmod_lookup(oh_name);
+		if (!oh) {
+			pr_err("Could not look up %s\n", oh_name);
+			continue;
+		}
+
+		pdata = kzalloc(sizeof(struct omap_gpio_platform_data),
+					GFP_KERNEL);
+		pdata->base = oh->_rt_va;
+		pdata->irq = oh->mpu_irqs[0].irq;
+		pdata->virtual_irq_start = IH_GPIO_BASE + 32 * i;
+		pdata->device_enable = omap_device_enable;
+		pdata->device_idle = omap_device_idle;
+		pdata->device_shutdown = omap_device_shutdown;
+
+		od = omap_device_build(name, i, oh, pdata,
+					sizeof(*pdata),	omap_gpio_latency,
+					ARRAY_SIZE(omap_gpio_latency), 1);
+		WARN(IS_ERR(od), "Cant build omap_device for %s:%s.\n",
+					name, oh->name);
+
+		i++;
+	} while (i < gpio_bank_count);
 
-	early_platform_add_devices(pdev, gpio_bank_count);
 	early_platform_driver_register_all("earlygpio");
 	early_platform_driver_probe("earlygpio", gpio_bank_count, 0);
+	return;
 }
 
 int __init omap_init_gpio(void)
 {
-	if (cpu_is_omap242x()) {
-		platform_device_add(&omap242x_gpio1);
-		platform_device_add(&omap242x_gpio2);
-		platform_device_add(&omap242x_gpio3);
-		platform_device_add(&omap242x_gpio4);
-		platform_device_register(&omap242x_gpio1);
-		platform_device_register(&omap242x_gpio2);
-		platform_device_register(&omap242x_gpio3);
-		platform_device_register(&omap242x_gpio4);
-	} else if (cpu_is_omap243x()) {
-		platform_device_add(&omap243x_gpio1);
-		platform_device_add(&omap243x_gpio2);
-		platform_device_add(&omap243x_gpio3);
-		platform_device_add(&omap243x_gpio4);
-		platform_device_add(&omap243x_gpio5);
-		platform_device_register(&omap243x_gpio1);
-		platform_device_register(&omap243x_gpio2);
-		platform_device_register(&omap243x_gpio3);
-		platform_device_register(&omap243x_gpio4);
-		platform_device_register(&omap243x_gpio5);
-	} else if (cpu_is_omap34xx()) {
-		platform_device_register(&omap3_gpio1);
-		platform_device_register(&omap3_gpio2);
-		platform_device_register(&omap3_gpio3);
-		platform_device_register(&omap3_gpio4);
-		platform_device_register(&omap3_gpio5);
-		platform_device_register(&omap3_gpio6);
-	} else if (cpu_is_omap44xx()) {
-		platform_device_add(&omap4_gpio1);
-		platform_device_add(&omap4_gpio2);
-		platform_device_add(&omap4_gpio3);
-		platform_device_add(&omap4_gpio4);
-		platform_device_add(&omap4_gpio5);
-		platform_device_add(&omap4_gpio6);
-	}
+	int i = 0;
+	struct omap_device *od;
+	struct omap_hwmod *oh;
+	int hw_mod_name_len = 16;
+	int l;
+	char oh_name[hw_mod_name_len];
+	struct omap_gpio_platform_data *pdata;
+	char *name = "omap-gpio";
+
+	do {
+		l = snprintf(oh_name, hw_mod_name_len, "gpio%d_hwmod", i + 1);
+		WARN(l >= hw_mod_name_len,
+			"String buffer overflow in GPIO device setup\n");
+
+		oh = omap_hwmod_lookup(oh_name);
+		if (!oh) {
+			pr_err("Could not look up %s\n", oh_name);
+			continue;
+		}
+
+		pdata = kzalloc(sizeof(struct omap_gpio_platform_data),
+					GFP_KERNEL);
+		pdata->base = oh->_rt_va;
+		pdata->irq = oh->mpu_irqs[0].irq;
+		pdata->virtual_irq_start = IH_GPIO_BASE + 32 * i;
+		pdata->device_enable = omap_device_enable;
+		pdata->device_idle = omap_device_idle;
+		pdata->device_shutdown = omap_device_shutdown;
+
+		od = omap_device_build(name, i, oh, pdata,
+					sizeof(*pdata),	omap_gpio_latency,
+					ARRAY_SIZE(omap_gpio_latency), 0);
+		WARN(IS_ERR(od), "Cant build omap_device for %s:%s.\n",
+					name, oh->name);
+
+		i++;
+	} while (i < gpio_bank_count);
+
 	return 0;
 }
 
@@ -2235,7 +1551,6 @@ static int __init omap_gpio_sysinit(void)
 		if (ret == 0)
 			ret = sysdev_register(&omap_gpio_device);
 	}
-
 	return ret;
 }
 
diff --git a/arch/arm/plat-omap/include/plat/gpio.h b/arch/arm/plat-omap/include/plat/gpio.h
index 1470e8e..e1a09a6 100644
--- a/arch/arm/plat-omap/include/plat/gpio.h
+++ b/arch/arm/plat-omap/include/plat/gpio.h
@@ -29,6 +29,7 @@
 #include <linux/io.h>
 #include <linux/sysdev.h>
 #include <mach/irqs.h>
+#include <linux/platform_device.h>
 
 #define OMAP1_MPUIO_BASE			0xfffb5000
 
@@ -63,11 +64,14 @@
 #define OMAP_MPUIO_LATCH		0x34
 #endif
 
+#if defined(CONFIG_ARCH_OMAP2)
+#define OMAP_NR_GPIOS			5
 #define OMAP242X_NR_GPIOS		4
-#define OMAP243X_NR_GPIOS		5
-#define OMAP34XX_NR_GPIOS		6
-#define OMAP44XX_NR_GPIOS		6
-#define OMAP_MAX_NR_GPIOS		OMAP44XX_NR_GPIOS
+#elif defined(CONFIG_ARCH_OMAP3)
+#define OMAP_NR_GPIOS			6
+#elif defined(CONFIG_ARCH_OMAP4)
+#define OMAP_NR_GPIOS			6
+#endif
 
 #define OMAP_MPUIO(nr)		(OMAP_MAX_GPIO_LINES + (nr))
 #define OMAP_GPIO_IS_MPUIO(nr)	((nr) >= OMAP_MAX_GPIO_LINES)
@@ -194,12 +198,12 @@ extern void omap3_gpio_restore_pad_context(int restore_oe);
 #include <asm-generic/gpio.h>
 
 struct omap_gpio_platform_data {
-	unsigned long pbase;
+	void __iomem *base;
 	u16 irq;
 	u16 virtual_irq_start;
-	char ick_name[11];
-	char fck_name[11];
-	char dbck_name[11];
+	int (*device_enable)(struct platform_device *pdev);
+	int (*device_shutdown) (struct platform_device *pdev);
+	int (*device_idle)(struct platform_device *pdev);
 };
 
 struct gpio_bank {
@@ -225,13 +229,14 @@ struct gpio_bank {
 	u32 saved_fallingdetect;
 	u32 saved_risingdetect;
 	u32 mod_usage;
-	struct clk *ick;
-	struct clk *fck;
 	u8 initialized;
 	struct clk *dbck;
 	u32 dbck_enable_mask;
 	void __iomem *base;
 	u16 virtual_irq_start;
+	int (*device_enable)(struct platform_device *pdev);
+	int (*device_shutdown) (struct platform_device *pdev);
+	int (*device_idle)(struct platform_device *pdev);
 #endif
 };
 
-- 
1.6.3.3


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

* Re: [PATCH 0/2 RFC]OMAP3430: hwmod FW for GPIO
  2010-02-12 13:39 [PATCH 0/2 RFC]OMAP3430: hwmod FW for GPIO Varadarajan, Charulatha
  2010-02-12 13:39 ` [PATCH 1/2 RFC]OMAP3430: hwmod: add GPIO hwmods Varadarajan, Charulatha
@ 2010-02-12 21:50 ` Paul Walmsley
  2010-02-16 15:05   ` Varadarajan, Charulatha
  2010-02-12 22:00 ` Paul Walmsley
  2010-02-17 22:09 ` Kevin Hilman
  3 siblings, 1 reply; 9+ messages in thread
From: Paul Walmsley @ 2010-02-12 21:50 UTC (permalink / raw)
  To: Varadarajan, Charulatha; +Cc: linux-omap, khilman, tony, rnayak

On Fri, 12 Feb 2010, Varadarajan, Charulatha wrote:

> This patch series makes the OMAP3430 GPIO module
> use hwmod framework.
> 
> This patch series applies on top of pm branch
> and it requires my previous patch set which converts
> GPIO into an early init device. 
> 
> They are boot tested on SDP 3430 and compile tested
> for OMAP 2420 and 2430.
> 
> Charulatha V (2):
>   OMAP3: hwmod: add GPIO hwmods for OMAP3430
>   OMAP3: hwmod: Adapt HWMOD FW for GPIO OMAP3430
> 
>  arch/arm/mach-omap2/gpio.c             |  901 ++++----------------------------
>  arch/arm/mach-omap2/omap_hwmod_34xx.h  |  410 +++++++++++++++
>  arch/arm/plat-omap/include/plat/gpio.h |   25 +-

NAK.  Your series just broke GPIO for all non-OMAP3430 chips.


- Paul

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

* Re: [PATCH 0/2 RFC]OMAP3430: hwmod FW for GPIO
  2010-02-12 13:39 [PATCH 0/2 RFC]OMAP3430: hwmod FW for GPIO Varadarajan, Charulatha
  2010-02-12 13:39 ` [PATCH 1/2 RFC]OMAP3430: hwmod: add GPIO hwmods Varadarajan, Charulatha
  2010-02-12 21:50 ` [PATCH 0/2 RFC]OMAP3430: hwmod FW for GPIO Paul Walmsley
@ 2010-02-12 22:00 ` Paul Walmsley
  2010-02-15  6:54   ` Nayak, Rajendra
  2010-02-17 22:09 ` Kevin Hilman
  3 siblings, 1 reply; 9+ messages in thread
From: Paul Walmsley @ 2010-02-12 22:00 UTC (permalink / raw)
  To: Varadarajan, Charulatha; +Cc: linux-omap, tony, khilman

By the way:

On Fri, 12 Feb 2010, Varadarajan, Charulatha wrote:

> They are boot tested on SDP 3430 and compile tested
> for OMAP 2420 and 2430.

This part is really offensively misleading.  It does not matter whether 
the code has been compile-tested on OMAP24xx if it could never actually 
run on OMAP24xx.


- Paul

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

* RE: [PATCH 0/2 RFC]OMAP3430: hwmod FW for GPIO
  2010-02-12 22:00 ` Paul Walmsley
@ 2010-02-15  6:54   ` Nayak, Rajendra
  2010-02-16 15:05     ` Varadarajan, Charulatha
  0 siblings, 1 reply; 9+ messages in thread
From: Nayak, Rajendra @ 2010-02-15  6:54 UTC (permalink / raw)
  To: Paul Walmsley, Varadarajan, Charulatha
  Cc: linux-omap@vger.kernel.org, tony@atomide.com,
	khilman@deeprootsystems.com


> -----Original Message-----
> From: linux-omap-owner@vger.kernel.org 
> [mailto:linux-omap-owner@vger.kernel.org] On Behalf Of Paul Walmsley
> Sent: Saturday, February 13, 2010 3:31 AM
> To: Varadarajan, Charulatha
> Cc: linux-omap@vger.kernel.org; tony@atomide.com; 
> khilman@deeprootsystems.com
> Subject: Re: [PATCH 0/2 RFC]OMAP3430: hwmod FW for GPIO
> 
> By the way:
> 
> On Fri, 12 Feb 2010, Varadarajan, Charulatha wrote:
> 
> > They are boot tested on SDP 3430 and compile tested
> > for OMAP 2420 and 2430.
> 
> This part is really offensively misleading.  It does not 
> matter whether 
> the code has been compile-tested on OMAP24xx if it could 
> never actually 
> run on OMAP24xx.

Charu,

You can mention explicitely in the cover letter that these patches
would break omap2 functionality, since no hwmod struct's are added
for omap2. I agree with Paul that saying they are compile tested might
mislead someone in believing that these patches are tested on omap2.

regards,
Rajendra

> 
> 
> - Paul
> --
> 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] 9+ messages in thread

* RE: [PATCH 0/2 RFC]OMAP3430: hwmod FW for GPIO
  2010-02-15  6:54   ` Nayak, Rajendra
@ 2010-02-16 15:05     ` Varadarajan, Charulatha
  0 siblings, 0 replies; 9+ messages in thread
From: Varadarajan, Charulatha @ 2010-02-16 15:05 UTC (permalink / raw)
  To: Nayak, Rajendra, Paul Walmsley
  Cc: linux-omap@vger.kernel.org, tony@atomide.com,
	khilman@deeprootsystems.com



> -----Original Message-----
> From: Nayak, Rajendra
> Sent: Monday, February 15, 2010 12:25 PM
> To: Paul Walmsley; Varadarajan, Charulatha
> Cc: linux-omap@vger.kernel.org; tony@atomide.com;
> khilman@deeprootsystems.com
> Subject: RE: [PATCH 0/2 RFC]OMAP3430: hwmod FW for GPIO
> 
> 
> > -----Original Message-----
> > From: linux-omap-owner@vger.kernel.org
> > [mailto:linux-omap-owner@vger.kernel.org] On Behalf Of Paul Walmsley
> > Sent: Saturday, February 13, 2010 3:31 AM
> > To: Varadarajan, Charulatha
> > Cc: linux-omap@vger.kernel.org; tony@atomide.com;
> > khilman@deeprootsystems.com
> > Subject: Re: [PATCH 0/2 RFC]OMAP3430: hwmod FW for GPIO
> >
> > By the way:
> >
> > On Fri, 12 Feb 2010, Varadarajan, Charulatha wrote:
> >
> > > They are boot tested on SDP 3430 and compile tested
> > > for OMAP 2420 and 2430.
> >
> > This part is really offensively misleading.  It does not
> > matter whether
> > the code has been compile-tested on OMAP24xx if it could
> > never actually
> > run on OMAP24xx.
> 
> Charu,
> 
> You can mention explicitely in the cover letter that these patches
> would break omap2 functionality, since no hwmod struct's are added
> for omap2. I agree with Paul that saying they are compile tested might
> mislead someone in believing that these patches are tested on omap2.
> 

Rajendra & Paul, 
Ok. I will do the needful while sending out next version of the patch series.

> regards,
> Rajendra
> 
> >
> >
> > - Paul
> > --
> > 

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

* RE: [PATCH 0/2 RFC]OMAP3430: hwmod FW for GPIO
  2010-02-12 21:50 ` [PATCH 0/2 RFC]OMAP3430: hwmod FW for GPIO Paul Walmsley
@ 2010-02-16 15:05   ` Varadarajan, Charulatha
  0 siblings, 0 replies; 9+ messages in thread
From: Varadarajan, Charulatha @ 2010-02-16 15:05 UTC (permalink / raw)
  To: Paul Walmsley
  Cc: linux-omap@vger.kernel.org, khilman@deeprootsystems.com,
	tony@atomide.com, Nayak, Rajendra



> -----Original Message-----
> From: Paul Walmsley [mailto:paul@pwsan.com]
> Sent: Saturday, February 13, 2010 3:20 AM
> To: Varadarajan, Charulatha
> Cc: linux-omap@vger.kernel.org; khilman@deeprootsystems.com;
> tony@atomide.com; Nayak, Rajendra
> Subject: Re: [PATCH 0/2 RFC]OMAP3430: hwmod FW for GPIO
> 
> On Fri, 12 Feb 2010, Varadarajan, Charulatha wrote:
> 
> > This patch series makes the OMAP3430 GPIO module
> > use hwmod framework.
> >
> > This patch series applies on top of pm branch
> > and it requires my previous patch set which converts
> > GPIO into an early init device.
> >
> > They are boot tested on SDP 3430 and compile tested
> > for OMAP 2420 and 2430.
> >
> > Charulatha V (2):
> >   OMAP3: hwmod: add GPIO hwmods for OMAP3430
> >   OMAP3: hwmod: Adapt HWMOD FW for GPIO OMAP3430
> >
> >  arch/arm/mach-omap2/gpio.c             |  901 ++++---------------------
> -------
> >  arch/arm/mach-omap2/omap_hwmod_34xx.h  |  410 +++++++++++++++
> >  arch/arm/plat-omap/include/plat/gpio.h |   25 +-
> 
> NAK.  Your series just broke GPIO for all non-OMAP3430 chips.

Paul,

This patch series is only RFC as the changes are huge. 
I would like to get comments for the approach taken for HWMOD implementation for GPIO.  After aligning with everyone, I would extend my patches to support non-OMAP3430 chips too.

-Charulatha

> 
> 
> - Paul

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

* Re: [PATCH 0/2 RFC]OMAP3430: hwmod FW for GPIO
  2010-02-12 13:39 [PATCH 0/2 RFC]OMAP3430: hwmod FW for GPIO Varadarajan, Charulatha
                   ` (2 preceding siblings ...)
  2010-02-12 22:00 ` Paul Walmsley
@ 2010-02-17 22:09 ` Kevin Hilman
  3 siblings, 0 replies; 9+ messages in thread
From: Kevin Hilman @ 2010-02-17 22:09 UTC (permalink / raw)
  To: Varadarajan, Charulatha; +Cc: linux-omap

"Varadarajan, Charulatha" <charu@ti.com> writes:

> From: Charulatha V <charu@ti.com>
>
> This patch series makes the OMAP3430 GPIO module
> use hwmod framework.
>
> This patch series applies on top of pm branch
> and it requires my previous patch set which converts
> GPIO into an early init device. 

There's no reason this needs to depend on the PM branch.  

I have a WIP branch on my tree named 'pm-wip/hwmod' which already has
a set of hwmod updates (UART and MMC currently.)  This branch is based
on Tony's omap-for-linus branch.  

To best avoid conflicts with other hwmods, please base this series on
my pm-wip/hwmod branch.

Kevin

> They are boot tested on SDP 3430 and compile tested
> for OMAP 2420 and 2430.
>
> Charulatha V (2):
>   OMAP3: hwmod: add GPIO hwmods for OMAP3430
>   OMAP3: hwmod: Adapt HWMOD FW for GPIO OMAP3430
>
>  arch/arm/mach-omap2/gpio.c             |  901 ++++----------------------------
>  arch/arm/mach-omap2/omap_hwmod_34xx.h  |  410 +++++++++++++++
>  arch/arm/plat-omap/include/plat/gpio.h |   25 +-
>  3 files changed, 533 insertions(+), 803 deletions(-)
>
> --
> 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] 9+ messages in thread

end of thread, other threads:[~2010-02-17 22:09 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-12 13:39 [PATCH 0/2 RFC]OMAP3430: hwmod FW for GPIO Varadarajan, Charulatha
2010-02-12 13:39 ` [PATCH 1/2 RFC]OMAP3430: hwmod: add GPIO hwmods Varadarajan, Charulatha
2010-02-12 13:39   ` [PATCH 2/2 RFC]OMAP3430: hwmod: Adapt GPIO to use HWMOD FW Varadarajan, Charulatha
2010-02-12 21:50 ` [PATCH 0/2 RFC]OMAP3430: hwmod FW for GPIO Paul Walmsley
2010-02-16 15:05   ` Varadarajan, Charulatha
2010-02-12 22:00 ` Paul Walmsley
2010-02-15  6:54   ` Nayak, Rajendra
2010-02-16 15:05     ` Varadarajan, Charulatha
2010-02-17 22:09 ` Kevin Hilman

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