From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Schocher Date: Wed, 14 Apr 2010 09:02:43 +0200 Subject: [U-Boot] [PATCH]fsl_i2c: Add i2c_board_late_init In-Reply-To: <20100412192811.99C9019F60@gemini.denx.de> References: <4BBF6266.8040508@RuggedCom.com> <4BC2B9A5.70001@denx.de> <20100412180215.GA11973@richardretanubun.eng.lan> <20100412181750.9581F19F60@gemini.denx.de> <4BC364D1.8020306@RuggedCom.com> <20100412183803.13E9219F60@gemini.denx.de> <20100412191703.GA30835@richardretanubun.eng.lan> <20100412192811.99C9019F60@gemini.denx.de> Message-ID: <4BC56893.5090008@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 Wolfgang, Richard, Wolfgang Denk wrote: > Dear richardretanubun at ruggedcom.com, > > In message <20100412191703.GA30835@richardretanubun.eng.lan> you wrote: >> From d0d9e0df99ce9035db43ebcf9d48601fa6f096d4 Mon Sep 17 00:00:00 2001 >> From: Richard Retanubun >> Date: Mon, 12 Apr 2010 15:08:17 -0400 >> Subject: [PATCH] fsl_i2c: Added a callpoint for i2c_board_late_init >> >> This patch adds a callpoint in i2c_init that allows board specific >> i2c board initialization (typically for i2c bus reset) that is called >> after i2c_init operations, allowing the i2c_board_late_init function >> to use the pre-configured i2c bus speed and slave address. >> --- >> >> Hi Wolfgang & Heiko, >> >> This is the patch that adds another callpoint. Thanks for >> all the feedback. >> >> - Richard >> >> drivers/i2c/fsl_i2c.c | 8 ++++++++ >> 1 files changed, 8 insertions(+), 0 deletions(-) >> >> diff --git a/drivers/i2c/fsl_i2c.c b/drivers/i2c/fsl_i2c.c >> index 2241990..a1a62fa 100644 >> --- a/drivers/i2c/fsl_i2c.c >> +++ b/drivers/i2c/fsl_i2c.c >> @@ -249,6 +249,14 @@ i2c_init(int speed, int slaveadd) >> writeb(0x0, &dev->sr); /* clear status register */ >> writeb(I2C_CR_MEN, &dev->cr); /* start I2C controller */ >> #endif >> + >> +#ifdef CONFIG_SYS_I2C_BOARD_LATE_INIT >> + /* Call board specific i2c bus reset routine after the bus has been */ >> + /* initialized. Use either this callpoint or i2c_init_board; which is */ >> + /* called before i2c_init operations. */ >> + /* For details about this problem see doc/I2C_Edge_Conditions. */ >> + i2c_board_late_init(); >> +#endif > > Incorrect multiline comment style. Yep, Richard please fix this. Also it would be nice to have an entry in the README for your new callpoint. > Instead of adding more #ifdef'ery we now tend to use weak symbols - > but I'm not sure about this here in this context, though. Heiko, what > do you think about this? I would prefer here the define version, but common uboot style is, as you said, using weak symbols ... If using here weak symbols, I vote for changing the "#ifdef CONFIG_SYS_I2C_INIT_BOARD" case also to weak. Thanks. bye Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany