Re: [PATCH 04/10] dt-bindings: pinctrl: add Ambarella CV75 pinctrl

Linus Walleij <[email protected]> Sat, 1 Aug 2026 08:46:18 +0200
Newsgroups org.kernel.vger.linux-clk,dev.linux.lists.soc,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-gpio,org.kernel.vger.linux-kernel,org.kernel.vger.linux-serial
Message-ID <CAD++jL=Zw0_jKj4FiVHAVC6ASjRJgOF6WswAJBZD=Y3nQCAauA@mail.gmail.com>
Hi Long,

thanks for your patch!

On Thu, Jul 30, 2026 at 12:44 PM Long Zhao <[email protected]> wrote:

> +  "^[a-z0-9-]+-pins$":
> +    type: object
> +    allOf:
> +      - $ref: pinmux-node.yaml#
> +      - $ref: pincfg-node.yaml#
> +    additionalProperties: false
> +
> +    properties:
> +      function: true
> +
> +      pinmux:
> +        $ref: /schemas/types.yaml#/definitions/uint32-array
> +        minItems: 1
> +        maxItems: 96
> +
> +      bias-disable: true
> +      bias-pull-down: true
> +      bias-pull-up: true
> +
> +      drive-strength:
> +        enum: [3, 4, 5, 6, 7, 8, 9, 12]
> +
> +    required:
> +      - function
> +      - pinmux

Usually either (function + group) OR pinmux is used, so this looks
slightly confusing to me.

> +        uart0-pins {
> +            function = "uart0";
> +            pinmux = <AMBA_PINMUX(44, 1)>,
> +                     <AMBA_PINMUX(45, 1)>;
> +            bias-disable;
> +            drive-strength = <8>;
> +        };
> +    };

So I take it that "pinmux" is used for all the muxing while the function "uart0"
is actually only used for the pin configs, right?

It would be better to encode the groups into the driver I think and then it
would look like this:

       uart0-pins {
           function = "uart0";
           groups = "uart0tx", "uart0rx";
           bias-disable;
           drive-strength = <8>;
       };

As you can see "uart0tx" is easier to read and understand than
<AMBA_PINMUX(44, 1)>.

Also it hides constants nicely in the driver. I know this is a lot of work.

I know a lot of companies like "pinmux" because it's simple and
convenient, but it really
isn't the best for developers writing device trees and debugging.

Yours,
Linus Walleij