summaryrefslogtreecommitdiff
path: root/include/spi.h
diff options
context:
space:
mode:
authorVic Yang <victoryang@chromium.org>2014-06-19 14:00:32 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-06-26 06:48:37 +0000
commitae15dc8ce512d58c7c7757ebfd12c3ca76eb4a08 (patch)
treeb798712447eeb1b752557df2832dc806e5374a65 /include/spi.h
parent9ccfd4553e708a5df4be3aa18b97c75da3f6c1b9 (diff)
downloadchrome-ec-ae15dc8ce512d58c7c7757ebfd12c3ca76eb4a08.tar.gz
mec1322: Add SPI master driver
This allows us to use the two SPI ports as SPI master. Also, to save CPU time on reading large amount of data, let's add an async interface for SPI transaction. BUG=chrome-os-partner:29805 TEST=Read manufacturer ID from SPI flash with sync/async interface BRANCH=None Change-Id: I427f4215602cccc55c4151f4116226b1e0ccc15e Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/204719
Diffstat (limited to 'include/spi.h')
-rw-r--r--include/spi.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/spi.h b/include/spi.h
index a03e04f134..f8f916213b 100644
--- a/include/spi.h
+++ b/include/spi.h
@@ -19,6 +19,16 @@ int spi_enable(int enable);
int spi_transaction(const uint8_t *txdata, int txlen,
uint8_t *rxdata, int rxlen);
+/* Similar to spi_transaction(), but hands over to DMA for reading response.
+ * Must call spi_transaction_flush() after this to make sure the response is
+ * received.
+ */
+int spi_transaction_async(const uint8_t *txdata, int txlen,
+ uint8_t *rxdata, int rxlen);
+
+/* Wait for async response received */
+int spi_transaction_flush(void);
+
#ifdef CONFIG_SPI
/**
* Called when the NSS level changes, signalling the start or end of a SPI