All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sven Van Asbroeck <thesven73@gmail.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Mark Brown <broonie@kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Jonathan Cameron <jonathan.cameron@huawei.com>,
	Simon Han <z.han@kunbus.com>, Lukas Wunner <lukas@wunner.de>,
	linux-spi <linux-spi@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v1] spi: fix client driver breakages when using GPIO descriptors
Date: Mon, 9 Nov 2020 09:41:18 -0500	[thread overview]
Message-ID: <CAGngYiVu3cXtzb5PaoDOoyqjuuohLQ+em6Keg-qgDFFn2tdp=Q@mail.gmail.com> (raw)
In-Reply-To: <CAHp75VfP1R7bXV6nWWnovWB5BMFcNNEmwBQXheBCUVDbr=xXGA@mail.gmail.com>

Hi Andy, thank you for looking at this patch !

On Mon, Nov 9, 2020 at 9:24 AM Andy Shevchenko
<andy.shevchenko@gmail.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.

  reply	other threads:[~2020-11-09 14:41 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-06 15:07 [PATCH v1] spi: fix client driver breakages when using GPIO descriptors Sven Van Asbroeck
2020-11-09 14:25 ` Andy Shevchenko
2020-11-09 14:41   ` Sven Van Asbroeck [this message]
2020-11-11  1:05     ` Linus Walleij
2020-11-11 12:33       ` Mark Brown
2020-11-11 13:36         ` Linus Walleij
2020-11-16 21:06           ` Mark Brown
2020-11-18  1:03             ` Linus Walleij
2020-11-18 11:40               ` Mark Brown
2020-11-24 15:21                 ` Linus Walleij
2020-11-24 16:40                   ` Mark Brown
2020-11-25  9:19                 ` Grant Likely
2020-11-25  9:17           ` Grant Likely
2020-11-11  1:08 ` Linus Walleij
2020-11-11 15:48 ` Mark Brown
2020-11-11 16:24   ` Sven Van Asbroeck
2020-11-11 16:32     ` Mark Brown
2020-11-12 11:41     ` Charles Keepax

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGngYiVu3cXtzb5PaoDOoyqjuuohLQ+em6Keg-qgDFFn2tdp=Q@mail.gmail.com' \
    --to=thesven73@gmail.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=broonie@kernel.org \
    --cc=jonathan.cameron@huawei.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=z.han@kunbus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.