diff options
author | Albert ARIBAUD <albert.u.boot@aribaud.net> | 2014-09-17 23:35:34 +0200 |
---|---|---|
committer | Albert ARIBAUD <albert.u.boot@aribaud.net> | 2014-09-17 23:35:34 +0200 |
commit | c292adae170fa8c27dca75963bdb0a9afc640e57 (patch) | |
tree | 3c1e6bddf7b2b6c6bb92a6329714db0850d05702 /board/compulab/common/eeprom.c | |
parent | a7f99bf139b3aaa0d5494693fd0395084355e41a (diff) | |
parent | 4c97f16911e229f6d5bbea5bee52449916e5fa92 (diff) |
Merge branch 'u-boot-imx/master' into 'u-boot-arm/master'
Diffstat (limited to 'board/compulab/common/eeprom.c')
-rw-r--r-- | board/compulab/common/eeprom.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/board/compulab/common/eeprom.c b/board/compulab/common/eeprom.c index 20fe3e1960..85442cd103 100644 --- a/board/compulab/common/eeprom.c +++ b/board/compulab/common/eeprom.c @@ -31,8 +31,19 @@ static int cl_eeprom_layout; /* Implicitly LAYOUT_INVALID */ static int cl_eeprom_read(uint offset, uchar *buf, int len) { - return i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, offset, + int res; + unsigned int current_i2c_bus = i2c_get_bus_num(); + + res = i2c_set_bus_num(CONFIG_SYS_I2C_EEPROM_BUS); + if (res < 0) + return res; + + res = i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, offset, CONFIG_SYS_I2C_EEPROM_ADDR_LEN, buf, len); + + i2c_set_bus_num(current_i2c_bus); + + return res; } static int cl_eeprom_setup_layout(void) |