diff options
author | Rui Miguel Silva <rui.silva@linaro.org> | 2015-12-02 11:12:27 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2015-12-02 17:04:58 -0800 |
commit | b455c84655d5bdfc5157d2100279e3ff2454b596 (patch) | |
tree | 88ca8d32b1202c79400a9eb06569e9f61424f33b /drivers/staging/greybus/spi.c | |
parent | 3e48acac26c8b5321ff5b752c8650e1cf4d04344 (diff) | |
download | linux-b455c84655d5bdfc5157d2100279e3ff2454b596.tar.bz2 |
greybus: spi: add rdwr field to transfer descriptor
Add read and/or write field to transfer descriptor to make it possible
to identify the type of transfer.
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/spi.c')
-rw-r--r-- | drivers/staging/greybus/spi.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/staging/greybus/spi.c b/drivers/staging/greybus/spi.c index 33e86f9c3182..1b9c97336451 100644 --- a/drivers/staging/greybus/spi.c +++ b/drivers/staging/greybus/spi.c @@ -107,13 +107,16 @@ gb_spi_operation_create(struct gb_connection *connection, gb_xfer->delay_usecs = cpu_to_le16(xfer->delay_usecs); gb_xfer->cs_change = xfer->cs_change; gb_xfer->bits_per_word = xfer->bits_per_word; - gb_xfer++; /* Copy tx data */ if (xfer->tx_buf) { memcpy(tx_data, xfer->tx_buf, xfer->len); tx_data += xfer->len; + gb_xfer->rdwr |= GB_SPI_XFER_WRITE; } + if (xfer->rx_buf) + gb_xfer->rdwr |= GB_SPI_XFER_READ; + gb_xfer++; } return operation; |