[PATCH] overo: Add early i2c_init

9 views
Skip to first unread message

Steve Sakoman

unread,
Sep 16, 2011, 4:02:22 PM9/16/11
to x-lo...@googlegroups.com
In order to properly determine board revision on early boards it is
necessary to do a few i2c transactions prior to the normal i2c_init.

This patch adds an early call to i2c_init.

Signed-off-by: Steve Sakoman <st...@sakoman.com>
---

diff --git a/board/overo/overo.c b/board/overo/overo.c
index b2c536a..6bc94f6 100644
--- a/board/overo/overo.c
+++ b/board/overo/overo.c
@@ -356,11 +356,14 @@ int get_board_revision(void)
/* board revisions <= R2410 connect 4030 irq_1 to gpio112 */
/* these boards should return a revision number of 0 */
/* the code below forces a 4030 RTC irq to ensure that gpio112 is low */
+#ifdef CONFIG_DRIVER_OMAP34XX_I2C
+ i2c_init(CFG_I2C_SPEED, CFG_I2C_SLAVE);
data = 0x01;
i2c_write(0x4B, 0x29, 1, &data, 1);
data = 0x0c;
i2c_write(0x4B, 0x2b, 1, &data, 1);
i2c_read(0x4B, 0x2a, 1, &data, 1);
+#endif

if (!omap_request_gpio(112) &&
!omap_request_gpio(113) &&

Reply all
Reply to author
Forward
0 new messages