summaryrefslogtreecommitdiff
path: root/drivers/i2c/mxc_i2c.c
diff options
context:
space:
mode:
authorHaibo Chen <haibo.chen@freescale.com>2015-02-11 16:14:26 +0800
committerHaibo Chen <haibo.chen@freescale.com>2015-03-05 11:28:30 +0800
commit6baaad39acc031cdb93a5e5a68a26c3fbc25c88f (patch)
tree0ef215ecd095d723666618404b7f182e723ccc7a /drivers/i2c/mxc_i2c.c
parentb68f4a1fc442b11b526c6eea0fba0c80819bca87 (diff)
downloadu-boot-imx-6baaad39acc031cdb93a5e5a68a26c3fbc25c88f.zip
u-boot-imx-6baaad39acc031cdb93a5e5a68a26c3fbc25c88f.tar.gz
u-boot-imx-6baaad39acc031cdb93a5e5a68a26c3fbc25c88f.tar.bz2
MLK-10215 Add elan init in i.MX6SL-EVK boardl5.0.0_1.0.0-beta
EPDC board contain a elan touch screen, this screen is a i2c slave. If this EPDC board connect to i.MX6SL-EVK board, after uboot boot up, if we do i2c operation, like i2c probe, then the i2c bus block. This is due to the elan touch screen i2c slave. This device needs to do some initialization opearation before its i2c operation, otherwise this i2c device pull down the i2c clk line, and make the i2c bus hang. This means elan needs a special flow on i2c before its address is acked, otherwise the i2c bus will be hang. This patch is a workaround, it add a void function which is defined as a weak symbol in i2c driver, and it is called before every i2c operation. In mx6slevk, this function was overwrite to execute elan initialization. So that, for mx6slevk board, it will initialize elan before every i2c operation, but for other boards, it just work as before. Signed-off-by: Haibo Chen <haibo.chen@freescale.com>
Diffstat (limited to 'drivers/i2c/mxc_i2c.c')
-rw-r--r--drivers/i2c/mxc_i2c.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c
index 595019b..9334838 100644
--- a/drivers/i2c/mxc_i2c.c
+++ b/drivers/i2c/mxc_i2c.c
@@ -238,6 +238,17 @@ static void i2c_imx_stop(struct mxc_i2c_regs *i2c_regs)
}
/*
+ * Stub implementations for outer i2c slave operations
+ * Any board has special requirement (i.mx6slevk) can
+ * overwrite the function
+ */
+void __i2c_force_reset_slave(void)
+{
+}
+void i2c_force_reset_slave(void)
+ __attribute__((weak, alias("__i2c_force_reset_slave")));
+
+/*
* Send start signal, chip address and
* write register address
*/
@@ -247,6 +258,9 @@ static int i2c_init_transfer_(struct mxc_i2c_regs *i2c_regs,
unsigned int temp;
int ret;
+ /* Reset i2c slave */
+ i2c_force_reset_slave();
+
/* Enable I2C controller */
#ifdef I2C_QUIRK_REG
if (readb(&i2c_regs->i2cr) & I2CR_IDIS) {