[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1941910c-527f-4183-98f5-db11cc4e078b@ti.com>
Date: Fri, 21 Jun 2024 09:00:10 -0500
From: Andrew Davis <afd@...com>
To: Nishanth Menon <nm@...com>, Linus Walleij <linus.walleij@...aro.org>
CC: "Rob Herring (Arm)" <robh@...nel.org>, <linux-kernel@...r.kernel.org>,
<devicetree@...r.kernel.org>, <linux-arm-kernel@...ts.infradead.org>,
Conor
Dooley <conor+dt@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>, <linux-gpio@...r.kernel.org>,
Tony Lindgren <tony@...mide.com>
Subject: Re: [PATCH] dt-bindings: pinctrl: pinctrl-single: Define a max count
for "pinctrl-single,gpio-range"
On 6/21/24 8:36 AM, Nishanth Menon wrote:
> On 11:19-20240619, Andrew Davis wrote:
> [...]
>
>>
>> This binding is a bit of a mess, the phandle is always a pointer to
>> a node with the cells length hard-coded to 3. This looks to have been done
>> to allow the driver to use the function "of_parse_phandle_with_args" which
>> needs a property name for to find the cell count. But that makes no sense
>> as the count is always 3, the driver cannot accept any other value. The
>> driver should have just looped of_get_property() 3 times but wanted to
>> use the helper. So a silly driver mistake has turned into a binding issue.
>>
>> We should drop the "pinctrl-single,gpio-range" from the binding and
>> fix the driver.
My bad, I meant to say drop "#pinctrl-single,gpio-range-cells" and drop
the phandle from "pinctrl-single,gpio-range".
The #-cells is meant for a producer to define args for a consumer phandle.
This is so common in DT there is a helper function for it. The problem
is the author of the driver here wanted to use that helper, even though it
would be backwards in this case (pinmux is the consumer).
So we have a node inside the pinmux node that exists only to expose a fixed
number (3) of cells so that a different node inside the same pinmux node
could point to itself to make a helper function happy (that didn't need to
be used in the first place)..
Andrew
>
> Linus W: pinctrl-single,gpio-range -> any thoughts here? I think it is a
> valid (if a bit too flexible design looking at the existing users who
> just use a single mux value mapping for all modes)
>
Powered by blists - more mailing lists