summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/spi-generic.h24
1 files changed, 7 insertions, 17 deletions
diff --git a/src/include/spi-generic.h b/src/include/spi-generic.h
index b7a14f9342a7..6c62de6d1dd3 100644
--- a/src/include/spi-generic.h
+++ b/src/include/spi-generic.h
@@ -120,27 +120,17 @@ void spi_release_bus(struct spi_slave *slave);
/*-----------------------------------------------------------------------
* SPI transfer
*
- * This writes "bitlen" bits out the SPI MOSI port and simultaneously clocks
- * "bitlen" bits in the SPI MISO port. That's just the way SPI works.
- *
- * The source of the outgoing bits is the "dout" parameter and the
- * destination of the input bits is the "din" parameter. Note that "dout"
- * and "din" can point to the same memory location, in which case the
- * input data overwrites the output data (since both are buffered by
- * temporary variables, this is OK).
- *
* spi_xfer() interface:
* slave: The SPI slave which will be sending/receiving the data.
- * dout: Pointer to a string of bits to send out. The bits are
- * held in a byte array and are sent MSB first.
- * bitsout: How many bits to write.
- * din: Pointer to a string of bits that will be filled in.
- * bitsin: How many bits to read.
+ * dout: Pointer to a string of bytes to send out.
+ * bytesout: How many bytes to write.
+ * din: Pointer to a string of bytes that will be filled in.
+ * bytesin: How many bytes to read.
*
* Returns: 0 on success, not 0 on failure
*/
-int spi_xfer(struct spi_slave *slave, const void *dout, unsigned int bitsout,
- void *din, unsigned int bitsin);
+int spi_xfer(struct spi_slave *slave, const void *dout, unsigned int bytesout,
+ void *din, unsigned int bytesin);
/*-----------------------------------------------------------------------
* Determine if a SPI chipselect is valid.
@@ -196,7 +186,7 @@ static inline int spi_w8r8(struct spi_slave *slave, unsigned char byte)
dout[0] = byte;
dout[1] = 0;
- ret = spi_xfer(slave, dout, 16, din, 16);
+ ret = spi_xfer(slave, dout, 2, din, 2);
return ret < 0 ? ret : din[1];
}