mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: Samuel Ortiz <sameo@linux.intel.com>, Lee Jones <lee.jones@linaro.org>
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	Derek Basehore <dbasehore@chromium.org>
Subject: [PATCH 2/3] mfd: cros ec: spi: Increase EC transaction delay
Date: Mon, 18 Nov 2013 11:30:48 +0100	[thread overview]
Message-ID: <1384770649-8593-2-git-send-email-treding@nvidia.com> (raw)
In-Reply-To: <1384770649-8593-1-git-send-email-treding@nvidia.com>

From: Derek Basehore <dbasehore@chromium.org>

50 us is not a long enough delay between EC transactions. At least 70 us
are needed for the 16 MHz STM32L part. Increase the delay to 200 us for
an extra safety margin.

Signed-off-by: Derek Basehore <dbasehore@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/mfd/cros_ec_spi.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/mfd/cros_ec_spi.c b/drivers/mfd/cros_ec_spi.c
index d05349a7381e..af5c2f6601cf 100644
--- a/drivers/mfd/cros_ec_spi.c
+++ b/drivers/mfd/cros_ec_spi.c
@@ -51,10 +51,11 @@
 /*
   * Time between raising the SPI chip select (for the end of a
   * transaction) and dropping it again (for the next transaction).
-  * If we go too fast, the EC will miss the transaction. It seems
-  * that 50us is enough with the 16MHz STM32 EC.
+  * If we go too fast, the EC will miss the transaction. We know that we
+  * need at least 70 us with the 16 MHz STM32 EC, so go with 200 us to be
+  * safe.
   */
-#define EC_SPI_RECOVERY_TIME_NS	(50 * 1000)
+#define EC_SPI_RECOVERY_TIME_NS	(200 * 1000)
 
 /**
  * struct cros_ec_spi - information about a SPI-connected EC
-- 
1.8.4.2


  reply	other threads:[~2013-11-18 10:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-18 10:30 [PATCH 1/3] mfd: cros ec: spi: Add delay for raising CS Thierry Reding
2013-11-18 10:30 ` Thierry Reding [this message]
2013-11-18 10:43   ` [PATCH 2/3] mfd: cros ec: spi: Increase EC transaction delay Lee Jones
2013-11-18 18:55     ` dbasehore .
2013-11-18 19:01       ` Lee Jones
2013-11-18 10:30 ` [PATCH 3/3] mfd: cros ec: spi: Fix debug output Thierry Reding
2013-11-18 10:42   ` Lee Jones
2013-11-18 11:48 ` [PATCH 1/3] mfd: cros ec: spi: Add delay for raising CS Mark Rutland
2013-11-19  8:42   ` Thierry Reding
2013-11-19 17:06     ` Rhyland Klein

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=1384770649-8593-2-git-send-email-treding@nvidia.com \
    --to=thierry.reding@gmail.com \
    --cc=dbasehore@chromium.org \
    --cc=devicetree@vger.kernel.org \
    --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

Powered by JetHome