summaryrefslogtreecommitdiffstats
path: root/src/drivers/bitbash
diff options
context:
space:
mode:
authorMichael Brown2006-12-04 17:09:59 +0100
committerMichael Brown2006-12-04 17:09:59 +0100
commitdc06c895fc089bcb9c050b2fb64494213f61e896 (patch)
treed9f466956be3aaacf03eab76c3e097728172f506 /src/drivers/bitbash
parentGeneralised the SPI abstraction layer to also be able to handle interfaces (diff)
downloadipxe-dc06c895fc089bcb9c050b2fb64494213f61e896.tar.gz
ipxe-dc06c895fc089bcb9c050b2fb64494213f61e896.tar.xz
ipxe-dc06c895fc089bcb9c050b2fb64494213f61e896.zip
Changed length parameter in SPI methods to be a byte length, rather than
a word length.
Diffstat (limited to 'src/drivers/bitbash')
-rw-r--r--src/drivers/bitbash/spi_bit.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/drivers/bitbash/spi_bit.c b/src/drivers/bitbash/spi_bit.c
index 462fd72e..ef1d8ff7 100644
--- a/src/drivers/bitbash/spi_bit.c
+++ b/src/drivers/bitbash/spi_bit.c
@@ -139,13 +139,12 @@ static void spi_bit_transfer ( struct spi_bit_basher *spibit,
* @v address Address to read/write (<0 for no address)
* @v data_out TX data buffer (or NULL)
* @v data_in RX data buffer (or NULL)
- * @v len Length of transfer (in @b words)
+ * @v len Length of transfer
* @ret rc Return status code
*/
static int spi_bit_rw ( struct spi_bus *bus, struct spi_device *device,
unsigned int command, int address,
- const void *data_out, void *data_in,
- unsigned int len ) {
+ const void *data_out, void *data_in, size_t len ) {
struct spi_bit_basher *spibit
= container_of ( bus, struct spi_bit_basher, bus );
struct spi_device_type *devtype = device->type;
@@ -167,8 +166,7 @@ static int spi_bit_rw ( struct spi_bus *bus, struct spi_device *device,
}
/* Transmit/receive data */
- spi_bit_transfer ( spibit, data_out, data_in,
- ( len * devtype->word_len ) );
+ spi_bit_transfer ( spibit, data_out, data_in, ( len * 8 ) );
/* Deassert chip select on specified slave */
spi_bit_set_slave_select ( spibit, device->slave, DESELECT_SLAVE );