From: Arnd Bergmann Date: Fri, 2 Mar 2012 13:05:00 +0000 (+0000) Subject: Merge branch 'depends/omap/gpio/runtime-pm-cleanup' into next/cleanup X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=1220547bfd7f7dd97f770a04b533323e5404b8e9;p=linux-beck.git Merge branch 'depends/omap/gpio/runtime-pm-cleanup' into next/cleanup 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 --- 1220547bfd7f7dd97f770a04b533323e5404b8e9 diff --cc arch/arm/mach-omap1/gpio16xx.c index 99cabc498ab5,1c5f90e17427..1fb3b9ad496e --- a/arch/arm/mach-omap1/gpio16xx.c +++ b/arch/arm/mach-omap1/gpio16xx.c @@@ -218,17 -225,34 +225,34 @@@ static int __init omap16xx_gpio_init(vo if (!cpu_is_omap16xx()) return -EINVAL; + /* + * 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++) - platform_device_register(omap16xx_gpio_dev[i]); + 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; }