Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6935224d authored by Martin Sperl's avatar Martin Sperl Committed by Mark Brown
Browse files

spi: bcm2835: enable support of 3-wire mode

parent 210b4923
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -67,7 +67,8 @@
#define BCM2835_SPI_CS_CS_01		0x00000001

#define BCM2835_SPI_TIMEOUT_MS	30000
#define BCM2835_SPI_MODE_BITS	(SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_NO_CS)
#define BCM2835_SPI_MODE_BITS	(SPI_CPOL | SPI_CPHA | SPI_CS_HIGH \
				| SPI_NO_CS | SPI_3WIRE)

#define DRV_NAME	"spi-bcm2835"

@@ -163,6 +164,9 @@ static int bcm2835_spi_start_transfer(struct spi_device *spi,
		cdiv = 0; /* 0 is the slowest we can go */
	}

	if ((spi->mode & SPI_3WIRE) && (tfr->rx_buf))
		cs |= BCM2835_SPI_CS_REN;

	if (spi->mode & SPI_CPOL)
		cs |= BCM2835_SPI_CS_CPOL;
	if (spi->mode & SPI_CPHA)