Skip to content

Commit aee67fe

Browse files
dillon-minbroonie
authored andcommitted
spi: flags 'SPI_CONTROLLER_MUST_RX' and 'SPI_CONTROLLER_MUST_TX' can't be coexit with 'SPI_3WIRE' mode
since chip spi driver need get the transfer direction by 'tx_buf' and 'rx_buf' of 'struct spi_transfer' in 'SPI_3WIRE' mode. so, we need bypass 'SPI_CONTROLLER_MUST_RX' and 'SPI_CONTROLLER_MUST_TX' feature in 'SPI_3WIRE' mode Signed-off-by: dillon min <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 61367d0 commit aee67fe

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/spi/spi.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,8 @@ static int spi_map_msg(struct spi_controller *ctlr, struct spi_message *msg)
10231023
void *tmp;
10241024
unsigned int max_tx, max_rx;
10251025

1026-
if (ctlr->flags & (SPI_CONTROLLER_MUST_RX | SPI_CONTROLLER_MUST_TX)) {
1026+
if ((ctlr->flags & (SPI_CONTROLLER_MUST_RX | SPI_CONTROLLER_MUST_TX))
1027+
&& !(msg->spi->mode & SPI_3WIRE)) {
10271028
max_tx = 0;
10281029
max_rx = 0;
10291030

0 commit comments

Comments
 (0)