lkml.org 
[lkml]   [2019]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] spi: spi-bcm2835.c: Fix 3-wire mode
On Mon, Jul 01, 2019 at 07:24:23AM +0000, Sa, Nuno wrote:
> The problem is in spi_map_msg() which
> allocates dummy buffers (because of the ctrl flags). As a result, in
> bcm2835_spi_transfer_one() we set "cs |= BCM2835_SPI_CS_REN;" when we
> want to do tx only. I believe this was the actual problem...

I see. In that case, try:

/* handle all the 3-wire mode */
- if ((spi->mode & SPI_3WIRE) && (tfr->rx_buf))
+ if ((spi->mode & SPI_3WIRE) && (tfr->rx_buf != ctlr->dummy_rx))
cs |= BCM2835_SPI_CS_REN;
else
cs &= ~BCM2835_SPI_CS_REN;

Use master->dummy_rx instead of ctlr->dummy_rx prior to commit
5f336ea53b6b ("spi: bcm2835: Replace spi_master by spi_controller").

This could be something that users of your cape might use on older
kernels in lieu of my upcoming patch set to drop MUST_RX / MUST_TX.

Thanks,

Lukas

\
 
 \ /
  Last update: 2019-07-01 13:56    [W:0.047 / U:1.536 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site