[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Ve7jZyshwLuNKvuk7uvj43SpcZT_=csOYXVFUqhtmFo3A@mail.gmail.com>
Date: Tue, 10 Nov 2020 18:31:28 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Sven Van Asbroeck <thesven73@...il.com>
Cc: Andrew Lunn <andrew@...n.ch>,
Heiner Kallweit <hkallweit1@...il.com>,
Jakub Kicinski <kuba@...nel.org>,
Russell King <linux@...linux.org.uk>,
"David S. Miller" <davem@...emloft.net>,
netdev <netdev@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Mark Brown <broonie@...nel.org>,
Linus Walleij <linus.walleij@...aro.org>,
Frederic LAMBERT <frdrc66@...il.com>,
Gabor Juhos <juhosg@...nwrt.org>,
Jonathan Cameron <jonathan.cameron@...wei.com>,
linux-spi <linux-spi@...r.kernel.org>
Subject: Re: [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@...il.com> wrote:
>
> From: Sven Van Asbroeck <thesven73@...il.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
Powered by blists - more mailing lists