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: 12695595 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 21237C433EF for ; Fri, 10 Dec 2021 11:44:24 +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=A6zzAiR7VNlDW4uT0TJkMHFoYF3KAXjJfZnINB2ZJmc=; b=Czq1FfFKpxprV3 goALZt0IjhDLPGxD3iDVdk3T2dn7INbNriy7iWl1cTdKAawZks/z4+IlF+8d+SmYUxwhtWlx+BRD7 NrA9GnvTfC4kwbdjYs+UefP2DfbJ42lXDVJSLvaiXghAcSUrUxTZ9rhg0NpfQAiDF5IamiVwE3WWz 6zV5GKVavLZSFu2LSuZUFgargPa3MJrYPH6ilJv3nYnlDv1V+2pg+GVug+Ufk3V8q0+AO2o1uDyaT O6nXdafBvC2isLcF0IefLz0NPiqVVtblT8tJn6UuMoMomDdX5K4Lrsmvj0lK9GSnqplOUe1A86n4P O4UI/qzvavqB/mb7qCMA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mveIa-001ibj-EA; Fri, 10 Dec 2021 11:42:48 +0000 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mveIL-001iYV-QH for linux-arm-kernel@lists.infradead.org; Fri, 10 Dec 2021 11:42:35 +0000 Received: by mail-lf1-x131.google.com with SMTP id m27so17475834lfj.12 for ; 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=nnXoCnhZgiUbyIYs/eXN60nr7siv7tZpcaQBFtJVixxv4qtMNKUPoxPuPC7mRHjEg2 z9X+Bq38OpxIxhGcpKTZLL2jTAqkm2PHagiiP14Gt/AIghpm5RRET200b11pKTuhBmZj qyHeEB8zqdsU9buAh5/VQy9RFfqrC1eCvoXy4k8sMKkoKEMWR6jSDSxS75w9+KgvRudQ ucPLmkEgszdTFjD021F0tANWZe094lv37lyi9RuKL5P01pewZtQ/jIl8WtYbM185IMWZ W/5rY11B1fqsbUKIbG0+sEwwE7yMOsBa9KRc1VZ+/+dSu4OncyWd6AZpqkwjZYrQZy4Z 97lA== X-Gm-Message-State: AOAM53063VNQ7KJYAEFwUe4nTfpCmrDp09DtSLAN31kg7U271VMqKiNO atFPTdhZxyZhxeHZyUeMY2I= 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211210_034233_877656_BEB431F6 X-CRM114-Status: GOOD ( 12.31 ) 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 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: 12695596 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 555ACC433EF for ; Fri, 10 Dec 2021 11:44:32 +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=Orc98WQeDxHvskONzIo4JvUE6F/HUEfx+Pkz5p9lls4=; b=YDhzj4NXWes/hs zjJCntnMElV4TY04Iq0Q1kLkKFP+ViHmaWI0C4lM3sjSn/BhbahNiP1gc2aDprM3bNsb0KnFZ6yu6 CuovjJLB33+C/zUy/8we71USrL4LcxnYOUNaIdS6ENLhn1ychB9v5KYL4XpiQJD+kWC3o6C1eYNQf LWuQgoq4e9vv5Zu5RcyiMVpxAZScCMANXYUrPpj1CFHb8yIu2TzYWAZ451HqgidNNQAgLg1ZnjvLn KmK5fe3kgdNehcVJk/gzD0L+S4G3x/ZVpHqzu91lphsDbPbDzx6YWXrq8FqQF5qxCxt3xI9J9dY8b 4cVrYIR11NU1qXlbmJcg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mveIo-001idj-7R; Fri, 10 Dec 2021 11:43:02 +0000 Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mveIN-001iZ0-Es for linux-arm-kernel@lists.infradead.org; Fri, 10 Dec 2021 11:42:36 +0000 Received: by mail-lj1-x231.google.com with SMTP id k2so13333304lji.4 for ; Fri, 10 Dec 2021 03:42:34 -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=JeCEnd0G1A3aT8Oi8hKj1/WPOBIjEDieHzRUSQiFfG1u5diqFKtCllaosr9fsJlCCM i9XJ3HTGUUyvjIyL05fSA0HrQtP7LcGbc95VRGgQtYBZyGXj62C1K8xhcPPQLFMP5r0J qsW+fQ/iDE7UA/CSKloLNcc/uu3lzxeYbCP5TLfFmD5nKPDGJrAt4ehZ0tYMR9xkFqWx yQTInt0OzPX7PEKxUWqu/ZK4qFznVPycAbDYK/DWcFBhsoow0CvTTn6aG0aapFD29MUS HksycXqXv4Rjey8xTWqQN1Tf6ZR00HCVAviNWtk95mvt5s4+AtikPYvE+mHx01LwhGW9 fL/A== X-Gm-Message-State: AOAM53064yO6FWJ+Sriqz0VI/4b+0d/qeTXJdFuvioSYFQ+fCtd+y+ck DIwU1+jRR//33K7lmpRx12jQv6cx7HA= 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211210_034235_531044_9E112C44 X-CRM114-Status: GOOD ( 12.75 ) 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 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";