]> err.no Git - linux-2.6/commitdiff
[ARM] 5075/1: i2c-pxa: move i2c pin setup and PCFR_PI2CEN handling into arch/arm...
authorPhilipp Zabel <philipp.zabel@gmail.com>
Mon, 2 Jun 2008 17:49:27 +0000 (18:49 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 2 Jun 2008 18:33:25 +0000 (19:33 +0100)
This fixes a build error introduced when the power manager
register definitions were moved into pxa2xx-regs.h.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mach-pxa/devices.c
arch/arm/mach-pxa/pxa27x.c
drivers/i2c/busses/i2c-pxa.c

index d6c05b6eab359af09d97051bec813ccf67d8e61b..af6cc3dbb9a3431e89643ea7b649c8e8f80c17da 100644 (file)
 #include <asm/arch/mmc.h>
 #include <asm/arch/irda.h>
 #include <asm/arch/i2c.h>
+#include <asm/arch/mfp-pxa27x.h>
 #include <asm/arch/ohci.h>
 #include <asm/arch/pxa27x_keypad.h>
 #include <asm/arch/camera.h>
 
 #include "devices.h"
+#include "generic.h"
 
 void __init pxa_register_device(struct platform_device *dev, void *data)
 {
@@ -233,8 +235,15 @@ struct platform_device pxa_device_i2c = {
        .num_resources  = ARRAY_SIZE(pxai2c_resources),
 };
 
+static unsigned long pxa27x_i2c_mfp_cfg[] = {
+       GPIO117_I2C_SCL,
+       GPIO118_I2C_SDA,
+};
+
 void __init pxa_set_i2c_info(struct i2c_pxa_platform_data *info)
 {
+       if (cpu_is_pxa27x())
+               pxa2xx_mfp_config(ARRAY_AND_SIZE(pxa27x_i2c_mfp_cfg));
        pxa_register_device(&pxa_device_i2c, info);
 }
 
index cdaf573e0f172c7bade87520982f4da3e6528fe2..48cbdc771a808b246305997babac8abe71981ee5 100644 (file)
@@ -349,6 +349,9 @@ struct platform_device pxa27x_device_i2c_power = {
 
 void __init pxa_set_i2c_power_info(struct i2c_pxa_platform_data *info)
 {
+       local_irq_disable();
+       PCFR |= PCFR_PI2CEN;
+       local_irq_enable();
        pxa27x_device_i2c_power.dev.platform_data = info;
 }
 
index eb69fbadc9cb273a77111a0fe43a55debf13f4da..9f61e9b3a327321368d1a52413c27063ec062564 100644 (file)
@@ -945,32 +945,6 @@ static const struct i2c_algorithm i2c_pxa_pio_algorithm = {
        .functionality  = i2c_pxa_functionality,
 };
 
-static void i2c_pxa_enable(struct platform_device *dev)
-{
-       if (cpu_is_pxa27x()) {
-               switch (dev->id) {
-               case 0:
-                       pxa_gpio_mode(GPIO117_I2CSCL_MD);
-                       pxa_gpio_mode(GPIO118_I2CSDA_MD);
-                       break;
-               case 1:
-                       local_irq_disable();
-                       PCFR |= PCFR_PI2CEN;
-                       local_irq_enable();
-                       break;
-               }
-       }
-}
-
-static void i2c_pxa_disable(struct platform_device *dev)
-{
-       if (cpu_is_pxa27x() && dev->id == 1) {
-               local_irq_disable();
-               PCFR &= ~PCFR_PI2CEN;
-               local_irq_enable();
-       }
-}
-
 #define res_len(r)             ((r)->end - (r)->start + 1)
 static int i2c_pxa_probe(struct platform_device *dev)
 {
@@ -1036,7 +1010,6 @@ static int i2c_pxa_probe(struct platform_device *dev)
 #endif
 
        clk_enable(i2c->clk);
-       i2c_pxa_enable(dev);
 
        if (plat) {
                i2c->adap.class = plat->class;
@@ -1080,7 +1053,6 @@ eadapt:
                free_irq(irq, i2c);
 ereqirq:
        clk_disable(i2c->clk);
-       i2c_pxa_disable(dev);
        iounmap(i2c->reg_base);
 eremap:
        clk_put(i2c->clk);
@@ -1103,7 +1075,6 @@ static int __exit i2c_pxa_remove(struct platform_device *dev)
 
        clk_disable(i2c->clk);
        clk_put(i2c->clk);
-       i2c_pxa_disable(dev);
 
        iounmap(i2c->reg_base);
        release_mem_region(i2c->iobase, i2c->iosize);