lkml.org 
[lkml]   [2020]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH net v2] net: phy: spi_ks8995: Do not overwrite SPI mode flags
On Tue, Nov 10, 2020 at 4:20 PM Sven Van Asbroeck <thesven73@gmail.com> wrote:
>
> From: Sven Van Asbroeck <thesven73@gmail.com>
>
> This driver makes sure the underlying SPI bus is set to "mode 0"
> by assigning SPI_MODE_0 to spi->mode. Which overwrites all other
> SPI mode flags.
>
> In some circumstances, this can break the underlying SPI bus driver.
> For example, if SPI_CS_HIGH is set on the SPI bus, the driver
> will clear that flag, which results in a chip-select polarity issue.
>
> Fix by changing only the SPI_MODE_N bits, i.e. SPI_CPHA and SPI_CPOL.

I see that this is a fix for backporing, but maybe you can send a
patches on top of this to:
1) introduce
#define SPI_MODE_MASK (SPI_CPHA | SPI_CPOL)

> + /* use SPI_MODE_0 without changing any other mode flags */
> + spi->mode &= ~(SPI_CPHA | SPI_CPOL);

2)
spi->mode &= ~SPI_MODE_MASK;

> + spi->mode |= SPI_MODE_0;

?

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2020-11-10 17:30    [W:0.065 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site