On 3/25/26 12:31 PM, Krzysztof Kozlowski wrote:
> On 25/03/2026 12:20, Konrad Dybcio wrote:
>>>
>>>>
>>>> FWIW TLMM subnodes are best sorted by pin index (although the file
>>>> currently doesn't really do that) as per dts coding style
>>>
>>> I assume when I group the -pins into -state it doesn't apply anymore? As I 
>>> don't feel having pins relevant to one device / subsystem all over the 
>>> place is extra clean.
>>
> 
>       nfc_int_default: nfc-int-default-state {
>               pins = "gpio63";
>       };
> 
>       nfc_enable_default: nfc-enable-default-state {
>               pins = "gpio12", "gpio62";
>       };
> 
>       sde_dsi_active: sde-dsi-active-state {
>               pins = "gpio6", "gpio11";
>       }
> 
> Let's imagine future possible implementation of DTS coding style
> linter/checkpatch. How it would sort the nodes? Either by node name or
> the first value in "pins", this this would be:
> 
>       sde_dsi_active: sde-dsi-active-state {
>               pins = "gpio6", "gpio11";
>       }
> 
>       nfc_enable_default: nfc-enable-default-state {
>               pins = "gpio12", "gpio62";
>       };
> 
>       nfc_int_default: nfc-int-default-state {
>               pins = "gpio63";
>       };
> 
> So that's how you code. Less work for future linter/checkpatch.
> 
> The trouble is that "pins" property sorting can result in nodes being
> spread all over, imagine:
> 
>       nfc_enable_default: nfc-enable-default-state {
>               pins = "gpio5", "gpio62";
>                       // ^^^^^ DIFFERENCE!
>       };
> 
>       sde_dsi_active: sde-dsi-active-state {
>               pins = "gpio6", "gpio11";
>       }
> 
>       nfc_int_default: nfc-int-default-state {
>               pins = "gpio63";
>       };
> 
> That's why I would propose to keep everything sorted by node name, but I
> am fine with both choices. Qualcomm maintainers decide about such
> detailed style they want to impose.

At LPC we agreed that the last sentence should not be the case ;)

I think I'm fine with "children by name" then..

Konrad

Reply via email to