From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF1EEC433FE for ; Thu, 25 Nov 2021 08:51:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350333AbhKYIyT (ORCPT ); Thu, 25 Nov 2021 03:54:19 -0500 Received: from muru.com ([72.249.23.125]:60034 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350913AbhKYIwT (ORCPT ); Thu, 25 Nov 2021 03:52:19 -0500 Received: from localhost (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 4021D8027; Thu, 25 Nov 2021 08:49:45 +0000 (UTC) Date: Thu, 25 Nov 2021 10:49:04 +0200 From: Tony Lindgren To: =?utf-8?B?UmFmYcWCIE1pxYJlY2tp?= Cc: Linus Walleij , Rob Herring , Andy Shevchenko , linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, =?utf-8?B?UmFmYcWCIE1pxYJlY2tp?= Subject: Re: [PATCH V2 1/6] dt-bindings: pinctrl: support specifying pins, groups & functions Message-ID: References: <20211124230439.17531-1-zajec5@gmail.com> <20211124230439.17531-2-zajec5@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20211124230439.17531-2-zajec5@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Hi, * Rafał Miłecki [211124 23:05]: > --- a/Documentation/devicetree/bindings/pinctrl/pinctrl.yaml > +++ b/Documentation/devicetree/bindings/pinctrl/pinctrl.yaml > @@ -42,4 +42,44 @@ properties: > This property can be set either globally for the pin controller or in > child nodes for individual pin group control. > > + pins: > + type: object > + > + patternProperties: > + "^.*$": > + type: object > + > + properties: > + number: > + description: Pin number > + $ref: /schemas/types.yaml#/definitions/uint32 > + > + additionalProperties: false Please don't introduce Linux kernel internal numbering here. It's like bringing back the interrupt numbers again. Just make this into a proper hardware offset from the controller base, so a reg property. Sure in some cases the reg property is just an index depending on the controller, we don't really care from the binding point of view. We already have #pinctrl-cells, so plase do something like the four ximaginary examples below: #pinctrl-cells = <1>; ... pin@foo { reg = <0xf00 MUX_MODE0>; label = "foo_pin"; }; #pinctrl-cells = <2>; ... pin@foo { reg = <0xf00 PIN_INPUT_PULLUP MUX_MODE3>; }; #pinctrl-cells = <2>; ... pin@f00 { reg = <0xf00 DELAY_PS(0) DELAY_PS(0)>; }; #pinctrl-cells = <3>; ... pin@f00 { reg = <0xf00 MUX_MODE3 PULL_UP_STRENGTH(36) PULL_DOWN_STRENGTH(20)>; }; Then let's attempt to use just standard numbers and defines for the values where possible. Then a group of pins is just a list of the pin phandles in the devicetree. Regards, Tony