All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: "H. Nikolaus Schaller" <hns@goldelico.com>
Cc: "Linus Walleij" <linus.walleij@linaro.org>,
	"Mark Brown" <broonie@kernel.org>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Benoît Cousson" <bcousson@baylibre.com>,
	"Tony Lindgren" <tony@atomide.com>,
	"Discussions about the Letux Kernel"
	<letux-kernel@openphoenux.org>,
	linux-spi <linux-spi@vger.kernel.org>,
	devicetree <devicetree@vger.kernel.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	Linux-OMAP <linux-omap@vger.kernel.org>,
	stable <stable@vger.kernel.org>
Subject: Re: [PATCH 2/2] DTS: ARM: gta04: introduce legacy spi-cs-high to make display work again
Date: Thu, 25 Jul 2019 16:42:53 -0600	[thread overview]
Message-ID: <CAL_JsqLe_Y9Z6MRt7ojgSVKAb9n95S8j=eGidSVNz2T83j-zPQ@mail.gmail.com> (raw)
In-Reply-To: <2EA06398-E45B-481B-9A26-4DD2E043BF9C@goldelico.com>

On Thu, Jul 25, 2019 at 12:23 AM H. Nikolaus Schaller <hns@goldelico.com> wrote:
>
> Hi Rob,
>
> > Am 24.07.2019 um 21:42 schrieb Rob Herring <robh@kernel.org>:
> >
> > On Mon, Jul 08, 2019 at 04:46:05PM +0200, H. Nikolaus Schaller wrote:
> >> commit 6953c57ab172 "gpio: of: Handle SPI chipselect legacy bindings"
> >>
> >> did introduce logic to centrally handle the legacy spi-cs-high property
> >> in combination with cs-gpios. This assumes that the polarity
> >> of the CS has to be inverted if spi-cs-high is missing, even
> >> and especially if non-legacy GPIO_ACTIVE_HIGH is specified.
> >>
> >> The DTS for the GTA04 was orginally introduced under the assumption
> >> that there is no need for spi-cs-high if the gpio is defined with
> >> proper polarity GPIO_ACTIVE_HIGH.
> >
> > Given that spi-cs-high is called legacy, that would imply that DT's
> > should not have to use spi-cs-high.
>
> Yes.
>
> >
> >> This was not a problem until gpiolib changed the interpretation of
> >> GPIO_ACTIVE_HIGH and missing spi-cs-high.
> >
> > Then we should fix gpiolib...
>
> I tried to convince Linus that this is the right way but he convinced
> me that a fix that handles all cases does not exist.
>
> There seem to be embedded devices with older DTB (potentially in ROM)
> which provide a plain 0 value for a gpios definition. And either with
> or without spi-cs-high.
>
> Since "0" is the same as "GPIO_ACTIVE_HIGH", the absence of
> spi-cs-high was and must be interpreted as active low for these
> devices. This leads to the inversion logic in code.
>
> AFAIR it boils down to the question if gpiolib and the bindings
> should still support such legacy devices with out-of tree DTB,
> but force in-tree DTS to add the legacy spi-cs-high property.
>
> Or if we should fix the 2 or 3 cases of in-tree legacy cases
> and potentially break out-of tree DTBs.

If it is small number of platforms, then the kernel could handle those
cases explicitly as needed.

> IMHO it is more general to keep the out-of-tree DTBs working
> and "fix" what we can control (in-tree DTS).

If we do this, then we need to not call spi-cs-high legacy because
we're stuck with it forever.

Rob

  reply	other threads:[~2019-07-25 22:43 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-08 14:46 [PATCH 0/2] DTS: ARM: some minor updates and fixes for GTA04 H. Nikolaus Schaller
2019-07-08 14:46 ` [PATCH 1/2] DTS: ARM: gta04: define chosen/stdout-path H. Nikolaus Schaller
2019-08-13 11:47   ` Tony Lindgren
2019-07-08 14:46 ` [PATCH 2/2] DTS: ARM: gta04: introduce legacy spi-cs-high to make display work again H. Nikolaus Schaller
2019-07-24 19:42   ` Rob Herring
2019-07-25  6:23     ` H. Nikolaus Schaller
2019-07-25 22:42       ` Rob Herring [this message]
2019-08-05 10:29         ` Linus Walleij
2019-08-31  6:48           ` [Letux-kernel] " Andreas Kemnade
2019-09-16 10:59             ` H. Nikolaus Schaller
2019-09-16 22:52               ` Linus Walleij
2019-09-17 14:26                 ` H. Nikolaus Schaller
2019-09-20  8:55                   ` Linus Walleij
2019-09-20  9:19                     ` H. Nikolaus Schaller
2019-09-20 14:20                       ` Tony Lindgren
2019-09-20 14:54                         ` H. Nikolaus Schaller
2019-09-20 15:29                           ` Andreas Kemnade
2019-09-20 15:50                             ` H. Nikolaus Schaller
2019-09-20 15:53                               ` Tony Lindgren
2019-09-20 15:55                               ` H. Nikolaus Schaller

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='CAL_JsqLe_Y9Z6MRt7ojgSVKAb9n95S8j=eGidSVNz2T83j-zPQ@mail.gmail.com' \
    --to=robh@kernel.org \
    --cc=bcousson@baylibre.com \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=hns@goldelico.com \
    --cc=letux-kernel@openphoenux.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=stable@vger.kernel.org \
    --cc=tony@atomide.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.