summaryrefslogtreecommitdiff
path: root/include/spi.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/spi.h')
-rw-r--r--include/spi.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/include/spi.h b/include/spi.h
index 320e50e529..01c9bb4a39 100644
--- a/include/spi.h
+++ b/include/spi.h
@@ -2,6 +2,8 @@
* (C) Copyright 2001
* Gerald Van Baren, Custom IDEAS, vanbaren@cideas.com.
*
+ * Copyright(c) 2009 Freescale Semiconductor, Inc
+ *
* See file CREDITS for list of people who contributed to this
* project.
*
@@ -50,16 +52,38 @@
#define SPI_XFER_END 0x02 /* Deassert CS after transfer */
/*-----------------------------------------------------------------------
+ * Representation of a eSPI transaction, which is always embeded in
+ * structure spi_slave.
+ *
+ * cmd_len: Length of the command.
+ * data_len: Length of the transmit/receive data.
+ * tx_buf: Buffer to store the transmit command and data.
+ * rx_buf: Buffer to store the receive data.
+ * flags: Flags to indicate the begin/end of the transfer.
+ */
+struct espi_transfer {
+ unsigned int cmd_len;
+ unsigned int data_len;
+ const void *tx_buf;
+ void *rx_buf;
+
+ unsigned long flags;
+};
+
+/*-----------------------------------------------------------------------
* Representation of a SPI slave, i.e. what we're communicating with.
*
* Drivers are expected to extend this with controller-specific data.
*
* bus: ID of the bus that the slave is attached to.
* cs: ID of the chip select connected to the slave.
+ * transfer: Represent an eSPI transaction.
*/
struct spi_slave {
unsigned int bus;
unsigned int cs;
+
+ struct espi_transfer *transfer;
};
/*-----------------------------------------------------------------------
@@ -148,6 +172,14 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout,
void *din, unsigned long flags);
/*-----------------------------------------------------------------------
+ * eSPI transfer
+ *
+ * Returns: 0 on success, not 0 on failure
+ */
+int espi_xfer(struct spi_slave *slave);
+
+
+/*-----------------------------------------------------------------------
* Determine if a SPI chipselect is valid.
* This function is provided by the board if the low-level SPI driver
* needs it to determine if a given chipselect is actually valid.