mfd: cros ec: spi: Increase EC transaction delay
authorDerek Basehore <dbasehore@chromium.org>
Mon, 18 Nov 2013 10:30:48 +0000 (11:30 +0100)
committerLee Jones <lee.jones@linaro.org>
Mon, 6 Jan 2014 09:13:23 +0000 (09:13 +0000)
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.

Reviewed-by: Randall Spangler <rspangler@chromium.org>
Signed-off-by: Derek Basehore <dbasehore@chromium.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/cros_ec_spi.c

index 367ccb58ecb15a1954cf39e936c46bc5a4bf3498..ab49fe51a5d1be52ad3e9aae39d12def1c40852d 100644 (file)
 /*
   * 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