linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "H. Nikolaus Schaller" <hns@goldelico.com>
To: Rob Herring <robh@kernel.org>, Linus Walleij <linus.walleij@linaro.org>
Cc: "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 08:23:49 +0200	[thread overview]
Message-ID: <2EA06398-E45B-481B-9A26-4DD2E043BF9C@goldelico.com> (raw)
In-Reply-To: <20190724194259.GA25847@bogus>

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.

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

> 
>> The effect is that the missing spi-cs-high is now interpreted as CS being
>> low (despite GPIO_ACTIVE_HIGH) which turns off the SPI interface when the
>> panel is to be programmed by the panel driver.
>> 
>> Therefore, we have to add the redundant and legacy spi-cs-high property
>> to properly pass through the legacy handler.
>> 
>> Since this is nowhere documented in the bindings, we add some words of
>> WARNING.
>> 
>> Cc: stable@vger.kernel.org
>> Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
>> ---
>> Documentation/devicetree/bindings/spi/spi-bus.txt | 6 ++++++
>> arch/arm/boot/dts/omap3-gta04.dtsi                | 1 +
>> 2 files changed, 7 insertions(+)

BR,
Nikolaus



  reply	other threads:[~2019-07-25  6:23 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 [this message]
2019-07-25 22:42       ` Rob Herring
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=2EA06398-E45B-481B-9A26-4DD2E043BF9C@goldelico.com \
    --to=hns@goldelico.com \
    --cc=bcousson@baylibre.com \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --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=robh@kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).