From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Warren Date: Sat, 06 Feb 2010 22:32:05 -0800 Subject: [U-Boot] TI:OMAP: [PATCH 2/7] Enable I2C bus switching In-Reply-To: <4B6D1A7D.3030408@googlemail.com> References: <4B5B8EC1.2020509@windriver.com> <4B6D1A7D.3030408@googlemail.com> Message-ID: <4B6E5E65.3010707@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dirk, On 2/5/2010 11:30 PM, Dirk Behme wrote: > On 24.01.2010 01:05, Tom wrote: > >> Khasim Syed Mohammed wrote: >> >>> From 9bb1c3501c8f098dac6e224c99e409ebf92b0ab9 Mon Sep 17 00:00:00 2001 >>> From: Syed Mohammed Khasim >>> Date: Mon, 18 Jan 2010 18:11:14 +0530 >>> Subject: [PATCH] Enable I2C bus switching >>> >>> OMAP3 supports Multiple I2C channels, this patch allows >>> us to use i2c dev command to switch between busses. >>> >>> Signed-off-by: Syed Mohammed Khasim >>> Acked-by: Heiko Schocher >>> --- >>> drivers/i2c/omap24xx_i2c.c | 5 +++++ >>> include/configs/omap3_beagle.h | 6 ++++++ >>> 2 files changed, 11 insertions(+), 0 deletions(-) >>> >>> diff --git a/drivers/i2c/omap24xx_i2c.c b/drivers/i2c/omap24xx_i2c.c >>> index ff18991..e8c8184 100644 >>> --- a/drivers/i2c/omap24xx_i2c.c >>> +++ b/drivers/i2c/omap24xx_i2c.c >>> @@ -435,3 +435,8 @@ int i2c_set_bus_num(unsigned int bus) >>> >>> return 0; >>> } >>> + >>> +int i2c_get_bus_num(void) >>> +{ >>> + return (int) current_bus; >>> +} >>> diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h >>> index a8abb0e..4d516a4 100644 >>> --- a/include/configs/omap3_beagle.h >>> +++ b/include/configs/omap3_beagle.h >>> @@ -100,6 +100,12 @@ >>> /* DDR - I use Micron DDR */ >>> #define CONFIG_OMAP3_MICRON_DDR 1 >>> >>> +/* Enable Multi Bus support for I2C */ >>> +#define CONFIG_I2C_MULTI_BUS 1 >>> + >>> +/* Probe all devices */ >>> +#define CONFIG_SYS_I2C_NOPROBES {0x0, 0x0} >>> >> Most/All of the configs I reviewed set the addr element >> to a valid address. I do not believe 0 is a valid address >> on omap. If the intent is a double negative >> {0, 0} == probe all >> Then add a comment. >> > I would fix this, but I have no idea what to add :( Any hint? > > CONFIG_SYS_I2C_NOPROBES doesn't have to be defined. It's there as a convenience in case there are devices that you don't want to be included when probing the bus. If there's nothing you want to skip, don't define it. > Dirk > _____ > regards, Ben