[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdbti4j+oL8=7i=G8YOGjpNre9X5dMs+HH0vLA4QpYPD0A@mail.gmail.com>
Date: Wed, 11 Nov 2020 02:08:16 +0100
From: Linus Walleij <linus.walleij@...aro.org>
To: Sven Van Asbroeck <thesven73@...il.com>
Cc: Mark Brown <broonie@...nel.org>,
Jonathan Cameron <jonathan.cameron@...wei.com>,
Simon Han <z.han@...bus.com>, Lukas Wunner <lukas@...ner.de>,
linux-spi <linux-spi@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v1] spi: fix client driver breakages when using GPIO descriptors
On Fri, Nov 6, 2020 at 4:07 PM Sven Van Asbroeck <thesven73@...il.com> wrote:
> From: Sven Van Asbroeck <thesven73@...il.com>
>
> Commit f3186dd87669 ("spi: Optionally use GPIO descriptors for CS GPIOs")
> introduced the optional use of GPIO descriptors for chip selects.
>
> A side-effect of this change: when a SPI bus uses GPIO descriptors,
> all its client devices have SPI_CS_HIGH set in spi->mode. This flag is
> required for the SPI bus to operate correctly.
>
> This unfortunately breaks many client drivers, which use the following
> pattern to configure their underlying SPI bus:
>
> static int client_device_probe(struct spi_device *spi)
> {
> ...
> spi->mode = SPI_MODE_0;
> spi->bits_per_word = 8;
> err = spi_setup(spi);
I feel torn about it, there are so many weird corners of semantics
in this code. The patch makes the code easier to understand
too.
If it provedly fixes more than it breaks:
Acked-by: Linus Walleij <linus.walleij@...aro.org>
Yours,
Linus Walleij
Powered by blists - more mailing lists