>From de1623005ece04af9082f397759fe92cbae84211 Mon Sep 17 00:00:00 2001 From: Richard Retanubun <richardretanu...@ruggedcom.com> 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. --- v2: Adds missing function prototype declaration in include/i2c.h drivers/i2c/fsl_i2c.c | 8 ++++++++ include/i2c.h | 3 +++ 2 files changed, 11 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 } static int diff --git a/include/i2c.h b/include/i2c.h index d828964..cd23c8a 100644 --- a/include/i2c.h +++ b/include/i2c.h @@ -111,6 +111,9 @@ void i2c_init(int speed, int slaveaddr); #ifdef CONFIG_SYS_I2C_INIT_BOARD void i2c_init_board(void); #endif +#ifdef CONFIG_SYS_I2C_BOARD_LATE_INIT +void i2c_board_late_init(void); +#endif #if defined(CONFIG_I2C_MUX) -- 1.7.0 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot