linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Arnout Vandecappelle (Essensium/Mind)" <arnout@mind.be>
To: Samuel Ortiz <sameo@linux.intel.com>,
	Lee Jones <lee.jones@linaro.org>, Mark Brown <broonie@kernel.org>,
	linux-kernel@vger.kernel.org
Cc: Laxman Dewangan <ldewangan@nvidia.com>,
	David Brown <davidb@codeaurora.org>,
	"Arnout Vandecappelle (Essensium/Mind)" <arnout@mind.be>
Subject: [PATCH v2] tps65910: Work around silicon erratum SWCZ010
Date: Fri, 22 Aug 2014 17:30:56 +0200	[thread overview]
Message-ID: <1408721456-8101-1-git-send-email-arnout@mind.be> (raw)
In-Reply-To: <1408709666-5927-1-git-send-email-arnout@mind.be>

>From 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>
---
This patch is based on v3.17-rc1.
Build-tested with omap2plus_defconfig.
Runtime tested based on v3.4.97 with a custom config.

v2: use dummy transfer instead of retrying (Laxman Dewangan)
---
 drivers/mfd/tps65910.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c
index f243e75..7612d89 100644
--- a/drivers/mfd/tps65910.c
+++ b/drivers/mfd/tps65910.c
@@ -486,6 +486,11 @@ static int tps65910_i2c_probe(struct i2c_client *i2c,
 	tps65910->i2c_client = i2c;
 	tps65910->id = chip_id;
 
+	/* Work around silicon erratum SWCZ010: the tps65910 may miss the
+	 * first I2C transfer. So issue a dummy transfer before the first
+	 * real transfer.
+	 */
+	i2c_master_send(i2c, "", 1);
 	tps65910->regmap = devm_regmap_init_i2c(i2c, &tps65910_regmap_config);
 	if (IS_ERR(tps65910->regmap)) {
 		ret = PTR_ERR(tps65910->regmap);
-- 
2.1.0


  parent reply	other threads:[~2014-08-22 19:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-22 12:14 [PATCH] tps65910: Work around silicon erratum SWCZ010 Arnout Vandecappelle (Essensium/Mind)
2014-08-22 13:46 ` Laxman Dewangan
2014-08-22 14:01   ` Arnout Vandecappelle
2014-08-22 15:30 ` Arnout Vandecappelle (Essensium/Mind) [this message]
2014-08-22 21:12   ` [PATCH v2] " Mark Brown
2014-08-26  9:25     ` Lee Jones
2014-08-26  9:46       ` Mark Brown
2014-08-26 10:07         ` Arnout Vandecappelle
2014-08-26 10:14   ` Laxman Dewangan
2014-08-26 16:21     ` Arnout Vandecappelle
2014-08-29  7:31   ` Lee Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1408721456-8101-1-git-send-email-arnout@mind.be \
    --to=arnout@mind.be \
    --cc=broonie@kernel.org \
    --cc=davidb@codeaurora.org \
    --cc=ldewangan@nvidia.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sameo@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).