]> git.karo-electronics.de Git - karo-tx-linux.git/commit
i2c: imx: fix the i2c bus hang issue when do repeat restart
authorFugang Duan <B38611@freescale.com>
Wed, 30 Apr 2014 06:24:58 +0000 (14:24 +0800)
committerNitin Garg <nitin.garg@freescale.com>
Fri, 16 Jan 2015 03:17:03 +0000 (21:17 -0600)
commita72cdc63c139f5d04f98e6a448626dcb3c140a9d
tree06e1cfe9bae1dd46992554d15a7b9ec91663546d
parent1d89b5a554c4b61ea1506f43a644b0e8f7d25c86
i2c: imx: fix the i2c bus hang issue when do repeat restart

Test i2c device Maxim max44009, datasheet is located at:
http://www.maximintegrated.com/datasheet/index.mvp/id/7175

The max44009 support repeat operation like:
read -> repeat restart -> read/write

The current i2c imx host controller driver don't support this
operation that causes i2c bus hang due to "MTX" is cleared in
.i2c_imx_read(). If "read" is the last message there have no problem,
so the current driver supports all SMbus operation like:
write -> repeat restart -> read/write

IMX i2c controller for master receiver has some limitation:
- If it is the last byte for one operation, it must generate STOP
  signal before read I2DR to prevent controller from generating another
  clock cycle.
- If it is the last byte in the read, and then do repeat restart, it must
  set "MTX" before read I2DR to prevent controller from generating another
  extra clock cycle.

The patch is to fix the issue.

Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
(cherry picked from commit 054b62d9f25c903958749e4cea25261324a7a2a4)

Signed-off-by: haibo.chen <haibo.chen@freescale.com>
drivers/i2c/busses/i2c-imx.c