Re: [PATCH v1 2/2] dt-bindings: gpio: add loongson series gpio

From: Linus Walleij
Date: Tue Nov 08 2022 - 07:12:04 EST


Hi Yinbo,

thanks for your patch!

On Tue, Nov 8, 2022 at 10:21 AM Yinbo Zhu <zhuyinbo@xxxxxxxxxxx> wrote:

> Add the Loongson series gpio binding with DT schema format using
> json-schema.
>
> Signed-off-by: Yinbo Zhu <zhuyinbo@xxxxxxxxxxx>

> + gpio-ranges: true

So you are using GPIO ranges... and...

> + loongson,gpio_base:
> + $ref: /schemas/types.yaml#/definitions/uint32
> + description:
> + This option indicate the first GPIO number in this node.

Then you have added this to reimplement gpio ranges.

It also shows in the driver.

Drop gpio_base altogether (we do not encode linux-specific properties
into the device trees) and use gpio-ranges as they are intended to
map between the GPIO numberspace and the pin control pin number
space.

See
Documentation/devicetree/bindings/gpio/gpio.txt
for documentation on gpio-ranges, also look how other drivers are
using them.

Yours,
Linus Walleij