From: Rob Herring <robh@kernel.org>
To: "Leonard, Niall" <Niall.Leonard@ncr.com>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <brgl@bgdev.pl>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/3] gpio: dt-bindings: add new property to wd,mbl-gpio bindings
Date: Mon, 30 Jan 2023 12:37:06 -0600 [thread overview]
Message-ID: <20230130183706.GA3079628-robh@kernel.org> (raw)
In-Reply-To: <c95cea18-5b92-e16c-f4f6-cde93ca22ca1@ncr.com>
On Mon, Jan 30, 2023 at 01:20:55PM +0000, Leonard, Niall wrote:
> On 29/01/2023 15:59, Krzysztof Kozlowski wrote:
> > *External Message* - Use caution before opening links or attachments
> >
> > On 27/01/2023 12:39, Leonard, Niall wrote:
> >>
> >>
> >>> -----Original Message-----
> >>> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> >>> Sent: 26 January 2023 12:29
> >>> To: Leonard, Niall <Niall.Leonard@ncr.com>; Linus Walleij
> >>> <linus.walleij@linaro.org>; Bartosz Golaszewski <brgl@bgdev.pl>; Rob
> >>> Herring <robh+dt@kernel.org>; Krzysztof Kozlowski
> >>> <krzysztof.kozlowski+dt@linaro.org>
> >>> Cc: linux-gpio@vger.kernel.org; devicetree@vger.kernel.org; linux-
> >>> kernel@vger.kernel.org
> >>> Subject: Re: [PATCH 1/3] gpio: dt-bindings: add new property to wd,mbl-gpio
> >>> bindings
> >>>
> >>> *External Message* - Use caution before opening links or attachments
> >>>
> >>> On 26/01/2023 11:17, Niall Leonard via B4 Submission Endpoint wrote:
> >>>> From: Niall Leonard <nl250060@ncr.com>
> >>>
> >>> Subject: missing "wd,mbl-gpio:" prefix.
> >>>
> >>> Subject: drop second/last, redundant "bindings". The "dt-bindings"
> >>> prefix is already stating that these are bindings.
> >>>
> >>>>
> >>>> Added optional "no-input" property
> >>>
> >>> Missing full stop.
> >>>
> >>>>
> >>>> Signed-off-by: Niall Leonard <nl250060@ncr.com>
> >>>> ---
> >>>> Documentation/devicetree/bindings/gpio/wd,mbl-gpio.txt | 1 +
> >>>> 1 file changed, 1 insertion(+)
> >>>>
> >>>> diff --git a/Documentation/devicetree/bindings/gpio/wd,mbl-gpio.txt
> >>>> b/Documentation/devicetree/bindings/gpio/wd,mbl-gpio.txt
> >>>> index 038c3a6a1f4d..9405f9dad522 100644
> >>>> --- a/Documentation/devicetree/bindings/gpio/wd,mbl-gpio.txt
> >>>> +++ b/Documentation/devicetree/bindings/gpio/wd,mbl-gpio.txt
> >>>> @@ -18,6 +18,7 @@ Required properties:
> >>>>
> >>>> Optional properties:
> >>>> - no-output: GPIOs are read-only.
> >>>> + - no-input: GPIOs are write-only. Read is via a shadow register.
> >>>
> >>> Why this property is needed? Why driver cannot always use shadow
> >>> register?
> >>>
> >> The shadow register is currently only used during the write operation. It is not available during the read operation.
> >
> > You just wrote above that reading is via shadow register, so how can it
> > not be available for reads? Again, why you cannot always read via shadow
> > register and need to make a property? You mean that for other GPIOs
> > there is no shadow register at all?
> >
> The existing read method does not use the shadow register.
>
> static int bgpio_get(struct gpio_chip *gc, unsigned int gpio)
> {
> return !!(gc->read_reg(gc->reg_dat) & bgpio_line2mask(gc, gpio));
> }
>
> > What changes between one board and another that justifies this property?
>
> I have a couple of boards where the electronics engineer decided to only
> use the chip select line, so no read/write signal is connected. This
> means that reading the address activates the chip select and drives the
> contents of the data bus to the port.
This part makes sense as you explained the h/w.
> For example is someone reads the
> file /sys/kernel/debug/gpio this corrupts the port. So I have had to add
> this property to avoid that situation.
Not quite relevant to the DT binding being a Linux detail.
>
> If you are strongly against this then just reject it and I will look
> after it myself. I thought there may be others who would find this
> change useful.
A property for a board level quirk is appropriate. You just need to
explain that in the commit message rather than stating what the diff
already tells us.
Rob
next prev parent reply other threads:[~2023-01-30 18:38 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-26 10:17 [PATCH 0/3] Introduce new optional property to mark port as write only Niall Leonard via B4 Submission Endpoint
2023-01-26 10:17 ` [PATCH 1/3] gpio: dt-bindings: add new property to wd,mbl-gpio bindings Niall Leonard via B4 Submission Endpoint
2023-01-26 12:28 ` Krzysztof Kozlowski
2023-01-27 11:39 ` Leonard, Niall
2023-01-29 15:59 ` Krzysztof Kozlowski
2023-01-30 13:20 ` Leonard, Niall
2023-01-30 18:37 ` Rob Herring [this message]
2023-01-31 10:25 ` Leonard, Niall
2023-01-27 12:57 ` Linus Walleij
2023-01-26 10:17 ` [PATCH 2/3] gpio: Add new flag BGPIOF_NO_INPUT Niall Leonard via B4 Submission Endpoint
2023-01-27 12:54 ` Linus Walleij
2023-01-31 10:22 ` Leonard, Niall
2023-01-26 10:17 ` [PATCH 3/3] gpio: mmio: Use " Niall Leonard via B4 Submission Endpoint
2023-01-27 12:53 ` Linus Walleij
2023-01-29 16:01 ` Krzysztof Kozlowski
2023-01-31 10:23 ` Leonard, Niall
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=20230130183706.GA3079628-robh@kernel.org \
--to=robh@kernel.org \
--cc=Niall.Leonard@ncr.com \
--cc=brgl@bgdev.pl \
--cc=devicetree@vger.kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.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;
as well as URLs for NNTP newsgroup(s).