From patchwork Fri Dec 10 11:42:21 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: 1566456 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=d/tDZCmk; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4J9TXq6LV7z9sVq for ; Fri, 10 Dec 2021 22:42:35 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237840AbhLJLqJ (ORCPT ); Fri, 10 Dec 2021 06:46:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233311AbhLJLqI (ORCPT ); Fri, 10 Dec 2021 06:46:08 -0500 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77CA8C061746; Fri, 10 Dec 2021 03:42:33 -0800 (PST) Received: by mail-lf1-x133.google.com with SMTP id l22so17509485lfg.7; Fri, 10 Dec 2021 03:42:33 -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=CmlEqelTeZa5/+/7EvCKddeNcASbx3AAXYq8cfWXM3w=; b=d/tDZCmkYz4kBcQ5AVD/PRKTRfH/VN/RKit55yf1mCPSo4yyE4Vg1t5EfIO7u5+Dkl b89+6h3tBbApts5N/MpZk9ea+bQDSBu9gy9u6nlVnICKENnn1Sn4ZYJih07z+woWVQnx +4ZLpzzyrV/B0YRFaRzHSupOhTFY1J6SD5ol/7XMqpBKnyU+DfXBoXoyqyMn+ZkvFN+6 OtLlzRehekeJp3w/js6JvShObA5E1qGkKemhMp1474Hm75HimGXY3fglmq2P9qoxJXMP 8jiocn9FH71zk2mKfSwC4Rq1LW6AIrXPe7812pgxWEOsFl363gLAxbL6FFpuiDEjhKoD zyFw== 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=CmlEqelTeZa5/+/7EvCKddeNcASbx3AAXYq8cfWXM3w=; b=gxUgv2TkWE4NvUQgNssRuNPi3WNWGCmm8UJipVbJH9qoHN9r+ZxfbXWImlhE3hKYIz 3zR6B+9CqJ+g8YuyQzJl+9gJTul2XYTw4XyOfatTA/dZ4wRIQil8f/+7JkJ8Nn1kygee W8+3vsX19byxChFkuNKR/SkrGuSUDnxcYrwpzoSAkTGZ7Zd8RQPgnMkH3gGZS1gHJSEK /Y1Nv7g4/rmrxA/1SBc4k1dIlWyziS98vBI6pfudtiSkCOuaHlHRuplxlpMhnmtJFl9q XlRDCm3va0KjsUJuymux6YxdFApfMTX+CQ4M0uuqZCMVY4Buf8BZuFuksVN/LTahK9PN pzUg== X-Gm-Message-State: AOAM532A5qZJ4atVxd4zcQ+HXj+KU3dGkcVYAnYS030AM93tInl+yrL/ kitDgEtABsp9eu3O+OBCLP0= X-Google-Smtp-Source: ABdhPJyCyDDUfrqZQhdCo3chcesn2+D/GAUca/n2gxuX+hb9vVLIGTbmTOFuccVzmAO+c62mBRYMaw== X-Received: by 2002:ac2:5c48:: with SMTP id s8mr11730573lfp.292.1639136551798; Fri, 10 Dec 2021 03:42:31 -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 j15sm289375lfe.157.2021.12.10.03.42.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Dec 2021 03:42:31 -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 V3 1/2] dt-bindings: pinctrl: support specifying pins, groups & functions Date: Fri, 10 Dec 2021 12:42:21 +0100 Message-Id: <20211210114222.26581-2-zajec5@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211210114222.26581-1-zajec5@gmail.com> References: <20211210114222.26581-1-zajec5@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.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 a common syntax for "pins", "groups" & "functions" nodes. Every node allows specifying its entries. That design is meant to be extendable and minimalistic enough to be generic (matching any hardware). Relations between pins, groups and functions are expected to be the same for every hardware. Using subnode objects allows extending this binding to cover hardware specific needs (e.g. custom values). Example to consider: pins { foo: foo { vendor,magic = <0xc0fe>; }; } groups { bar { pins = <&foo>; vendor,secret = <0xbeaf>; }; }; Signed-off-by: Rafał Miłecki --- .../devicetree/bindings/pinctrl/pinctrl.yaml | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/pinctrl.yaml index d471563119a9..e36662cb1f3b 100644 --- a/Documentation/devicetree/bindings/pinctrl/pinctrl.yaml +++ b/Documentation/devicetree/bindings/pinctrl/pinctrl.yaml @@ -42,4 +42,38 @@ 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 + description: Pin named by node name + + groups: + type: object + + patternProperties: + "^.*$": + type: object + description: Group named by node name + + properties: + pins: + $ref: /schemas/types.yaml#/definitions/phandle-array + description: Array of pins belonging to this group + + functions: + type: object + + patternProperties: + "^.*$": + type: object + description: Function named by node name + + properties: + groups: + $ref: /schemas/types.yaml#/definitions/phandle-array + description: Array of groups used by this function + additionalProperties: true From patchwork Fri Dec 10 11:42:22 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: 1566457 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=cMXzA1cY; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4J9TXr4gWNz9sXS for ; Fri, 10 Dec 2021 22:42:36 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233311AbhLJLqK (ORCPT ); Fri, 10 Dec 2021 06:46:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240667AbhLJLqK (ORCPT ); Fri, 10 Dec 2021 06:46:10 -0500 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2507DC061746; Fri, 10 Dec 2021 03:42:35 -0800 (PST) Received: by mail-lj1-x22a.google.com with SMTP id u22so13308543lju.7; Fri, 10 Dec 2021 03:42:35 -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=//V7LaRZBttRLD6V/Smx8G2LPj0kKVQWcWYSEWdTtcI=; b=cMXzA1cYP92zn81NjewgKnGGHXV1yp8cQQC6vbCqffMDgfEWeIt392hkP/BNotRkOk r0Qso0jxc0Gwz6mRVSka+fUC7e0teuOE9ShNtkIeyPsaX7qq6sz2iX++SEa30modtjoY drXEhEXBDHA81/wdZKzqDLMMOuJcYZaarcT682uMMQhjWy7y4hjHaOtwauTrE4PquJ09 Y688QO01pHj5f1CcMBIDP07ojjqYlxN91pjVpvP6i5yxswHOWVEHJhFBsUGkPRDmKz4v kfm094nF3FRX+MADW3NfkKkDUS927joi+kJpRGdh4D1/FChfwgjzXa/pawCrWFaCll+o Us3g== 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=//V7LaRZBttRLD6V/Smx8G2LPj0kKVQWcWYSEWdTtcI=; b=QDQxzUp2hDg8U2zHP3ZUquu1CHWsdstTMijjgRNGIr5HzVyVwYHIa4aAPFBVcBlvuV ZLMLvsHR+4ncVDJV0Na3ihHsugQ3g5m6Q+MyUcIjXMd5IdNtZNVgHiF+zwkcjI/uWWkp eBBXRwyqUxsci1YTFWClwertH2oJlNAwqdNM2TUqWKAPnkn6lZod1L2xJiOraMrKQjFO Nfrqq8wVtavFmBwcw5Yd3fRCZC/82xYQ/7puMzvgrMdxDLwEAs5GGBBlkoABDR4gqki3 TLMg4z68VdP+ihHyRbzGP+x30JLMKcRtAvI3mlC5E4WypTxFwqjVG2Kwd6OQx7yqGb5i TDDQ== X-Gm-Message-State: AOAM532DVUPLq09T4JmPb6QzwJ+83LcDgRQOGa2x1lVV16yxeDL39Z0x TneYN3Kbf34fDcog2YaH030= X-Google-Smtp-Source: ABdhPJzqPCllMxjacR3pU4hIxg/mEoZNtWjW9jIsBC2+9hvSwQmRbImI1zp9dUaYy1FAONw8vVAdDA== X-Received: by 2002:a2e:9698:: with SMTP id q24mr12470865lji.246.1639136553447; Fri, 10 Dec 2021 03:42:33 -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 j15sm289375lfe.157.2021.12.10.03.42.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Dec 2021 03:42:33 -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 V3 2/2] dt-bindings: pinctrl: brcm,ns-pinmux: describe pins, groups & functions Date: Fri, 10 Dec 2021 12:42:22 +0100 Message-Id: <20211210114222.26581-3-zajec5@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211210114222.26581-1-zajec5@gmail.com> References: <20211210114222.26581-1-zajec5@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org From: Rafał Miłecki Use and extend generic pinctrl binding to include info about pins, groups & functions. Northstar platform pins have numbers assigned to them (they are needed for mux programming) so add a custom "number" property for that. Extend example to provide a complete binding of a single / random function. Signed-off-by: Rafał Miłecki --- .../bindings/pinctrl/brcm,ns-pinmux.yaml | 38 ++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/pinctrl/brcm,ns-pinmux.yaml b/Documentation/devicetree/bindings/pinctrl/brcm,ns-pinmux.yaml index 8d1e5b1cdd5f..82d3e52a2229 100644 --- a/Documentation/devicetree/bindings/pinctrl/brcm,ns-pinmux.yaml +++ b/Documentation/devicetree/bindings/pinctrl/brcm,ns-pinmux.yaml @@ -30,6 +30,20 @@ properties: reg-names: const: cru_gpio_control + pins: + type: object + + patternProperties: + "^.*$": + type: object + + properties: + number: + description: Pin number + $ref: /schemas/types.yaml#/definitions/uint32 + + unevaluatedProperties: false + patternProperties: '-pins$': type: object @@ -74,7 +88,7 @@ required: - reg - reg-names -additionalProperties: false +unevaluatedProperties: false examples: - | @@ -83,6 +97,28 @@ examples: reg = <0x1800c1c0 0x24>; reg-names = "cru_gpio_control"; + pins { + i2c_scl: i2c_scl { + number = <4>; + }; + + i2c_sda: i2c_sda { + number = <5>; + }; + }; + + groups { + i2c_grp: i2c_grp { + pins = <&i2c_scl &i2c_sda>; + }; + }; + + functions { + i2c { + groups = <&i2c_grp>; + }; + }; + spi-pins { function = "spi"; groups = "spi_grp";