diff options
-rw-r--r-- | arch/arm/mach-pxa/devices.c | 9 | ||||
-rw-r--r-- | arch/arm/mach-pxa/pxa27x.c | 3 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-pxa.c | 29 |
3 files changed, 12 insertions, 29 deletions
diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c index d6c05b6eab35..af6cc3dbb9a3 100644 --- a/arch/arm/mach-pxa/devices.c +++ b/arch/arm/mach-pxa/devices.c | |||
@@ -10,11 +10,13 @@ | |||
10 | #include <asm/arch/mmc.h> | 10 | #include <asm/arch/mmc.h> |
11 | #include <asm/arch/irda.h> | 11 | #include <asm/arch/irda.h> |
12 | #include <asm/arch/i2c.h> | 12 | #include <asm/arch/i2c.h> |
13 | #include <asm/arch/mfp-pxa27x.h> | ||
13 | #include <asm/arch/ohci.h> | 14 | #include <asm/arch/ohci.h> |
14 | #include <asm/arch/pxa27x_keypad.h> | 15 | #include <asm/arch/pxa27x_keypad.h> |
15 | #include <asm/arch/camera.h> | 16 | #include <asm/arch/camera.h> |
16 | 17 | ||
17 | #include "devices.h" | 18 | #include "devices.h" |
19 | #include "generic.h" | ||
18 | 20 | ||
19 | void __init pxa_register_device(struct platform_device *dev, void *data) | 21 | void __init pxa_register_device(struct platform_device *dev, void *data) |
20 | { | 22 | { |
@@ -233,8 +235,15 @@ struct platform_device pxa_device_i2c = { | |||
233 | .num_resources = ARRAY_SIZE(pxai2c_resources), | 235 | .num_resources = ARRAY_SIZE(pxai2c_resources), |
234 | }; | 236 | }; |
235 | 237 | ||
238 | static unsigned long pxa27x_i2c_mfp_cfg[] = { | ||
239 | GPIO117_I2C_SCL, | ||
240 | GPIO118_I2C_SDA, | ||
241 | }; | ||
242 | |||
236 | void __init pxa_set_i2c_info(struct i2c_pxa_platform_data *info) | 243 | void __init pxa_set_i2c_info(struct i2c_pxa_platform_data *info) |
237 | { | 244 | { |
245 | if (cpu_is_pxa27x()) | ||
246 | pxa2xx_mfp_config(ARRAY_AND_SIZE(pxa27x_i2c_mfp_cfg)); | ||
238 | pxa_register_device(&pxa_device_i2c, info); | 247 | pxa_register_device(&pxa_device_i2c, info); |
239 | } | 248 | } |
240 | 249 | ||
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c index cdaf573e0f17..48cbdc771a80 100644 --- a/arch/arm/mach-pxa/pxa27x.c +++ b/arch/arm/mach-pxa/pxa27x.c | |||
@@ -349,6 +349,9 @@ struct platform_device pxa27x_device_i2c_power = { | |||
349 | 349 | ||
350 | void __init pxa_set_i2c_power_info(struct i2c_pxa_platform_data *info) | 350 | void __init pxa_set_i2c_power_info(struct i2c_pxa_platform_data *info) |
351 | { | 351 | { |
352 | local_irq_disable(); | ||
353 | PCFR |= PCFR_PI2CEN; | ||
354 | local_irq_enable(); | ||
352 | pxa27x_device_i2c_power.dev.platform_data = info; | 355 | pxa27x_device_i2c_power.dev.platform_data = info; |
353 | } | 356 | } |
354 | 357 | ||
diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c index eb69fbadc9cb..9f61e9b3a327 100644 --- a/drivers/i2c/busses/i2c-pxa.c +++ b/drivers/i2c/busses/i2c-pxa.c | |||
@@ -945,32 +945,6 @@ static const struct i2c_algorithm i2c_pxa_pio_algorithm = { | |||
945 | .functionality = i2c_pxa_functionality, | 945 | .functionality = i2c_pxa_functionality, |
946 | }; | 946 | }; |
947 | 947 | ||
948 | static void i2c_pxa_enable(struct platform_device *dev) | ||
949 | { | ||
950 | if (cpu_is_pxa27x()) { | ||
951 | switch (dev->id) { | ||
952 | case 0: | ||
953 | pxa_gpio_mode(GPIO117_I2CSCL_MD); | ||
954 | pxa_gpio_mode(GPIO118_I2CSDA_MD); | ||
955 | break; | ||
956 | case 1: | ||
957 | local_irq_disable(); | ||
958 | PCFR |= PCFR_PI2CEN; | ||
959 | local_irq_enable(); | ||
960 | break; | ||
961 | } | ||
962 | } | ||
963 | } | ||
964 | |||
965 | static void i2c_pxa_disable(struct platform_device *dev) | ||
966 | { | ||
967 | if (cpu_is_pxa27x() && dev->id == 1) { | ||
968 | local_irq_disable(); | ||
969 | PCFR &= ~PCFR_PI2CEN; | ||
970 | local_irq_enable(); | ||
971 | } | ||
972 | } | ||
973 | |||
974 | #define res_len(r) ((r)->end - (r)->start + 1) | 948 | #define res_len(r) ((r)->end - (r)->start + 1) |
975 | static int i2c_pxa_probe(struct platform_device *dev) | 949 | static int i2c_pxa_probe(struct platform_device *dev) |
976 | { | 950 | { |
@@ -1036,7 +1010,6 @@ static int i2c_pxa_probe(struct platform_device *dev) | |||
1036 | #endif | 1010 | #endif |
1037 | 1011 | ||
1038 | clk_enable(i2c->clk); | 1012 | clk_enable(i2c->clk); |
1039 | i2c_pxa_enable(dev); | ||
1040 | 1013 | ||
1041 | if (plat) { | 1014 | if (plat) { |
1042 | i2c->adap.class = plat->class; | 1015 | i2c->adap.class = plat->class; |
@@ -1080,7 +1053,6 @@ eadapt: | |||
1080 | free_irq(irq, i2c); | 1053 | free_irq(irq, i2c); |
1081 | ereqirq: | 1054 | ereqirq: |
1082 | clk_disable(i2c->clk); | 1055 | clk_disable(i2c->clk); |
1083 | i2c_pxa_disable(dev); | ||
1084 | iounmap(i2c->reg_base); | 1056 | iounmap(i2c->reg_base); |
1085 | eremap: | 1057 | eremap: |
1086 | clk_put(i2c->clk); | 1058 | clk_put(i2c->clk); |
@@ -1103,7 +1075,6 @@ static int __exit i2c_pxa_remove(struct platform_device *dev) | |||
1103 | 1075 | ||
1104 | clk_disable(i2c->clk); | 1076 | clk_disable(i2c->clk); |
1105 | clk_put(i2c->clk); | 1077 | clk_put(i2c->clk); |
1106 | i2c_pxa_disable(dev); | ||
1107 | 1078 | ||
1108 | iounmap(i2c->reg_base); | 1079 | iounmap(i2c->reg_base); |
1109 | release_mem_region(i2c->iobase, i2c->iosize); | 1080 | release_mem_region(i2c->iobase, i2c->iosize); |