[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdYbS_syVwgc=YndkV-DpEF0K8NpH6WzP=g0AFpN+OTN8A@mail.gmail.com>
Date: Mon, 14 Nov 2022 11:13:36 +0100
From: Linus Walleij <linus.walleij@...aro.org>
To: Jim Liu <jim.t90615@...il.com>
Cc: JJLIU0@...oton.com, KWLIU@...oton.com, brgl@...ev.pl,
robh+dt@...nel.org, krzysztof.kozlowski+dt@...aro.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, openbmc@...ts.ozlabs.org
Subject: Re: [PATCH v2 3/3] dt-bindings: gpio: Add Nuvoton NPCM750 serial I/O
expansion interface(SGPIO)
On Mon, Nov 14, 2022 at 9:38 AM Jim Liu <jim.t90615@...il.com> wrote:
> Our sgpio module has 64 pins output and 64 pins input.
> Soc have 8 reg to control 64 output pins
> and 8 reg to control 64 input pins.
> so the pin is only for gpi or gpo.
>
> The common property ngpio can be out or in.
> so i need to create d_out and d_in to control it.
> customers can set the number of output or input pins to use.
> the driver will open the ports to use.
> ex: if i set d_out=9 and d_in=20
> driver will open two output ports and three input ports.
>
> Another method is the driver default opens all ports , in this
> situation the driver doesn't need d_out and d_in.
Finally I get it!
Some of the above should go into the binding document so that
others understand it too.
Have you considered splitting this into 2 instances with 2 DT nodes:
one with up to 64 output-only pins and one with up to 64 input-only pins?
That means more nodes in the DT and more compatibles. If all
the registers are in the same place maybe this is not a good
idea.
If you feel you need to keep the two properties, create something custom
for your hardware because this is not generally useful, e.g.
nuvoton,input-ngpios = <...>
nuvoton,output-ngpios = <...>
By this nomenclature it also becomes more evident what is going on.
Yours,
Linus Walleij
Powered by blists - more mailing lists