diff options
author | Wolfgang Denk <wd@denx.de> | 2011-04-28 23:19:18 +0200 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2011-04-28 23:19:18 +0200 |
commit | 34d9cb5ec69ce856c3d241d9416620f721d45892 (patch) | |
tree | bc40c31419773a5a5259bae207ae56ec8edfc4b4 | |
parent | 2fa8ca98c37d5b1bb0328b19ddb7e9d162cd9683 (diff) | |
parent | 4bd5566ee89c906022215dc0064beb0d6c128060 (diff) | |
download | u-boot-imx-34d9cb5ec69ce856c3d241d9416620f721d45892.zip u-boot-imx-34d9cb5ec69ce856c3d241d9416620f721d45892.tar.gz u-boot-imx-34d9cb5ec69ce856c3d241d9416620f721d45892.tar.bz2 |
Merge branch 'master' of git://git.denx.de/u-boot-i2c
-rw-r--r-- | common/cmd_i2c.c | 12 | ||||
-rw-r--r-- | drivers/i2c/soft_i2c.c | 1 | ||||
-rw-r--r-- | include/i2c.h | 2 |
3 files changed, 13 insertions, 2 deletions
diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c index c272b0d..d913e13 100644 --- a/common/cmd_i2c.c +++ b/common/cmd_i2c.c @@ -132,6 +132,14 @@ DECLARE_GLOBAL_DATA_PTR; #define DISP_LINE_LEN 16 +/* implement possible board specific board init */ +void __def_i2c_init_board(void) +{ + return; +} +void i2c_init_board(void) + __attribute__((weak, alias("__def_i2c_init_board"))); + /* TODO: Implement architecture-specific get/set functions */ unsigned int __def_i2c_get_bus_speed(void) { @@ -1541,6 +1549,8 @@ int i2x_mux_select_mux(int bus) mux = dev->mux; while (mux != NULL) { + /* do deblocking on each level of mux, before mux config */ + i2c_init_board(); if (i2c_write(mux->chip, 0, 0, &mux->channel, 1) != 0) { printf ("Error setting Mux: chip:%x channel: \ %x\n", mux->chip, mux->channel); @@ -1548,6 +1558,8 @@ int i2x_mux_select_mux(int bus) } mux = mux->next; } + /* do deblocking on each level of mux and after mux config */ + i2c_init_board(); return 0; } #endif /* CONFIG_I2C_MUX */ diff --git a/drivers/i2c/soft_i2c.c b/drivers/i2c/soft_i2c.c index 69b5f42..9b02e89 100644 --- a/drivers/i2c/soft_i2c.c +++ b/drivers/i2c/soft_i2c.c @@ -286,6 +286,7 @@ int i2c_set_bus_num(unsigned int bus) int ret; ret = i2x_mux_select_mux(bus); + i2c_init_board(); if (ret == 0) i2c_bus_num = bus; else diff --git a/include/i2c.h b/include/i2c.h index cd23c8a..8ceb4c8 100644 --- a/include/i2c.h +++ b/include/i2c.h @@ -108,9 +108,7 @@ * repeatedly to change the speed and slave addresses. */ void i2c_init(int speed, int slaveaddr); -#ifdef CONFIG_SYS_I2C_INIT_BOARD void i2c_init_board(void); -#endif #ifdef CONFIG_SYS_I2C_BOARD_LATE_INIT void i2c_board_late_init(void); #endif |