]> git.baikalelectronics.ru Git - kernel.git/commit
i2c: mpc: insert DR read in i2c_fixup()
authorValentin Longchamp <valentin.longchamp@keymile.com>
Tue, 3 Jun 2014 09:00:32 +0000 (11:00 +0200)
committerWolfram Sang <wsa@the-dreams.de>
Tue, 3 Jun 2014 12:24:16 +0000 (14:24 +0200)
commit2d7299fdcfe4dcd640f2427183f4ec12bd2d2ebd
treea9ef8c8a94e6fac4785751d50855b4058b313c8d
parentdc85ad955ae222fb346af80a7dc73b76d2a6a686
i2c: mpc: insert DR read in i2c_fixup()

The mpc_i2c_fixup function is called when the bus is not released by a
slave. The function generates 9 pulses that should lead the slave
to release the bus.

The sequence that generates the pulses disables/enables the I2C module
that controls the blocked bus. We have found out on the P2041 SoC that
this could cause the CPU to hang (for a short delay).

To avoid this, this patch introduces a read to the I2CDR register
between the re-enablement of the I2C module in master mode and its
returning to the slave mode instead of the delay (the final delay,
between the pulses is kept), as proposed in procedure from the P2041
reference manual (16.6.2.3), and the other manuals from the mpc83xx and
mpc85xx families.

Signed-off-by: Rainer Boschung <rainer.boschung@keymile.com>
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-mpc.c