Merge branch 'depends/omap/gpio/runtime-pm-cleanup' into next/cleanup
authorArnd Bergmann <arnd@arndb.de>
Fri, 2 Mar 2012 13:05:00 +0000 (13:05 +0000)
committerArnd Bergmann <arnd@arndb.de>
Fri, 2 Mar 2012 13:05:00 +0000 (13:05 +0000)
Conflicts:
arch/arm/mach-omap1/gpio16xx.c
drivers/gpio/gpio-omap.c

Merge in the runtime-pm-cleanup branch from the gpio tree into
next/cleanup, this resolves a nonobvious merge conflict between
the two branches. Both branches move parts of the gpio-omap
driver into platform code, this takes the superset of both
changes.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
1  2 
arch/arm/mach-omap1/gpio16xx.c
arch/arm/mach-omap2/pm34xx.c

@@@ -218,17 -225,34 +225,34 @@@ static int __init omap16xx_gpio_init(vo
        if (!cpu_is_omap16xx())
                return -EINVAL;
  
-       for (i = 0; i < ARRAY_SIZE(omap16xx_gpio_dev); i++)
-               platform_device_register(omap16xx_gpio_dev[i]);
 +      /*
 +       * Enable system clock for GPIO module.
 +       * The CAM_CLK_CTRL *is* really the right place.
 +       */
 +      omap_writel(omap_readl(ULPD_CAM_CLK_CTRL) | 0x04,
 +                                      ULPD_CAM_CLK_CTRL);
 +
+       for (i = 0; i < ARRAY_SIZE(omap16xx_gpio_dev); i++) {
+               pdev = omap16xx_gpio_dev[i];
+               pdata = pdev->dev.platform_data;
+               res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+               if (unlikely(!res)) {
+                       dev_err(&pdev->dev, "Invalid mem resource.\n");
+                       return -ENODEV;
+               }
  
-       gpio_bank_count = ARRAY_SIZE(omap16xx_gpio_dev);
+               base = ioremap(res->start, resource_size(res));
+               if (unlikely(!base)) {
+                       dev_err(&pdev->dev, "ioremap failed.\n");
+                       return -ENOMEM;
+               }
+               __raw_writel(SYSCONFIG_WORD, base + OMAP1610_GPIO_SYSCONFIG);
+               iounmap(base);
 -              /*
 -               * Enable system clock for GPIO module.
 -               * The CAM_CLK_CTRL *is* really the right place.
 -               */
 -              omap_writel(omap_readl(ULPD_CAM_CLK_CTRL) | 0x04,
 -                                      ULPD_CAM_CLK_CTRL);
 -
+               platform_device_register(omap16xx_gpio_dev[i]);
+       }
  
        return 0;
  }
Simple merge