All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Sven Van Asbroeck <thesven73@gmail.com>
Cc: Mark Brown <broonie@kernel.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@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v1] spi: fix client driver breakages when using GPIO descriptors
Date: Wed, 11 Nov 2020 02:08:16 +0100	[thread overview]
Message-ID: <CACRpkdbti4j+oL8=7i=G8YOGjpNre9X5dMs+HH0vLA4QpYPD0A@mail.gmail.com> (raw)
In-Reply-To: <20201106150706.29089-1-TheSven73@gmail.com>

On Fri, Nov 6, 2020 at 4:07 PM Sven Van Asbroeck <thesven73@gmail.com> wrote:

> From: Sven Van Asbroeck <thesven73@gmail.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@linaro.org>

Yours,
Linus Walleij

  parent reply	other threads:[~2020-11-11  1:08 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
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 [this message]
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='CACRpkdbti4j+oL8=7i=G8YOGjpNre9X5dMs+HH0vLA4QpYPD0A@mail.gmail.com' \
    --to=linus.walleij@linaro.org \
    --cc=broonie@kernel.org \
    --cc=jonathan.cameron@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=thesven73@gmail.com \
    --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.