public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexander Stein <alexander.stein@ew.tq-group.com>
To: Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <brgl@bgdev.pl>,
	Andy Shevchenko <andy@kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Pavel Machek <pavel@ucw.cz>, Lee Jones <lee@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, linux-leds@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com
Subject: Re: [PATCH v2 1/2] dt-bindings: gpio: Add gpio-line-names to STMPE GPIO
Date: Mon, 24 Jul 2023 13:44:11 +0200	[thread overview]
Message-ID: <4285919.ejJDZkT8p0@steina-w> (raw)
In-Reply-To: <29b62cc6-bc54-9a43-211b-b2d7579218b7@linaro.org>

Am Montag, 24. Juli 2023, 11:54:12 CEST schrieb Krzysztof Kozlowski:
> On 24/07/2023 09:58, Alexander Stein wrote:
> > Hi,
> > 
> > Am Montag, 24. Juli 2023, 09:23:09 CEST schrieb Krzysztof Kozlowski:
> >> On 24/07/2023 08:35, Alexander Stein wrote:
> >>> This is a gpio-controller, so gpio-line-names should be allowed as well.
> >>> stmpe2403 supports up to 24 GPIOs.
> >>> 
> >>> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> >>> ---
> >>> Changes in v2:
> >>> * Add min/maxItems
> >>> 
> >>>  Documentation/devicetree/bindings/gpio/st,stmpe-gpio.yaml | 4 ++++
> >>>  1 file changed, 4 insertions(+)
> >>> 
> >>> diff --git a/Documentation/devicetree/bindings/gpio/st,stmpe-gpio.yaml
> >>> b/Documentation/devicetree/bindings/gpio/st,stmpe-gpio.yaml index
> >>> 22c0cae73425..4555f1644a4d 100644
> >>> --- a/Documentation/devicetree/bindings/gpio/st,stmpe-gpio.yaml
> >>> +++ b/Documentation/devicetree/bindings/gpio/st,stmpe-gpio.yaml
> >>> 
> >>> @@ -28,6 +28,10 @@ properties:
> >>>    gpio-controller: true
> >>> 
> >>> +  gpio-line-names:
> >>> +    minItems: 1
> >>> +    maxItems: 24
> >>> +
> >> 
> >> I am sure there is no variant with one GPIO.
> > 
> > That's true. But if only one GPIO is actually connected there is no use
> > enforcing to add empty entries.
> > AFAIK it is also allowed to provide an incomplete array.
> 
> Did you test it? Linux prints warning. Warning means "not allowed".

I did and I don't see any warnings.
I using the following (modified) GPIO subnode on an stmpe811 chip:
gpio {
	compatible = "st,stmpe-gpio";
	gpio-controller;
	#gpio-cells = <2>;
	interrupt-controller;
	#interrupt-cells = <2>;
	/* GPIO 5-7 used for touch */
	st,norequest-mask = <0xf0>;
	gpio-line-names = "GPIO_ADC_I2C1_1";
};

I only see the warning "stmpe-gpio stmpe-gpio: DMA mask not set", but that's a 
different matter.
Only GPIO 0-3 are connected. Original property is
gpio-line-names = "GPIO_ADC_I2C1_1",
	        "GPIO_ADC_I2C1_2",
	        "GPIO_ADC_I2C1_3",
	        "GPIO_ADC_I2C1_4";

Also gpioinfo shows that the gpiochip has 8 pins while only the first one is 
named.

gpiochip7 - 8 lines:
        line   0: "GPIO_ADC_I2C1_1" unused input active-high 
        line   1:      unnamed       unused   input  active-high 
        line   2:      unnamed       unused   input  active-high 
        line   3:      unnamed       unused   input  active-high 
        line   4:      unnamed       unused   input  active-high 
        line   5:      unnamed       unused   input  active-high 
        line   6:      unnamed       unused   input  active-high 
        line   7:      unnamed       unused   input  active-high


If 4 GPIOs are named the output shows names for lines 1-3 accordingly, but no 
errors/warnings as well.

> The expectation is that the rest are named "NC".

Where does this expectation come from? Is there any pending change I am not 
aware of?

Best regards,
Alexander

-- 
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
http://www.tq-group.com/



  reply	other threads:[~2023-07-24 11:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-24  6:35 [PATCH v2 1/2] dt-bindings: gpio: Add gpio-line-names to STMPE GPIO Alexander Stein
2023-07-24  6:35 ` [PATCH v2 2/2] dt-bindings: leds: Add gpio-line-names to PCA9532 GPIO Alexander Stein
2023-07-24  7:24   ` Krzysztof Kozlowski
2023-07-24 13:36   ` Krzysztof Kozlowski
2023-08-07  8:56   ` Linus Walleij
2023-08-17 11:49   ` (subset) " Lee Jones
2023-07-24  7:23 ` [PATCH v2 1/2] dt-bindings: gpio: Add gpio-line-names to STMPE GPIO Krzysztof Kozlowski
2023-07-24  7:58   ` Alexander Stein
2023-07-24  9:54     ` Krzysztof Kozlowski
2023-07-24 11:44       ` Alexander Stein [this message]
2023-07-24 13:35         ` Krzysztof Kozlowski
2023-07-24 13:35 ` Krzysztof Kozlowski
2023-07-29 14:00 ` Bartosz Golaszewski

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=4285919.ejJDZkT8p0@steina-w \
    --to=alexander.stein@ew.tq-group.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andy@kernel.org \
    --cc=brgl@bgdev.pl \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=lee@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=pavel@ucw.cz \
    --cc=robh+dt@kernel.org \
    /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