From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nikita Kiryanov Date: Mon, 04 Aug 2014 15:49:14 +0300 Subject: [U-Boot] [PATCH 05/18] compulab: eeprom: add support for defining eeprom i2c bus In-Reply-To: <201408031548.20247.marex@denx.de> References: <1407051288-17324-1-git-send-email-nikita@compulab.co.il> <1407051288-17324-6-git-send-email-nikita@compulab.co.il> <201408031548.20247.marex@denx.de> Message-ID: <53DF814A.2040203@compulab.co.il> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 >> Cc: Dmitry Lifshitz >> Cc: Tom Rini >> Acked-by: Igor Grinberg >> Acked-by: Dmitry Lifshitz >> Signed-off-by: Nikita Kiryanov >> --- >> 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 >