Commit be1c770028b832945680ebf5c0d49b831ba719d5

Authored by Arnout Vandecappelle (Essensium/Mind)
Committed by Lee Jones
1 parent dfa52c852d

mfd: tps65910: Work around silicon erratum SWCZ010

http://www.ti.com/lit/pdf/SWCZ010:
  Glitch on SDA-SCL not managed correctly by the I2C IP

Impact:
The standard specifies that the I2C transfer should restart on a start
event in all cases. The current design does not support two consecutive
Start conditions. This can cause the first real access after such a
glitch to be corrupted.

Description:
An unexpected glitch on SDA and SCL can generate a wrong start event.
In the current design, the SCL line must toggle two times to detect a
new start event and completely restart the I2C access; hence the real
start event is not detected in the case of a single SCL toggle.

Workaround:
Repeat I2C access.

A simpler workaround is to make a dummy transfer just before the first
access to the tps65910 chip. This can be done unconditionally.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

Showing 1 changed file with 5 additions and 0 deletions Side-by-side Diff

drivers/mfd/tps65910.c
... ... @@ -486,6 +486,11 @@
486 486 tps65910->i2c_client = i2c;
487 487 tps65910->id = chip_id;
488 488  
  489 + /* Work around silicon erratum SWCZ010: the tps65910 may miss the
  490 + * first I2C transfer. So issue a dummy transfer before the first
  491 + * real transfer.
  492 + */
  493 + i2c_master_send(i2c, "", 1);
489 494 tps65910->regmap = devm_regmap_init_i2c(i2c, &tps65910_regmap_config);
490 495 if (IS_ERR(tps65910->regmap)) {
491 496 ret = PTR_ERR(tps65910->regmap);