From patchwork Thu Nov 18 13:21:48 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: 12693040 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED3D8C433F5 for ; Thu, 18 Nov 2021 13:23:53 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id BA769613B1 for ; Thu, 18 Nov 2021 13:23:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BA769613B1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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=FverHK6dgmLwe4D66Bos3Ww/R301qL0AIBmtfoGbM2A=; b=jGx4O+fFGTZ9xi ElBwL78VYFpdtwwS4POJvhseeewNuh/bxhyb5+0VDbjCG3E6TYWTuuxLjM4v6EkLg4oMXEssLqdou QeWX1eKENeY/kv9CVavBjLnVFDrAoPvr0i9oOSABh//m+W1VYqjoXicgQVCmZtgeXT+SvrbvfC1Qp mq6yGAIZdpAP58XQ7gwdMBCGKbYLXmw4EgLAncoB6zEXoFh4gY2s2JhOPYafxV/3sXF3I8aFoxGSu vo0JBXibSSUZE//E/56/3HDW4oRc5PAhVwRg4mb8eFgd7M78A9fFcnZCXOYBEosPUzoenVBks6MQV RfJfmBLyUBuD3i0nIckg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mnhMy-007sRT-8V; Thu, 18 Nov 2021 13:22:28 +0000 Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mnhMi-007sMr-5T for linux-arm-kernel@lists.infradead.org; Thu, 18 Nov 2021 13:22:13 +0000 Received: by mail-lf1-x130.google.com with SMTP id k37so26087171lfv.3 for ; Thu, 18 Nov 2021 05:22:12 -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=1L/0A+EuKJ6gwcEMDegZLhyHztp3BPqMAMC2myjRsJM=; b=DFcM0FNX12scIGyvbPCM2H5y28UU0wv+aI2RqgNj0OtQKMyNnCcHryqHnVOa1tBer6 W746hN0xeGdBuFwrCubyeX7hET9JE4diWo0Pu/foQHrUDW3fnBA+QvatOs9aZfK3pw6Y j5IVzLTYgvn0aOYg9L7lJzhMOebjCUZa09SWbs06FfNm90poA4NmINFfmp2VrK6WWlwl rPB5p/oMM6F3H3LYq/R5Em+P4m0i2GM1CZy1199LDuQu8TR88OcKRcLahwRmXOxuHyoL vJ7USf2M/lJ81zKhyrGKuodSpeJfWanJI8V5lQaDwdfg0YlJvdE2hUJoVy53rVFuBJwe M+9Q== 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=1L/0A+EuKJ6gwcEMDegZLhyHztp3BPqMAMC2myjRsJM=; b=oEweLwR2/I4qUxc8r+apbF/Z+yk37Uu64cQhtK6Rv2PUpOuWCOeUfmTV0rhTwkutHe RLoNq6wtVKkDp8FzjUYuLeYt+TTsAVdQ2XqTBimsxrRq7ILUfwBNRAzfTfBWYlBeW9Uk U0/OpRuR+jlWE9nJCW/Ee1bu9lDRlfb3nG+DYIoFffuh4b5OCHx4xwRe/HivDfhydP87 mo40Ul2/oZlgocOHyTzpxtDt7NSw712ChRQoPLu9hY1tNKf+SQohG0e7Ps0mxwGM4Isp AaQ28wiNNCenwFt6okLKQ20dp9eDc/5qsfEhEks1m1/LjqID3E5KFdymVgC1MAeCZHlg NRzA== X-Gm-Message-State: AOAM531yv4IATR9cE4UbD82dyh66tDxbUAPPHD8mwKMCvZtnoW7xpGMh Pd2RIBWIL6J4Om0KSytmiwQ= X-Google-Smtp-Source: ABdhPJxatszYdUlQDFHsrWqVZvd2OcxvxsKkd5VxJMlO3v0Oc4JF2ibpfqSmY9htcaCbpg56QWFbTg== X-Received: by 2002:a2e:a305:: with SMTP id l5mr16881369lje.73.1637241730772; Thu, 18 Nov 2021 05:22:10 -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 bp36sm356550lfb.0.2021.11.18.05.22.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Nov 2021 05:22:10 -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 1/5] dt-bindings: pinctrl: support specifying pins, groups & functions Date: Thu, 18 Nov 2021 14:21:48 +0100 Message-Id: <20211118132152.15722-2-zajec5@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211118132152.15722-1-zajec5@gmail.com> References: <20211118132152.15722-1-zajec5@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211118_052212_234330_4239F244 X-CRM114-Status: GOOD ( 12.76 ) 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 is still binding 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 because: 1. It's required with reg = ("pins") 2. It's generic & extendable (hw specific properties can be added) Pins are number based so they use reg = . It's also required as binding needs to allow gaps. It's to avoid hacks like: pins = <"foo" "-ENODEV" "-ENODEV" "-ENODEV" "bar">; (for hw with pins 0 and 4 present). Subnodes also allow 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 --- .../devicetree/bindings/pinctrl/pinctrl.yaml | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/pinctrl.yaml index d471563119a9..1a99920e94ef 100644 --- a/Documentation/devicetree/bindings/pinctrl/pinctrl.yaml +++ b/Documentation/devicetree/bindings/pinctrl/pinctrl.yaml @@ -42,4 +42,54 @@ properties: This property can be set either globally for the pin controller or in child nodes for individual pin group control. + pins: + type: object + + properties: + '#address-cells': + const: 1 + + '#size-cells': + const: 0 + + patternProperties: + "^pin@[0-9a-z]+$": + type: object + + properties: + reg: + description: Pin number + + label: + description: Pin name + $ref: /schemas/types.yaml#/definitions/string + + 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