From patchwork Wed Nov 24 23:04:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 12693592 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 37775C433F5 for ; Wed, 24 Nov 2021 23:06:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ZTuV0CdxKv6LG0AcCMsqk+3RGJ6FJWtI1YJUzWtX2jw=; b=LDvFAEF+0owKKS kQjgWEiiLOf0OTbPtP28o5UxDTP5KlpCFeWeWlnn8ujxMJjgWmPmRDqkim4xOHfUjq8cZ4n996PFB I0c9+vvr/k6/sjovv5Hv2piMfCi6wYf62327nraILRSVGVESfDXSu7PFwjUYjHMd1PxMVxG7Jimf5 74qI05PaxxoYzsq4lojd3m2nsMVCxth1Z/HWDO6qxMDOmzZbzMULH4RegzI88V/yeS++1zbQxWfSj NIQ2wGbPNUm9ghCQn9ruA0EPNsA1HAt5qvqwYzv3G/jOzp3jOEnlqWZNJI8mDQTLXA84cwFYhksl7 DYTPyMfO1sQtR7/0nqzQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mq1K7-0060wE-Rj; Wed, 24 Nov 2021 23:05:08 +0000 Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mq1Ju-0060sk-VI for linux-arm-kernel@lists.infradead.org; Wed, 24 Nov 2021 23:04:56 +0000 Received: by mail-lf1-x135.google.com with SMTP id t26so11222362lfk.9 for ; Wed, 24 Nov 2021 15:04:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lWbqyeFKTpIICRMymi5H38k0B/Ww7jwmEeUwnVlXWRw=; b=BBWiwwcrrubeEEsKBJa5owoPeKRZfdluFYfF1P2knbtHA/JkxNnrKnPs0BWbU8gEPN FYLgYu1SnlfvtAZ6TcFeXiQsBYIh1czGq/jULOgkELbpTBDLv5RYa+MBEbdPCeA6fLET RBRU5RY3Q3t63NgXhTryEs/TNpI2AMN9Ti0IL84bP4zbLY9A7G986Vpi6Ivs/RKYm/S3 DrHrpXaW+ZSEKjFJEVDvUE5uqeaFFVxJ9DHs13pC1NrazwSVZNqWF+chU12lt+bvhhrg RtaW4F0yIflUPD9AvdF+hw/PjQ2aHDDMyqB3xl7y01rt0DbpoyL+Vh1I/a8efmf7nYYI IIMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lWbqyeFKTpIICRMymi5H38k0B/Ww7jwmEeUwnVlXWRw=; b=73BR00c0TsOS/4Vvr2al6nuAfJ4DdzKARSZ9F+yw9OC74S33t3SaH/rUZJuQeWzU0R E17pvINNwPF94+JV/4h5v3mJhPHLu4wbgdlfEWhOgRzMlby7W0YPG+jcJmGOfPFOQBlv rySKXQMzx9EwqGt3ub7DYnsee/JDQm/JwrW5t6AOf71tAwHUwiTjHlL+eFcGV3JPDeHf HzRMTON3lKSqQ5oiw5pVC6SPLlZOuFDyg8CNXf5Yw3ID41kJ+LsRmQjM4ES6kmxCpg85 wmB/tnaHLE1v4FzQBpDjV9Ol4UPUrJRX07TOiPAJJGhWasHPRXWFrQd/a5p7GEX55ivy HySQ== X-Gm-Message-State: AOAM533ZP2XUlI2na16vg9jSm23RKNFOBWi+XgCutivk38cbk7G8LCuW fvEBwYTbEv1JLdao+9WGp9Azj2r5Fos= X-Google-Smtp-Source: ABdhPJzPn86hxh8E/nA0jTARqE7u4J7ABNdcZr57j9b5czRc0sWmJkNF1kqtc4K5OHdUhqRQtJQXBA== X-Received: by 2002:a19:9157:: with SMTP id y23mr19363900lfj.277.1637795093282; Wed, 24 Nov 2021 15:04:53 -0800 (PST) Received: from localhost.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id t15sm106243lfp.181.2021.11.24.15.04.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Nov 2021 15:04:53 -0800 (PST) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Linus Walleij , Rob Herring Cc: Tony Lindgren , 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: [PATCH V2 1/6] dt-bindings: pinctrl: support specifying pins, groups & functions Date: Thu, 25 Nov 2021 00:04:34 +0100 Message-Id: <20211124230439.17531-2-zajec5@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211124230439.17531-1-zajec5@gmail.com> References: <20211124230439.17531-1-zajec5@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211124_150455_036320_FC0E9159 X-CRM114-Status: GOOD ( 13.43 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Rafał Miłecki This binding change is meant to introduce a generic way of describing pinctrl blocks details. Every pinmux block is expected to have: 1. Named pins 2. Named groups containing one or more pins 3. Named functions referencing one or more groups It doesn't describe how hw should be programmed. That remains binding and driver specific. This commit describes syntax for "pins", "groups" & "functions" nodes in a standard pinctrl binding. Every above node allows specifying its entries and it's done using subnodes. That design it meant to be generic and extendable (hw specific properties can be added). Using subnodes allows storing hw specific pin/group/function configuration. While it would be possible to have: groups { foo-pins = <0 1>; bar-pins = <2 3>; }; that doesn't allow hw specific quirks. Introduced design allows e.g.: groups { foo { pins = <0 1>; vendor,magic = <0xbeaf>; }; }; Signed-off-by: Rafał Miłecki --- Rob: this patch depends on another one I sent 2 weeks ago: [PATCH 2/2] dt-bindings: pinctrl: use pinctrl.yaml https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20211110165720.30242-2-zajec5@gmail.com/ V2: Don't use "reg" property as explained by Tony --- .../devicetree/bindings/pinctrl/pinctrl.yaml | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/pinctrl.yaml index d471563119a9..25d8188fbb26 100644 --- 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 + + groups: + type: object + + patternProperties: + "^.*$": + type: object + description: Group identified by node name + + properties: + pins: + $ref: /schemas/types.yaml#/definitions/uint32-array + description: Array of pins belonging to this group + + functions: + type: object + + patternProperties: + "^.*$": + type: object + description: Function identified by node name + + properties: + groups: + $ref: /schemas/types.yaml#/definitions/phandle-array + description: Array of pins groups used by this function + additionalProperties: true