X-Git-Url: https://git.kernelconcepts.de/?a=blobdiff_plain;f=common%2Fcmd_i2c.c;h=3ea75f75fd45bf512fe31b6577332332ff67b982;hb=e4bf0c5cfe1d7b2059a6802c9e11d567c928dbb1;hp=c272b0dd4f7dda1782c2abe8b24cff299e0f99ee;hpb=d963e84c92a63b4e6c4f2f80482a5ecbe9b24fe0;p=karo-tx-uboot.git diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c index c272b0dd4f..3ea75f75fd 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) { @@ -1389,8 +1397,8 @@ static int i2c_mux_get_busid (void) return tmp; } -/* Analyses a Muxstring and sends immediately the - Commands to the Muxes. Runs from Flash. +/* Analyses a Muxstring and immediately sends the + commands to the muxes. Runs from flash. */ int i2c_mux_ident_muxstring_f (uchar *buf) { @@ -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 */