aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJarkko Nikula <jhnikula@gmail.com>2010-02-22 15:29:36 -0500
committerTony Lindgren <tony@atomide.com>2010-02-25 17:45:08 -0500
commit9833eff3d7db76d2d04f28567ed8704d69e225ae (patch)
treed28dbe65312a00ad58d733425941dc38e6d4b5f6
parentb610ec502376d915b76a62e22576c5d0462cc9c9 (diff)
omap: i2c: Fix muxing for command line enabled bus
The commit b63128e81214cc2db2995d690438055c26d213a5 broke the pin muxing for I2C busses that are enabled from the kernel command line. Fix this by defining the board registration function omap_register_i2c_bus in common platform code as it was before but keep the muxing in architecture dependent files. Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
-rw-r--r--arch/arm/mach-omap1/i2c.c6
-rw-r--r--arch/arm/mach-omap2/i2c.c6
-rw-r--r--arch/arm/plat-omap/i2c.c10
-rw-r--r--arch/arm/plat-omap/include/plat/i2c.h5
4 files changed, 12 insertions, 15 deletions
diff --git a/arch/arm/mach-omap1/i2c.c b/arch/arm/mach-omap1/i2c.c
index 1bf4735e27a6..5446c9912641 100644
--- a/arch/arm/mach-omap1/i2c.c
+++ b/arch/arm/mach-omap1/i2c.c
@@ -23,9 +23,7 @@
23#include <plat/mux.h> 23#include <plat/mux.h>
24#include <plat/cpu.h> 24#include <plat/cpu.h>
25 25
26int __init omap_register_i2c_bus(int bus_id, u32 clkrate, 26void __init omap1_i2c_mux_pins(int bus_id)
27 struct i2c_board_info const *info,
28 unsigned len)
29{ 27{
30 if (cpu_is_omap7xx()) { 28 if (cpu_is_omap7xx()) {
31 omap_cfg_reg(I2C_7XX_SDA); 29 omap_cfg_reg(I2C_7XX_SDA);
@@ -34,6 +32,4 @@ int __init omap_register_i2c_bus(int bus_id, u32 clkrate,
34 omap_cfg_reg(I2C_SDA); 32 omap_cfg_reg(I2C_SDA);
35 omap_cfg_reg(I2C_SCL); 33 omap_cfg_reg(I2C_SCL);
36 } 34 }
37
38 return omap_plat_register_i2c_bus(bus_id, clkrate, info, len);
39} 35}
diff --git a/arch/arm/mach-omap2/i2c.c b/arch/arm/mach-omap2/i2c.c
index 789ca8c02f0c..7951ae1447ee 100644
--- a/arch/arm/mach-omap2/i2c.c
+++ b/arch/arm/mach-omap2/i2c.c
@@ -25,9 +25,7 @@
25 25
26#include "mux.h" 26#include "mux.h"
27 27
28int __init omap_register_i2c_bus(int bus_id, u32 clkrate, 28void __init omap2_i2c_mux_pins(int bus_id)
29 struct i2c_board_info const *info,
30 unsigned len)
31{ 29{
32 if (cpu_is_omap24xx()) { 30 if (cpu_is_omap24xx()) {
33 const int omap24xx_pins[][2] = { 31 const int omap24xx_pins[][2] = {
@@ -51,6 +49,4 @@ int __init omap_register_i2c_bus(int bus_id, u32 clkrate,
51 sprintf(mux_name, "i2c%i_sda.i2c%i_sda", bus_id, bus_id); 49 sprintf(mux_name, "i2c%i_sda.i2c%i_sda", bus_id, bus_id);
52 omap_mux_init_signal(mux_name, OMAP_PIN_INPUT); 50 omap_mux_init_signal(mux_name, OMAP_PIN_INPUT);
53 } 51 }
54
55 return omap_plat_register_i2c_bus(bus_id, clkrate, info, len);
56} 52}
diff --git a/arch/arm/plat-omap/i2c.c b/arch/arm/plat-omap/i2c.c
index 96d2781ac4f5..624e26298faa 100644
--- a/arch/arm/plat-omap/i2c.c
+++ b/arch/arm/plat-omap/i2c.c
@@ -28,6 +28,7 @@
28#include <linux/i2c.h> 28#include <linux/i2c.h>
29#include <mach/irqs.h> 29#include <mach/irqs.h>
30#include <plat/mux.h> 30#include <plat/mux.h>
31#include <plat/i2c.h>
31 32
32#define OMAP_I2C_SIZE 0x3f 33#define OMAP_I2C_SIZE 0x3f
33#define OMAP1_I2C_BASE 0xfffb3800 34#define OMAP1_I2C_BASE 0xfffb3800
@@ -117,6 +118,11 @@ static int __init omap_i2c_add_bus(int bus_id)
117 res[1].start = irq; 118 res[1].start = irq;
118 } 119 }
119 120
121 if (cpu_class_is_omap1())
122 omap1_i2c_mux_pins(bus_id);
123 if (cpu_class_is_omap2())
124 omap2_i2c_mux_pins(bus_id);
125
120 return platform_device_register(pdev); 126 return platform_device_register(pdev);
121} 127}
122 128
@@ -169,7 +175,7 @@ out:
169subsys_initcall(omap_register_i2c_bus_cmdline); 175subsys_initcall(omap_register_i2c_bus_cmdline);
170 176
171/** 177/**
172 * omap_plat_register_i2c_bus - register I2C bus with device descriptors 178 * omap_register_i2c_bus - register I2C bus with device descriptors
173 * @bus_id: bus id counting from number 1 179 * @bus_id: bus id counting from number 1
174 * @clkrate: clock rate of the bus in kHz 180 * @clkrate: clock rate of the bus in kHz
175 * @info: pointer into I2C device descriptor table or NULL 181 * @info: pointer into I2C device descriptor table or NULL
@@ -177,7 +183,7 @@ subsys_initcall(omap_register_i2c_bus_cmdline);
177 * 183 *
178 * Returns 0 on success or an error code. 184 * Returns 0 on success or an error code.
179 */ 185 */
180int __init omap_plat_register_i2c_bus(int bus_id, u32 clkrate, 186int __init omap_register_i2c_bus(int bus_id, u32 clkrate,
181 struct i2c_board_info const *info, 187 struct i2c_board_info const *info,
182 unsigned len) 188 unsigned len)
183{ 189{
diff --git a/arch/arm/plat-omap/include/plat/i2c.h b/arch/arm/plat-omap/include/plat/i2c.h
index 585d9ca68b97..87f6bf2ea4fa 100644
--- a/arch/arm/plat-omap/include/plat/i2c.h
+++ b/arch/arm/plat-omap/include/plat/i2c.h
@@ -34,6 +34,5 @@ static inline int omap_register_i2c_bus(int bus_id, u32 clkrate,
34} 34}
35#endif 35#endif
36 36
37int omap_plat_register_i2c_bus(int bus_id, u32 clkrate, 37void __init omap1_i2c_mux_pins(int bus_id);
38 struct i2c_board_info const *info, 38void __init omap2_i2c_mux_pins(int bus_id);
39 unsigned len);