public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Conor Dooley <conor@kernel.org>
To: Yinbo Zhu <zhuyinbo@loongson.cn>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <brgl@bgdev.pl>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	linux-gpio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, Jianmin Lv <lvjianmin@loongson.cn>,
	wanghongliang@loongson.cn, loongson-kernel@lists.loongnix.cn
Subject: Re: [PATCH v3 1/2] gpio: dt-bindings: add parsing of loongson gpio offset
Date: Wed, 9 Aug 2023 16:39:25 +0100	[thread overview]
Message-ID: <20230809-circus-photo-6911d2e18f96@spud> (raw)
In-Reply-To: <536a9062-65b2-5518-5c50-1a61e23870ee@loongson.cn>

[-- Attachment #1: Type: text/plain, Size: 1232 bytes --]

On Wed, Aug 09, 2023 at 03:47:55PM +0800, Yinbo Zhu wrote:
> 在 2023/8/8 下午8:05, Conor Dooley 写道:
> > On Mon, Aug 07, 2023 at 03:40:42PM +0800, Yinbo Zhu wrote:

> > > +  loongson,gpio-ctrl-mode:
> > > +    $ref: /schemas/types.yaml#/definitions/uint32
> > > +    description:
> > > +      This option indicate this GPIO control mode, where '0' represents
> > > +      bit control mode and '1' represents byte control mode.
> > 
> > How is one supposed to know which of these modes to use?
> 
> 
> Byte mode is to access by byte, such as gpio3, the base address of the
> gpio controller is offset by 3 bytes as the access address of gpio3.
> 
> The bit mode is the normal mode that like other platform gpio and it is
> to access by bit.
> 
> If both modes are supported, it is recommended to prioritize using byte
> mode that according to spec.

So, sounds like this property should instead be a boolean that notes
whether the hardware supports the mode or not, rather than the current
enum used to determine software policy.

However, from Krzysztof's comments & my own feeling, it really does seem
like you should drop the do-everything compatible and introduce things
that are soc-specific.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2023-08-09 15:39 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-07  7:40 [PATCH v3 0/2] gpio: loongson: add firmware offset parse support Yinbo Zhu
2023-08-07  7:40 ` [PATCH v3 1/2] gpio: dt-bindings: add parsing of loongson gpio offset Yinbo Zhu
2023-08-08 12:05   ` Conor Dooley
2023-08-09  7:47     ` Yinbo Zhu
2023-08-09 15:39       ` Conor Dooley [this message]
2023-08-10  6:19         ` Yinbo Zhu
2023-08-11 14:25           ` Bartosz Golaszewski
2023-08-14  3:39             ` Yinbo Zhu
2023-08-14 19:18               ` Krzysztof Kozlowski
2023-08-15  8:59               ` Linus Walleij
2023-08-23  3:37                 ` Yinbo Zhu
2023-08-08 15:05   ` Krzysztof Kozlowski
2023-08-09  7:28     ` Yinbo Zhu
2023-08-09 13:00       ` Krzysztof Kozlowski
2023-08-10  3:35         ` Yinbo Zhu
2023-08-10  6:08           ` Krzysztof Kozlowski
2023-08-07  7:40 ` [PATCH v3 2/2] gpio: loongson: add firmware offset parse support Yinbo Zhu
2023-08-10  8:27   ` Linus Walleij
2023-08-11  3:50     ` Yinbo Zhu
2023-08-14 21:48   ` andy.shevchenko
2023-08-23  7:36     ` Yinbo Zhu

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=20230809-circus-photo-6911d2e18f96@spud \
    --to=conor@kernel.org \
    --cc=brgl@bgdev.pl \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=loongson-kernel@lists.loongnix.cn \
    --cc=lvjianmin@loongson.cn \
    --cc=robh+dt@kernel.org \
    --cc=wanghongliang@loongson.cn \
    --cc=zhuyinbo@loongson.cn \
    /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