[PATCH] SPI: BCM2835: enable support of 3-wire mode

Stephen Warren swarren at wwwdotorg.org
Thu Mar 19 22:12:41 PDT 2015


On 03/19/2015 03:01 AM, kernel at martin.sperl.org wrote:

> diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c

> @@ -201,6 +202,9 @@ static int bcm2835_spi_start_transfer(
>  		cdiv = 0; /* 0 is the slowest we can go */
>  	}
>  
> +	if ((spi->mode & SPI_3WIRE) && (tfr->rx_buf))
> +		cs |= BCM2835_SPI_CS_REN;
> +

I can see how that tells the HW which direction to transfer data in
3WIRE mode, but how does the HW know whether it's in 3WIRE mode or has
separate RX/TX lines?



More information about the linux-rpi-kernel mailing list