Skip to contentSkip to conversation

fsl_i2c: Added a callpoint for i2c_board_late_init

PATCH New Richard Retanubun 1 participant 1 message Apr 12, 2010 I2C

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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(-)
drivers/i2c/fsl_i2c.c +8 -0
index 2241990..a1a62fa 100644
@@ -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
Signature · 1 line
1.7.0