Re: [PATCH v8 04/11] OMAP7xx: GPIO: Introduce support for GPIO init

2010-12-06 Thread Cory Maccarrone
On Thu, Nov 25, 2010 at 4:48 AM, Varadarajan, Charulatha ch...@ti.com wrote:
 Add support for handling OMAP7xx specific gpio_init by
 providing platform device data and doing device registration.

 Signed-off-by: Charulatha V ch...@ti.com
 ---
  arch/arm/mach-omap1/gpio7xx.c |  261 
 +
  1 files changed, 261 insertions(+), 0 deletions(-)
  create mode 100644 arch/arm/mach-omap1/gpio7xx.c

 diff --git a/arch/arm/mach-omap1/gpio7xx.c b/arch/arm/mach-omap1/gpio7xx.c
 new file mode 100644
 index 000..94bccd4
 --- /dev/null
 +++ b/arch/arm/mach-omap1/gpio7xx.c
 @@ -0,0 +1,261 @@
 +/*
 + * OMAP7xx specific gpio init
 + *
 + * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
 + *
 + * Author:
 + *     Charulatha V ch...@ti.com
 + *
 + * This program is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU General Public License as
 + * published by the Free Software Foundation version 2.
 + *
 + * This program is distributed as is WITHOUT ANY WARRANTY of any
 + * kind, whether express or implied; without even the implied warranty
 + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 + * GNU General Public License for more details.
 + */
 +
 +#include linux/gpio.h
 +
 +#define OMAP7XX_GPIO1_BASE             0xfffbc000
 +#define OMAP7XX_GPIO2_BASE             0xfffbc800
 +#define OMAP7XX_GPIO3_BASE             0xfffbd000
 +#define OMAP7XX_GPIO4_BASE             0xfffbd800
 +#define OMAP7XX_GPIO5_BASE             0xfffbe000
 +#define OMAP7XX_GPIO6_BASE             0xfffbe800
 +#define OMAP1_MPUIO_VBASE              OMAP1_MPUIO_BASE
 +
 +/* mpu gpio */
 +static struct __initdata resource omap7xx_mpu_gpio_resources[] = {
 +       {
 +               .start  = OMAP1_MPUIO_VBASE,
 +               .end    = OMAP1_MPUIO_VBASE + SZ_2K - 1,
 +               .flags  = IORESOURCE_MEM,
 +       },
 +       {
 +               .start  = INT_7XX_MPUIO,
 +               .flags  = IORESOURCE_IRQ,
 +       },
 +};
 +
 +static struct __initdata omap_gpio_platform_data omap7xx_mpu_gpio_config = {
 +       .virtual_irq_start      = IH_MPUIO_BASE,
 +       .bank_type              = METHOD_MPUIO,
 +       .bank_width             = 32,

I think we need

.dbck_flag = false,

here -- we don't have a dbclk on omap7xx.  Without this, we get:

omap_gpio omap_gpio.5: Could not get gpio dbck
omap_gpio omap_gpio.6: Could not get gpio dbck

This needs to be added to the other 5 GPIO blocks in this file as well.

- Cory
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v8 04/11] OMAP7xx: GPIO: Introduce support for GPIO init

2010-12-06 Thread Varadarajan, Charulatha
On Tue, Dec 7, 2010 at 10:50, Cory Maccarrone darkstar6...@gmail.com wrote:
 On Thu, Nov 25, 2010 at 4:48 AM, Varadarajan, Charulatha ch...@ti.com wrote:
 Add support for handling OMAP7xx specific gpio_init by
 providing platform device data and doing device registration.

 Signed-off-by: Charulatha V ch...@ti.com
 ---
  arch/arm/mach-omap1/gpio7xx.c |  261 
 +
  1 files changed, 261 insertions(+), 0 deletions(-)
  create mode 100644 arch/arm/mach-omap1/gpio7xx.c

 diff --git a/arch/arm/mach-omap1/gpio7xx.c b/arch/arm/mach-omap1/gpio7xx.c
 new file mode 100644
 index 000..94bccd4
 --- /dev/null
 +++ b/arch/arm/mach-omap1/gpio7xx.c
 @@ -0,0 +1,261 @@
 +/*
 + * OMAP7xx specific gpio init
 + *
 + * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
 + *
 + * Author:
 + *     Charulatha V ch...@ti.com
 + *
 + * This program is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU General Public License as
 + * published by the Free Software Foundation version 2.
 + *
 + * This program is distributed as is WITHOUT ANY WARRANTY of any
 + * kind, whether express or implied; without even the implied warranty
 + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 + * GNU General Public License for more details.
 + */
 +
 +#include linux/gpio.h
 +
 +#define OMAP7XX_GPIO1_BASE             0xfffbc000
 +#define OMAP7XX_GPIO2_BASE             0xfffbc800
 +#define OMAP7XX_GPIO3_BASE             0xfffbd000
 +#define OMAP7XX_GPIO4_BASE             0xfffbd800
 +#define OMAP7XX_GPIO5_BASE             0xfffbe000
 +#define OMAP7XX_GPIO6_BASE             0xfffbe800
 +#define OMAP1_MPUIO_VBASE              OMAP1_MPUIO_BASE
 +
 +/* mpu gpio */
 +static struct __initdata resource omap7xx_mpu_gpio_resources[] = {
 +       {
 +               .start  = OMAP1_MPUIO_VBASE,
 +               .end    = OMAP1_MPUIO_VBASE + SZ_2K - 1,
 +               .flags  = IORESOURCE_MEM,
 +       },
 +       {
 +               .start  = INT_7XX_MPUIO,
 +               .flags  = IORESOURCE_IRQ,
 +       },
 +};
 +
 +static struct __initdata omap_gpio_platform_data omap7xx_mpu_gpio_config = {
 +       .virtual_irq_start      = IH_MPUIO_BASE,
 +       .bank_type              = METHOD_MPUIO,
 +       .bank_width             = 32,

 I think we need

    .dbck_flag = false,

I think it's not required since it is a static data. Modifying the
if condition
in gpio_debounce as per your suggestion will resolve this issue.


 here -- we don't have a dbclk on omap7xx.  Without this, we get:

    omap_gpio omap_gpio.5: Could not get gpio dbck
    omap_gpio omap_gpio.6: Could not get gpio dbck

 This needs to be added to the other 5 GPIO blocks in this file as well.

 - Cory

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v8 04/11] OMAP7xx: GPIO: Introduce support for GPIO init

2010-11-25 Thread Varadarajan, Charulatha
Add support for handling OMAP7xx specific gpio_init by
providing platform device data and doing device registration.

Signed-off-by: Charulatha V ch...@ti.com
---
 arch/arm/mach-omap1/gpio7xx.c |  261 +
 1 files changed, 261 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap1/gpio7xx.c

diff --git a/arch/arm/mach-omap1/gpio7xx.c b/arch/arm/mach-omap1/gpio7xx.c
new file mode 100644
index 000..94bccd4
--- /dev/null
+++ b/arch/arm/mach-omap1/gpio7xx.c
@@ -0,0 +1,261 @@
+/*
+ * OMAP7xx specific gpio init
+ *
+ * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * Author:
+ * Charulatha V ch...@ti.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ *
+ * This program is distributed as is WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include linux/gpio.h
+
+#define OMAP7XX_GPIO1_BASE 0xfffbc000
+#define OMAP7XX_GPIO2_BASE 0xfffbc800
+#define OMAP7XX_GPIO3_BASE 0xfffbd000
+#define OMAP7XX_GPIO4_BASE 0xfffbd800
+#define OMAP7XX_GPIO5_BASE 0xfffbe000
+#define OMAP7XX_GPIO6_BASE 0xfffbe800
+#define OMAP1_MPUIO_VBASE  OMAP1_MPUIO_BASE
+
+/* mpu gpio */
+static struct __initdata resource omap7xx_mpu_gpio_resources[] = {
+   {
+   .start  = OMAP1_MPUIO_VBASE,
+   .end= OMAP1_MPUIO_VBASE + SZ_2K - 1,
+   .flags  = IORESOURCE_MEM,
+   },
+   {
+   .start  = INT_7XX_MPUIO,
+   .flags  = IORESOURCE_IRQ,
+   },
+};
+
+static struct __initdata omap_gpio_platform_data omap7xx_mpu_gpio_config = {
+   .virtual_irq_start  = IH_MPUIO_BASE,
+   .bank_type  = METHOD_MPUIO,
+   .bank_width = 32,
+};
+
+static struct __initdata platform_device omap7xx_mpu_gpio = {
+   .name   = omap_gpio,
+   .id = 0,
+   .dev= {
+   .platform_data = omap7xx_mpu_gpio_config,
+   },
+   .num_resources = ARRAY_SIZE(omap7xx_mpu_gpio_resources),
+   .resource = omap7xx_mpu_gpio_resources,
+};
+
+/* gpio1 */
+static struct __initdata resource omap7xx_gpio1_resources[] = {
+   {
+   .start  = OMAP7XX_GPIO1_BASE,
+   .end= OMAP7XX_GPIO1_BASE + SZ_2K - 1,
+   .flags  = IORESOURCE_MEM,
+   },
+   {
+   .start  = INT_7XX_GPIO_BANK1,
+   .flags  = IORESOURCE_IRQ,
+   },
+};
+
+static struct __initdata omap_gpio_platform_data omap7xx_gpio1_config = {
+   .virtual_irq_start  = IH_GPIO_BASE,
+   .bank_type  = METHOD_GPIO_7XX,
+   .bank_width = 32,
+};
+
+static struct __initdata platform_device omap7xx_gpio1 = {
+   .name   = omap_gpio,
+   .id = 1,
+   .dev= {
+   .platform_data = omap7xx_gpio1_config,
+   },
+   .num_resources = ARRAY_SIZE(omap7xx_gpio1_resources),
+   .resource = omap7xx_gpio1_resources,
+};
+
+/* gpio2 */
+static struct __initdata resource omap7xx_gpio2_resources[] = {
+   {
+   .start  = OMAP7XX_GPIO2_BASE,
+   .end= OMAP7XX_GPIO2_BASE + SZ_2K - 1,
+   .flags  = IORESOURCE_MEM,
+   },
+   {
+   .start  = INT_7XX_GPIO_BANK2,
+   .flags  = IORESOURCE_IRQ,
+   },
+};
+
+static struct __initdata omap_gpio_platform_data omap7xx_gpio2_config = {
+   .virtual_irq_start  = IH_GPIO_BASE + 32,
+   .bank_type  = METHOD_GPIO_7XX,
+   .bank_width = 32,
+};
+
+static struct __initdata platform_device omap7xx_gpio2 = {
+   .name   = omap_gpio,
+   .id = 2,
+   .dev= {
+   .platform_data = omap7xx_gpio2_config,
+   },
+   .num_resources = ARRAY_SIZE(omap7xx_gpio2_resources),
+   .resource = omap7xx_gpio2_resources,
+};
+
+/* gpio3 */
+static struct __initdata resource omap7xx_gpio3_resources[] = {
+   {
+   .start  = OMAP7XX_GPIO3_BASE,
+   .end= OMAP7XX_GPIO3_BASE + SZ_2K - 1,
+   .flags  = IORESOURCE_MEM,
+   },
+   {
+   .start  = INT_7XX_GPIO_BANK3,
+   .flags  = IORESOURCE_IRQ,
+   },
+};
+
+static struct __initdata omap_gpio_platform_data omap7xx_gpio3_config = {
+   .virtual_irq_start  = IH_GPIO_BASE + 64,
+   .bank_type  = METHOD_GPIO_7XX,
+   .bank_width = 32,
+};
+
+static struct __initdata platform_device omap7xx_gpio3 = {
+   .name   = omap_gpio,
+   .id