From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Schocher Date: Thu, 06 Sep 2012 05:49:14 +0200 Subject: [U-Boot] [PATCH v4 1/2] i2c:soft:multi: Support for multiple soft I2C buses at Samsung boards In-Reply-To: <1346836521-15269-2-git-send-email-l.majewski@samsung.com> References: <1346142797-17645-1-git-send-email-l.majewski@samsung.com> <1346836521-15269-1-git-send-email-l.majewski@samsung.com> <1346836521-15269-2-git-send-email-l.majewski@samsung.com> Message-ID: <50481D3A.7070001@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Lukasz, On 05.09.2012 11:15, Lukasz Majewski wrote: > Support for multiple soft I2C buses. > > Multibus I2C support is achieved by defining get_multi_{sda|scl}_pin > functions to switch between multiple "soft" I2C buses. > > Common definition of I2C_X I2C buses is provided at. > > TEST HW: > Samsung's Exynos4210 evt.0.1 - Trats development board > > Signed-off-by: Lukasz Majewski > Signed-off-by: Kyungmin Park > Cc: Heiko Schocher > Cc: Minkyu Kang > > --- > Changes for v2: > - Common Samsung code has been put to board/samsung/common/multi_i2c.c file > - I2C_{4|5} have been renamed to I2C_{0|1} > - *soft_i2c_name[] table has been removed > Changes for v3: > - None > Changes for v4: > - Common definitions of available I2C buses are now defined at > - Compatibility layer (I2C_0) has been added temporarily to not break the Trats > I2C communication with PMIC. It will be removed when redesigned PMIC will be > posted > --- > board/samsung/common/Makefile | 43 +++++++++++++++++++++++++ > board/samsung/common/multi_i2c.c | 65 ++++++++++++++++++++++++++++++++++++++ > include/i2c.h | 12 +++++++ > 3 files changed, 120 insertions(+), 0 deletions(-) > create mode 100644 board/samsung/common/Makefile > create mode 100644 board/samsung/common/multi_i2c.c > [...] > +######################################################################### > diff --git a/board/samsung/common/multi_i2c.c b/board/samsung/common/multi_i2c.c > new file mode 100644 > index 0000000..d6c3d37 > --- /dev/null > +++ b/board/samsung/common/multi_i2c.c > @@ -0,0 +1,65 @@ [...] > +/* Handle multiple I2C buses instances */ > +int get_multi_scl_pin(void) > +{ > + unsigned int bus = I2C_GET_BUS(); > + > + switch (bus) { > + case I2C_0: /* I2C_0 definition - compatibility layer */ > + case I2C_5: Is this correct, that you want to use 2 i2c busses on the same pin? Beside of that, you get my: Acked-by: Heiko Schocher bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany