]> git.baikalelectronics.ru Git - kernel.git/commit
i2c: imx: Add arbitration lost check
authorHaibo Chen <haibo.chen@freescale.com>
Wed, 3 Sep 2014 05:52:07 +0000 (13:52 +0800)
committerWolfram Sang <wsa@the-dreams.de>
Mon, 29 Sep 2014 20:41:18 +0000 (22:41 +0200)
commit6b25e5651d63b2805436063eef84957a93899a77
tree2228ecec63584a220d06028be7f302c75c5750a6
parentb3da0e6d68c501091d79e8cd667d23be5876c3a7
i2c: imx: Add arbitration lost check

According to the i.mx spec, for multimaster mode, if I2C is
enabled when the bus is busy and asserts start, hardware inhibits
the transmission, clears MSTA without signaling a stop, generate
an interrupt, and set I2C_I2SR[IAL] to indicate a failed attempt
to engage the bus, which means arbitration lost. In this case,
we should first test I2C_I2SR[IAL], and clear this bit if it is
set, and then I2C controller default to slave receive mode.

This patch check the IAL bit every time before an I2c transmission.
if IAL is set, clear it and make I2C controller to default mode.

Signed-off-by: Haibo Chen <haibo.chen@freescale.com>
Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-imx.c