[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGngYiVu3cXtzb5PaoDOoyqjuuohLQ+em6Keg-qgDFFn2tdp=Q@mail.gmail.com>
Date: Mon, 9 Nov 2020 09:41:18 -0500
From: Sven Van Asbroeck <thesven73@...il.com>
To: Andy Shevchenko <andy.shevchenko@...il.com>
Cc: Mark Brown <broonie@...nel.org>,
Linus Walleij <linus.walleij@...aro.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 Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v1] spi: fix client driver breakages when using GPIO descriptors
Hi Andy, thank you for looking at this patch !
On Mon, Nov 9, 2020 at 9:24 AM Andy Shevchenko
<andy.shevchenko@...il.com> wrote:
>
> Sounds like "many SPI drivers have to be fixed".
>
I don't disagree. Fact is that after the imx cspi bus driver was converted
to gpio descriptors, most spi client drivers broke. It would be great if this
could be fixed. Any method that the community can find a consensus on,
would be great :)
One the one hand: the fact that many spi client drivers just overwrite
flags and values in their parent bus structure, doesn't sound idiomatic.
I guess those spi->... values should really be opaque, and we should
be using accessor functions, eg.:
static int acme_probe(struct spi_device *spi)
{
...
// won't touch SPI_CS_HIGH flag
spi_set_mode_clock(spi, SPI_MODE_0);
...
}
On the other hand, it sounds very confusing to set SPI_CS_HIGH on
all spi buses that use gpio descriptors: especially because gpiolib
already handles absolutely everything related to polarity. And the
SPI_CS_HIGH flag gets set even for chip-selects that are active-low.
Powered by blists - more mailing lists