ARM: plat-iop: pass physical base for GPIO
authorLinus Walleij <linus.walleij@linaro.org>
Mon, 9 Sep 2013 14:59:54 +0000 (16:59 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Fri, 20 Sep 2013 21:05:19 +0000 (23:05 +0200)
This alters the IOP platforms to pass a physical base for their
GPIO blocks and alters the driver to remap it when probing
instead of relying on the virtual addresses to be used.

Cc: Lennert Buytenhek <kernel@wantstofly.org>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Mikael Pettersson <mikpe@it.uu.se>
Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
arch/arm/mach-iop32x/gpio-iop32x.h
arch/arm/mach-iop33x/iq80331.c
arch/arm/mach-iop33x/iq80332.c
drivers/gpio/gpio-iop.c

index b8710a63a13e9a8e67605f1e19fc5f938d5c22ad..3c7309c02029704834503d5c58e81bc47df75bd2 100644 (file)
@@ -1,5 +1,5 @@
 static struct resource iop32x_gpio_res[] = {
-       DEFINE_RES_MEM((IOP3XX_PERIPHERAL_VIRT_BASE + 0x07c4), 0x10),
+       DEFINE_RES_MEM((IOP3XX_PERIPHERAL_PHYS_BASE + 0x07c4), 0x10),
 };
 
 static inline void register_iop32x_gpio(void)
index 25741c4c92de218805f66efa4347df4a9e325f09..e2cb65cfbe23ec659f89efb780c36fc140b932b6 100644 (file)
@@ -123,7 +123,7 @@ static struct platform_device iq80331_flash_device = {
 };
 
 static struct resource iq80331_gpio_res[] = {
-       DEFINE_RES_MEM((IOP3XX_PERIPHERAL_VIRT_BASE + 0x1780), 0x10),
+       DEFINE_RES_MEM((IOP3XX_PERIPHERAL_PHYS_BASE + 0x1780), 0x10),
 };
 
 static void __init iq80331_init_machine(void)
index a3b56e1c2ad46aa201e5dadcfb1a1c596c91920d..0b6269d94f89670814889d6a04a3fe326c8ac782 100644 (file)
@@ -123,7 +123,7 @@ static struct platform_device iq80332_flash_device = {
 };
 
 static struct resource iq80332_gpio_res[] = {
-       DEFINE_RES_MEM((IOP3XX_PERIPHERAL_VIRT_BASE + 0x1780), 0x10),
+       DEFINE_RES_MEM((IOP3XX_PERIPHERAL_PHYS_BASE + 0x1780), 0x10),
 };
 
 static void __init iq80332_init_machine(void)
index 0d991d7324672a97cc8db65d50a2a809c6556a1f..c22a61be3a9ce2770552a99d0be9465174180154 100644 (file)
@@ -110,7 +110,7 @@ static int iop3xx_gpio_probe(struct platform_device *pdev)
        struct resource *res;
 
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       base = (void *) res->start;
+       base = devm_ioremap_resource(&pdev->dev, res);
 
        return gpiochip_add(&iop3xx_chip);
 }