On 03/08/14 16:48, Marek Vasut wrote:
On Sunday, August 03, 2014 at 09:34:35 AM, Nikita Kiryanov wrote:
Create CONFIG_SYS_I2C_EEPROM_BUS #define to tell the EEPROM
module what I2C bus the EEPROM is located at. Make cl_eeprom_read()
switch to that bus when reading EEPROM.
Cc: Igor Grinberg <grinb...@compulab.co.il>
Cc: Dmitry Lifshitz <lifsh...@compulab.co.il>
Cc: Tom Rini <tr...@ti.com>
Acked-by: Igor Grinberg <grinb...@compulab.co.il>
Acked-by: Dmitry Lifshitz <lifsh...@compulab.co.il>
Signed-off-by: Nikita Kiryanov <nik...@compulab.co.il>
---
board/compulab/common/eeprom.c | 10 +++++++++-
include/configs/cm_t335.h | 1 +
include/configs/cm_t35.h | 1 +
include/configs/cm_t54.h | 1 +
4 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/board/compulab/common/eeprom.c
b/board/compulab/common/eeprom.c index 20fe3e1..b5c1c2a 100644
--- a/board/compulab/common/eeprom.c
+++ b/board/compulab/common/eeprom.c
@@ -31,8 +31,16 @@ 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();
+
+ i2c_set_bus_num(CONFIG_SYS_I2C_EEPROM_BUS);
Please handle the return value of this function too.
Will do..
[...]
BR,MV
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot