From patchwork Fri Dec 17 16:56:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 525302 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 D4780C433EF for ; Fri, 17 Dec 2021 16:57:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239432AbhLQQ5M (ORCPT ); Fri, 17 Dec 2021 11:57:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239470AbhLQQ5E (ORCPT ); Fri, 17 Dec 2021 11:57:04 -0500 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE863C061574; Fri, 17 Dec 2021 08:57:02 -0800 (PST) Received: by mail-wr1-x434.google.com with SMTP id q16so5256919wrg.7; Fri, 17 Dec 2021 08:57:02 -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:mime-version :content-transfer-encoding; bh=w7h2/0+dZxW3/CPndfq0LogEvfUC/YvXC7sf8DuD6Ek=; b=nOkdsR1dJKivvIFKqH9HUXosIoo3zigH+HMd1PttpXxQpht1qYtkJ8JbRspb+gS3SY oB2m0GE7Scd8R/9sbYACNan/h5sogI8dIt58Q42tv7WR7UnrhfHwQvjbmFcaksCPMMFE jx9GPRiIDQeh3ZoP7qhKJSFIN170J/T5YP6a6AFlirgrQ7blEL74eKVkA9IGGVQ3otGl bhk+zq4DGNxXvFxS3n1AlmN2J7lWu10brq+aouPD2ZSY9ljmLnr6n2gyRl1v2AQM8maV pGyVJ6DizgWSYkglr+0QjoOyVQsv/JZNFLj4SUkdC3fkwW6/+P017bPydAl1qDLuR4k5 SHBQ== 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:mime-version :content-transfer-encoding; bh=w7h2/0+dZxW3/CPndfq0LogEvfUC/YvXC7sf8DuD6Ek=; b=ENCIiJ0gnDBj/djZP5nD0GbvYG0AwoAM03CxDcADfGcbDJbP0xVc3K8Y6GoDQtQRf1 7EwcMBpnC3vO6TpSPj/N9brsac1uRu3gZqYad+cSIN3Rrgvmw8Yqi/Xl4IULZSsCvPOV ML1x2vgAkMLpFFV/XFu/Ix73P+hi/I9ZDSbZztB6l/KcmwKusfkdgZvGNXeqr6Mgrnyv kcBz8+QmfUTsuGPen6JMzfkQ1+Xih9py82YuteNceuuWG6ItwSxhgs/sZa1HFjfc6MSg gyZR6nK7AC3iGd9TgRMocO4IeVNou2bjC2pKl3LqB5Tar3P42p3q9tysrNMHv/+POPk7 3YkQ== X-Gm-Message-State: AOAM5336zF0X+Afq7TOPab9RCu0xoHeh1ynP8p887kO+XvDTz0702qsQ 9I0V0w0IPVZQot0UTEGVvnY= X-Google-Smtp-Source: ABdhPJzSbeYK1YoGwU3ZLRG9BZPWdAhRqA7E+oJdjzS2Fojxlo8jEDNMK46WUHLeSs7YWRbJo2DCqw== X-Received: by 2002:a5d:4810:: with SMTP id l16mr376958wrq.672.1639760221270; Fri, 17 Dec 2021 08:57:01 -0800 (PST) Received: from localhost ([193.209.96.43]) by smtp.gmail.com with ESMTPSA id m20sm11808204wmq.11.2021.12.17.08.56.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Dec 2021 08:57:00 -0800 (PST) From: Thierry Reding To: Wolfram Sang , Rob Herring Cc: Peter Rosin , Andrew Jeffery , Brendan Higgins , Benjamin Herrenschmidt , Joel Stanley , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH v2 1/4] dt-bindings: i2c: tegra: Convert to json-schema Date: Fri, 17 Dec 2021 17:56:55 +0100 Message-Id: <20211217165658.2650677-1-thierry.reding@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org From: Thierry Reding Convert the Tegra I2C controller bindings from plain text to json-schema format. Signed-off-by: Thierry Reding --- Changes in v2: - include i2c-controller.yaml and use unevaluatedProperties: false .../bindings/i2c/nvidia,tegra20-i2c.txt | 87 -------- .../bindings/i2c/nvidia,tegra20-i2c.yaml | 192 ++++++++++++++++++ 2 files changed, 192 insertions(+), 87 deletions(-) delete mode 100644 Documentation/devicetree/bindings/i2c/nvidia,tegra20-i2c.txt create mode 100644 Documentation/devicetree/bindings/i2c/nvidia,tegra20-i2c.yaml diff --git a/Documentation/devicetree/bindings/i2c/nvidia,tegra20-i2c.txt b/Documentation/devicetree/bindings/i2c/nvidia,tegra20-i2c.txt deleted file mode 100644 index 3f2f990c2e62..000000000000 --- a/Documentation/devicetree/bindings/i2c/nvidia,tegra20-i2c.txt +++ /dev/null @@ -1,87 +0,0 @@ -NVIDIA Tegra20/Tegra30/Tegra114 I2C controller driver. - -Required properties: -- compatible : For Tegra20, must be one of "nvidia,tegra20-i2c-dvc" or - "nvidia,tegra20-i2c". For Tegra30, must be "nvidia,tegra30-i2c". - For Tegra114, must be "nvidia,tegra114-i2c". Otherwise, must be - "nvidia,-i2c", plus at least one of the above, where is - tegra124, tegra132, or tegra210. - Details of compatible are as follows: - nvidia,tegra20-i2c-dvc: Tegra20 has specific I2C controller called as DVC I2C - controller. This only support master mode of I2C communication. Register - interface/offset and interrupts handling are different than generic I2C - controller. Driver of DVC I2C controller is only compatible with - "nvidia,tegra20-i2c-dvc". - nvidia,tegra20-i2c: Tegra20 has 4 generic I2C controller. This can support - master and slave mode of I2C communication. The i2c-tegra driver only - support master mode of I2C communication. Driver of I2C controller is - only compatible with "nvidia,tegra20-i2c". - nvidia,tegra30-i2c: Tegra30 has 5 generic I2C controller. This controller is - very much similar to Tegra20 I2C controller with additional feature: - Continue Transfer Support. This feature helps to implement M_NO_START - as per I2C core API transfer flags. Driver of I2C controller is - compatible with "nvidia,tegra30-i2c" to enable the continue transfer - support. This is also compatible with "nvidia,tegra20-i2c" without - continue transfer support. - nvidia,tegra114-i2c: Tegra114 has 5 generic I2C controller. This controller is - very much similar to Tegra30 I2C controller with some hardware - modification: - - Tegra30/Tegra20 I2C controller has 2 clock source called div-clk and - fast-clk. Tegra114 has only one clock source called as div-clk and - hence clock mechanism is changed in I2C controller. - - Tegra30/Tegra20 I2C controller has enabled per packet transfer by - default and there is no way to disable it. Tegra114 has this - interrupt disable by default and SW need to enable explicitly. - Due to above changes, Tegra114 I2C driver makes incompatible with - previous hardware driver. Hence, tegra114 I2C controller is compatible - with "nvidia,tegra114-i2c". - nvidia,tegra210-i2c-vi: Tegra210 has one I2C controller that is on host1x bus - and is part of VE power domain and typically used for camera use-cases. - This VI I2C controller is mostly compatible with the programming model - of the regular I2C controllers with a few exceptions. The I2C registers - start at an offset of 0xc00 (instead of 0), registers are 16 bytes - apart (rather than 4) and the controller does not support slave mode. -- reg: Should contain I2C controller registers physical address and length. -- interrupts: Should contain I2C controller interrupts. -- address-cells: Address cells for I2C device address. -- size-cells: Size of the I2C device address. -- clocks: Must contain an entry for each entry in clock-names. - See ../clocks/clock-bindings.txt for details. -- clock-names: Must include the following entries: - Tegra20/Tegra30: - - div-clk - - fast-clk - Tegra114: - - div-clk - Tegra210: - - div-clk - - slow (only for nvidia,tegra210-i2c-vi compatible node) -- resets: Must contain an entry for each entry in reset-names. - See ../reset/reset.txt for details. -- reset-names: Must include the following entries: - - i2c -- power-domains: Only for nvidia,tegra210-i2c-vi compatible node and must - include venc powergate node as vi i2c is part of VE power domain. - tegra210-i2c-vi: - - pd_venc -- dmas: Must contain an entry for each entry in clock-names. - See ../dma/dma.txt for details. -- dma-names: Must include the following entries: - - rx - - tx - -Example: - - i2c@7000c000 { - compatible = "nvidia,tegra20-i2c"; - reg = <0x7000c000 0x100>; - interrupts = <0 38 0x04>; - #address-cells = <1>; - #size-cells = <0>; - clocks = <&tegra_car 12>, <&tegra_car 124>; - clock-names = "div-clk", "fast-clk"; - resets = <&tegra_car 12>; - reset-names = "i2c"; - dmas = <&apbdma 16>, <&apbdma 16>; - dma-names = "rx", "tx"; - }; diff --git a/Documentation/devicetree/bindings/i2c/nvidia,tegra20-i2c.yaml b/Documentation/devicetree/bindings/i2c/nvidia,tegra20-i2c.yaml new file mode 100644 index 000000000000..424a4fc218b6 --- /dev/null +++ b/Documentation/devicetree/bindings/i2c/nvidia,tegra20-i2c.yaml @@ -0,0 +1,192 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/i2c/nvidia,tegra20-i2c.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +maintainers: + - Thierry Reding + - Jon Hunter + +title: NVIDIA Tegra I2C controller driver + +properties: + compatible: + oneOf: + - description: Tegra20 has 4 generic I2C controller. This can support + master and slave mode of I2C communication. The i2c-tegra driver + only support master mode of I2C communication. Driver of I2C + controller is only compatible with "nvidia,tegra20-i2c". + const: nvidia,tegra20-i2c + - description: Tegra20 has specific I2C controller called as DVC I2C + controller. This only support master mode of I2C communication. + Register interface/offset and interrupts handling are different than + generic I2C controller. Driver of DVC I2C controller is only + compatible with "nvidia,tegra20-i2c-dvc". + const: nvidia,tegra20-i2c-dvc + - description: | + Tegra30 has 5 generic I2C controller. This controller is very much + similar to Tegra20 I2C controller with additional feature: Continue + Transfer Support. This feature helps to implement M_NO_START as per + I2C core API transfer flags. Driver of I2C controller is compatible + with "nvidia,tegra30-i2c" to enable the continue transfer support. + This is also compatible with "nvidia,tegra20-i2c" without continue + transfer support. + items: + - const: nvidia,tegra30-i2c + - const: nvidia,tegra20-i2c + - description: | + Tegra114 has 5 generic I2C controllers. This controller is very much + similar to Tegra30 I2C controller with some hardware modification: + - Tegra30/Tegra20 I2C controller has 2 clock source called div-clk + and fast-clk. Tegra114 has only one clock source called as + div-clk and hence clock mechanism is changed in I2C controller. + - Tegra30/Tegra20 I2C controller has enabled per packet transfer + by default and there is no way to disable it. Tegra114 has this + interrupt disable by default and SW need to enable explicitly. + Due to above changes, Tegra114 I2C driver makes incompatible with + previous hardware driver. Hence, Tegra114 I2C controller is + compatible with "nvidia,tegra114-i2c". + const: nvidia,tegra114-i2c + - description: | + Tegra124 has 6 generic I2C controllers. These controllers are very + similar to those found on Tegra114 but also contain several hardware + improvements and new registers. + const: nvidia,tegra124-i2c + - description: | + Tegra210 has 6 generic I2C controllers. These controllers are very + similar to those found on Tegra124. + items: + - const: nvidia,tegra210-i2c + - const: nvidia,tegra124-i2c + - description: | + Tegra210 has one I2C controller that is on host1x bus and is part of + the VE power domain and typically used for camera use-cases. This VI + I2C controller is mostly compatible with the programming model of + the regular I2C controllers with a few exceptions. The I2C registers + start at an offset of 0xc00 (instead of 0), registers are 16 bytes + apart (rather than 4) and the controller does not support slave + mode. + const: nvidia,tegra210-i2c-vi + - description: | + Tegra186 has 9 generic I2C controllers, two of which are in the AON + (always-on) partition of the SoC. All of these controllers are very + similar to those found on Tegra210. + const: nvidia,tegra186-i2c + - description: | + Tegra194 has 8 generic I2C controllers, two of which are in the AON + (always-on) partition of the SoC. All of these controllers are very + similar to those found on Tegra186. However, these controllers have + support for 64 KiB transactions whereas earlier chips supported no + more than 4 KiB per transactions. + const: nvidia,tegra194-i2c + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + '#address-cells': + const: 1 + + '#size-cells': + const: 0 + + clocks: + minItems: 1 + maxItems: 2 + + clock-names: + minItems: 1 + maxItems: 2 + + resets: + items: + - description: module reset + + reset-names: + items: + - const: i2c + + dmas: + items: + - description: DMA channel for the reception FIFO + - description: DMA channel for the transmission FIFO + + dma-names: + items: + - const: rx + - const: tx + +allOf: + - $ref: /schemas/i2c/i2c-controller.yaml + - if: + properties: + compatible: + contains: + enum: + - nvidia,tegra20-i2c + - nvidia,tegra30-i2c + then: + properties: + clock-names: + items: + - const: div-clk + - const: fast-clk + + - if: + properties: + compatible: + contains: + const: nvidia,tegra114-i2c + then: + properties: + clock-names: + items: + - const: div-clk + + - if: + properties: + compatible: + contains: + const: nvidia,tegra210-i2c + then: + properties: + clock-names: + items: + - const: div-clk + + - if: + properties: + compatible: + contains: + const: nvidia,tegra210-i2c-vi + then: + properties: + clock-names: + items: + - const: div-clk + - const: slow + power-domains: + items: + - description: phandle to the VENC power domain + +unevaluatedProperties: false + +examples: + - | + i2c@7000c000 { + compatible = "nvidia,tegra20-i2c"; + reg = <0x7000c000 0x100>; + interrupts = <0 38 0x04>; + clocks = <&tegra_car 12>, <&tegra_car 124>; + clock-names = "div-clk", "fast-clk"; + resets = <&tegra_car 12>; + reset-names = "i2c"; + dmas = <&apbdma 16>, <&apbdma 16>; + dma-names = "rx", "tx"; + + #address-cells = <1>; + #size-cells = <0>; + }; From patchwork Fri Dec 17 16:56:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 525614 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 3BF71C43217 for ; Fri, 17 Dec 2021 16:57:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239456AbhLQQ5M (ORCPT ); Fri, 17 Dec 2021 11:57:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239474AbhLQQ5G (ORCPT ); Fri, 17 Dec 2021 11:57:06 -0500 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97558C061574; Fri, 17 Dec 2021 08:57:05 -0800 (PST) Received: by mail-wr1-x435.google.com with SMTP id c4so5225155wrd.9; Fri, 17 Dec 2021 08:57:05 -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=BeGSgH0/1iusSqCBkWLZ3ou7TLl45XgxZ6rP3jBePhQ=; b=qBb2Bw1SZ2wAnHidarVZVyFMCC+sP5ZLYdmRA3a9QEW5emyw2oMTRFzXhZ/YHGM3dJ 4NOv//gbN4/EenJmXBVYs2O1mlJsQDrJq1jBXclwhcKPNt7b+EEDT/RMCVXIHiBgfM/M l1t1fuK1toWGl4dYc3rvwqnEJD3qzHO5S0ESp0QiMZT7rG08V2i07DUq0uCDqz0KC1Wr hMcMxDVn9vLCmmEgqKk1AvvZWI2pOlTgvJxNeCHaBTQyuymmv97ClyM0k/OD9mbnvGXq bEiWcBZpgyKjiMzNbKncYZodSl1k6GSCNoS1aykl9CEidv1w+hRLiWYgEQbqv2R7Cvsu uMsw== 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=BeGSgH0/1iusSqCBkWLZ3ou7TLl45XgxZ6rP3jBePhQ=; b=UtuMgpHixip1Zgs5uVtqoZ98uYKyVnO7ReGFBdKAhwsFZQDq5iulBSsSrR1N2hxVXQ Rl5vwFY66Xnq3YZsbGLBBZbJ0yB9INMQ+WMy+BOoSRtQV7Br7/WqPMnWnfvj9M+X/swF owduykmgzlPjzzNODeEfUVRSqj7dfnGB8YvLDq4624J+qD3SykZgvdk9d6nOHspu5PSv Jx9TeZseMFlJqY6tqX7FXWAUgwk1kGfUlmY7uoDwyiwH4gxd4ntGW60uLqbnKGlsxKf1 DfV4zsx9Q9f+s3UnhKMbvJQZwojFFtkBK+Nn5ZaVlVcfnqrj8jjkmvGyp2yKbseLwYdc mf3Q== X-Gm-Message-State: AOAM533/laPyL2eIEcZ5wfdVBTG2NIhkWjkXgQkBXlM73+4a1QourPkc sQEJBhrtz9Yz89tTy0y56lk= X-Google-Smtp-Source: ABdhPJxtTLtWv6hh2DO/WkAyrYehzrLr2jS7YVKAoEPzsLwNwp6dzvwYqVem2SQXww+CPJLNWGP6zg== X-Received: by 2002:a05:6000:1869:: with SMTP id d9mr3221391wri.416.1639760223705; Fri, 17 Dec 2021 08:57:03 -0800 (PST) Received: from localhost ([193.209.96.43]) by smtp.gmail.com with ESMTPSA id a10sm12434423wmq.27.2021.12.17.08.57.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Dec 2021 08:57:02 -0800 (PST) From: Thierry Reding To: Wolfram Sang , Rob Herring Cc: Peter Rosin , Andrew Jeffery , Brendan Higgins , Benjamin Herrenschmidt , Joel Stanley , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH 2/4] dt-bindings: i2c: i2c-mux-pinctrl: Convert to json-schema Date: Fri, 17 Dec 2021 17:56:56 +0100 Message-Id: <20211217165658.2650677-2-thierry.reding@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211217165658.2650677-1-thierry.reding@gmail.com> References: <20211217165658.2650677-1-thierry.reding@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org From: Thierry Reding Convert the pinctrl-based I2C mux bindings from the free-form text format to json-schema. Signed-off-by: Thierry Reding --- .../bindings/i2c/i2c-mux-pinctrl.txt | 93 ---------------- .../bindings/i2c/i2c-mux-pinctrl.yaml | 103 ++++++++++++++++++ 2 files changed, 103 insertions(+), 93 deletions(-) delete mode 100644 Documentation/devicetree/bindings/i2c/i2c-mux-pinctrl.txt create mode 100644 Documentation/devicetree/bindings/i2c/i2c-mux-pinctrl.yaml diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-pinctrl.txt b/Documentation/devicetree/bindings/i2c/i2c-mux-pinctrl.txt deleted file mode 100644 index 997a287ed3f6..000000000000 --- a/Documentation/devicetree/bindings/i2c/i2c-mux-pinctrl.txt +++ /dev/null @@ -1,93 +0,0 @@ -Pinctrl-based I2C Bus Mux - -This binding describes an I2C bus multiplexer that uses pin multiplexing to -route the I2C signals, and represents the pin multiplexing configuration -using the pinctrl device tree bindings. - - +-----+ +-----+ - | dev | | dev | - +------------------------+ +-----+ +-----+ - | SoC | | | - | /----|------+--------+ - | +---+ +------+ | child bus A, on first set of pins - | |I2C|---|Pinmux| | - | +---+ +------+ | child bus B, on second set of pins - | \----|------+--------+--------+ - | | | | | - +------------------------+ +-----+ +-----+ +-----+ - | dev | | dev | | dev | - +-----+ +-----+ +-----+ - -Required properties: -- compatible: i2c-mux-pinctrl -- i2c-parent: The phandle of the I2C bus that this multiplexer's master-side - port is connected to. - -Also required are: - -* Standard pinctrl properties that specify the pin mux state for each child - bus. See ../pinctrl/pinctrl-bindings.txt. - -* Standard I2C mux properties. See i2c-mux.yaml in this directory. - -* I2C child bus nodes. See i2c-mux.yaml in this directory. - -For each named state defined in the pinctrl-names property, an I2C child bus -will be created. I2C child bus numbers are assigned based on the index into -the pinctrl-names property. - -The only exception is that no bus will be created for a state named "idle". If -such a state is defined, it must be the last entry in pinctrl-names. For -example: - - pinctrl-names = "ddc", "pta", "idle" -> ddc = bus 0, pta = bus 1 - pinctrl-names = "ddc", "idle", "pta" -> Invalid ("idle" not last) - pinctrl-names = "idle", "ddc", "pta" -> Invalid ("idle" not last) - -Whenever an access is made to a device on a child bus, the relevant pinctrl -state will be programmed into hardware. - -If an idle state is defined, whenever an access is not being made to a device -on a child bus, the idle pinctrl state will be programmed into hardware. - -If an idle state is not defined, the most recently used pinctrl state will be -left programmed into hardware whenever no access is being made of a device on -a child bus. - -Example: - - i2cmux { - compatible = "i2c-mux-pinctrl"; - #address-cells = <1>; - #size-cells = <0>; - - i2c-parent = <&i2c1>; - - pinctrl-names = "ddc", "pta", "idle"; - pinctrl-0 = <&state_i2cmux_ddc>; - pinctrl-1 = <&state_i2cmux_pta>; - pinctrl-2 = <&state_i2cmux_idle>; - - i2c@0 { - reg = <0>; - #address-cells = <1>; - #size-cells = <0>; - - eeprom { - compatible = "eeprom"; - reg = <0x50>; - }; - }; - - i2c@1 { - reg = <1>; - #address-cells = <1>; - #size-cells = <0>; - - eeprom { - compatible = "eeprom"; - reg = <0x50>; - }; - }; - }; - diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-pinctrl.yaml b/Documentation/devicetree/bindings/i2c/i2c-mux-pinctrl.yaml new file mode 100644 index 000000000000..2e3d555eb96c --- /dev/null +++ b/Documentation/devicetree/bindings/i2c/i2c-mux-pinctrl.yaml @@ -0,0 +1,103 @@ +# SPDX-License-Identifier: GPL-2.0-only +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/i2c/i2c-mux-pinctrl.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Pinctrl-based I2C Bus Mux + +maintainers: + - Wolfram Sang + +description: | + This binding describes an I2C bus multiplexer that uses pin multiplexing to route the I2C + signals, and represents the pin multiplexing configuration using the pinctrl device tree + bindings. + + +-----+ +-----+ + | dev | | dev | + +------------------------+ +-----+ +-----+ + | SoC | | | + | /----|------+--------+ + | +---+ +------+ | child bus A, on first set of pins + | |I2C|---|Pinmux| | + | +---+ +------+ | child bus B, on second set of pins + | \----|------+--------+--------+ + | | | | | + +------------------------+ +-----+ +-----+ +-----+ + | dev | | dev | | dev | + +-----+ +-----+ +-----+ + + For each named state defined in the pinctrl-names property, an I2C child bus will be created. + I2C child bus numbers are assigned based on the index into the pinctrl-names property. + + The only exception is that no bus will be created for a state named "idle". If such a state is + defined, it must be the last entry in pinctrl-names. For example: + + pinctrl-names = "ddc", "pta", "idle" -> ddc = bus 0, pta = bus 1 + pinctrl-names = "ddc", "idle", "pta" -> Invalid ("idle" not last) + pinctrl-names = "idle", "ddc", "pta" -> Invalid ("idle" not last) + + Whenever an access is made to a device on a child bus, the relevant pinctrl state will be + programmed into hardware. + + If an idle state is defined, whenever an access is not being made to a device on a child bus, + the idle pinctrl state will be programmed into hardware. + + If an idle state is not defined, the most recently used pinctrl state will be left programmed + into hardware whenever no access is being made of a device on a child bus. + +properties: + compatible: + const: i2c-mux-pinctrl + + i2c-parent: + $ref: /schemas/types.yaml#/definitions/phandle + description: The phandle of the I2C bus that this multiplexer's master-side port is connected + to. + +allOf: + - $ref: i2c-mux.yaml + +unevaluatedProperties: false + +required: + - compatible + - i2c-parent + +examples: + - | + i2cmux { + compatible = "i2c-mux-pinctrl"; + #address-cells = <1>; + #size-cells = <0>; + + i2c-parent = <&i2c1>; + + pinctrl-names = "ddc", "pta", "idle"; + pinctrl-0 = <&state_i2cmux_ddc>; + pinctrl-1 = <&state_i2cmux_pta>; + pinctrl-2 = <&state_i2cmux_idle>; + + i2c@0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + + eeprom@50 { + compatible = "atmel,24c02"; + reg = <0x50>; + }; + }; + + i2c@1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + + eeprom@50 { + compatible = "atmel,24c02"; + reg = <0x50>; + }; + }; + }; From patchwork Fri Dec 17 16:56:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 525301 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 845D2C43219 for ; Fri, 17 Dec 2021 16:57:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239461AbhLQQ5M (ORCPT ); Fri, 17 Dec 2021 11:57:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239481AbhLQQ5H (ORCPT ); Fri, 17 Dec 2021 11:57:07 -0500 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A48CC061574; Fri, 17 Dec 2021 08:57:07 -0800 (PST) Received: by mail-wm1-x334.google.com with SMTP id a83-20020a1c9856000000b00344731e044bso1945522wme.1; Fri, 17 Dec 2021 08:57:07 -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=+SD4ZFM2uj2rtOINnzlRwjIYdkxm3Tv0C5VQwp/gCfo=; b=cWkuQGweSPIo02s+Lr2GpswkTLX/UqpBt1I2Qll5UVRYFsX+8BeRQtVcuNxs1Bn5Jw kbmSK6oNaQprM6Kpv141GLli0C5MxTPOf2jc36mYFsZSejU3hal3xu4T1GwOWM6RBrxI +PuG04zUU84lYJeqpABS3svs+J4/HcIuVC7ZS+QtXhagtOoS0u7n9gSFCzRzurgWLDQf 3L5NS7IVDef4D7ObyApCSsruaLYxURRf0zpNJT9MS8+nn1K8yPakok++tnlB+Zbl5KJi M2vgFe64qt87m7EPE3BgsYRr6KzeqRRkf5dpmeY/SDKvER893gkXkPQ3/cqEr3jFG6D8 qmsA== 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=+SD4ZFM2uj2rtOINnzlRwjIYdkxm3Tv0C5VQwp/gCfo=; b=qZxvDmKn34lMB7Ys+g/95JYZwW02mqUtpPYq9zDt3f5gJH3mDJ6APWwarCFDNMwcjC mzsKxQCtOYXFu0+LuESzGxThIGeU15kBh/BO4OQj96nAmxe23Po1VIAnaxErSt0fxbWb K8u58UDLDndRFZc1a+C7J3AORsBZ66drXZemXovOeretUVhk88/XfTlXeAxcgDjk0u+d r/1gIfCLCUOFYMQNlidV5fbGk1SsK2tRVA1RZav+C8Vi4XhrrYI6USUYNs0+LDobkhE8 3utPUgAU8Wwk2nx1erfnkw6cMgn+nEC+QNTuH41+XPBuxL+rcoiLl8n3kU75Z4oAnI5c zTog== X-Gm-Message-State: AOAM532PVgZo8Pmzv//sEJ4t8QicO6ywYVlcXOaJlyCJ0CMvOV3kTQYY KG1FqbxDdS/lGxcNxaDCyMA= X-Google-Smtp-Source: ABdhPJxEMG5C4v2prpIyTasLaZH4YeEs2wf+fq/aebUYuhwDDxQMuYPl1QzBaoyBHKyI50EjQWcBXA== X-Received: by 2002:a1c:4b0e:: with SMTP id y14mr10072509wma.170.1639760225963; Fri, 17 Dec 2021 08:57:05 -0800 (PST) Received: from localhost ([193.209.96.43]) by smtp.gmail.com with ESMTPSA id l7sm9226599wry.86.2021.12.17.08.57.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Dec 2021 08:57:05 -0800 (PST) From: Thierry Reding To: Wolfram Sang , Rob Herring Cc: Peter Rosin , Andrew Jeffery , Brendan Higgins , Benjamin Herrenschmidt , Joel Stanley , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH 3/4] dt-bindings: i2c: aspeed: Document interrupt controller properties Date: Fri, 17 Dec 2021 17:56:57 +0100 Message-Id: <20211217165658.2650677-3-thierry.reding@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211217165658.2650677-1-thierry.reding@gmail.com> References: <20211217165658.2650677-1-thierry.reding@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org From: Thierry Reding Document the interrupt-controller and #interrupt-cells properties that are used by some instances of the aspeed-i2c device tree nodes. Signed-off-by: Thierry Reding --- Documentation/devicetree/bindings/i2c/aspeed,i2c.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/i2c/aspeed,i2c.yaml b/Documentation/devicetree/bindings/i2c/aspeed,i2c.yaml index f597f73ccd87..2a74551c72c0 100644 --- a/Documentation/devicetree/bindings/i2c/aspeed,i2c.yaml +++ b/Documentation/devicetree/bindings/i2c/aspeed,i2c.yaml @@ -28,6 +28,12 @@ properties: interrupts: maxItems: 1 + interrupt-controller: + description: marks this device as being an interrupt provider + + "#interrupt-cells": + const: 1 + clocks: maxItems: 1 description: From patchwork Fri Dec 17 16:56:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 525613 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 B858EC41535 for ; Fri, 17 Dec 2021 16:57:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239466AbhLQQ5N (ORCPT ); Fri, 17 Dec 2021 11:57:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239493AbhLQQ5K (ORCPT ); Fri, 17 Dec 2021 11:57:10 -0500 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC669C06173E; Fri, 17 Dec 2021 08:57:09 -0800 (PST) Received: by mail-wr1-x435.google.com with SMTP id j9so5350360wrc.0; Fri, 17 Dec 2021 08:57:09 -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=WboeJlq4Ag0dTLAKyPot7SLPdxAUZgDwzBIZKe1IUWo=; b=Qbqo3XauPx0m5BaAQDHLPcmptqRt7OFi3e4HMyjO3WLPLAQl+vPg2LfoBklW+OHnq2 hETgiQh7SzUGII1mxotCRLpBmT8fvGU51ziUb9IEankr1VgTQR9Jz11TOuB8t1Gsyc3m Dq+q1QSnMgkb+AzJo7X3bBeWZtDJMnITpQmcfJYv52hYp7QwFk1uCUwyNlqLzPqqxD7c URcTAGWc5/WvjVHOFFKyttOMOohX+KqxgV9qjZwWeagFNoottmQ1/W4RMdH+EZaCUtxH VwZviWBNcVCLrQXCKUPLniJymHX6dsbjunDcy+vorN34dWu1J8Y1F45UJVaWFDsX4eyj 94Nw== 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=WboeJlq4Ag0dTLAKyPot7SLPdxAUZgDwzBIZKe1IUWo=; b=S0eJIj4Xt6dKpdwmtC8Q3taBSzLptd0Qj+td48Vve5YiChgQkotbENUCB+kJJDxa9Y qSJTEOD3mqaWuFj4DEb2JGNCpxQrqC+x8kuDg+NSzSYhN1NuFSzK2fmgnTpgeu2s/jnD u0RlXHeeOKYu8ewAxVh0fYdqH2DKhX9bk+kGEY7WtinWfHB499pInjF6fFLkl/vOCoxs QOAV4bPce+CZ3RoU7B7fdRxPsebVizj3ttAuDNOaBmdI/TJyb5FASw8vi+U5cjyN1hU0 8YR+OknIeWJB1wHxSApso34wN8UCw7nJJWXeIJOYtaDKxN5+NSYcMikgxUYRwojOKOC7 1nbA== X-Gm-Message-State: AOAM532vFNEPirUzNAa5ZeR+ChXJGlJKh4GXQQFU/2CRikpiTUbQuAWV z6GFslE7agUwPz98b1ytQgk= X-Google-Smtp-Source: ABdhPJy12D5WSDcI6loU/vkxHPUEnVX83xls4Ndy/OfZIesKwodgnaRUntC1UH6rui+31zWpc8JgtQ== X-Received: by 2002:adf:9d4c:: with SMTP id o12mr3254714wre.283.1639760228366; Fri, 17 Dec 2021 08:57:08 -0800 (PST) Received: from localhost ([193.209.96.43]) by smtp.gmail.com with ESMTPSA id e4sm6798987wrh.56.2021.12.17.08.57.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Dec 2021 08:57:07 -0800 (PST) From: Thierry Reding To: Wolfram Sang , Rob Herring Cc: Peter Rosin , Andrew Jeffery , Brendan Higgins , Benjamin Herrenschmidt , Joel Stanley , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH 4/4] dt-bindings: i2c: i2c-mux-gpio: Convert to json-schema Date: Fri, 17 Dec 2021 17:56:58 +0100 Message-Id: <20211217165658.2650677-4-thierry.reding@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211217165658.2650677-1-thierry.reding@gmail.com> References: <20211217165658.2650677-1-thierry.reding@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org From: Thierry Reding Convert the GPIO-based I2C mux bindings from the free-form text format to json-schema. Signed-off-by: Thierry Reding --- .../devicetree/bindings/i2c/i2c-mux-gpio.txt | 80 -------------- .../devicetree/bindings/i2c/i2c-mux-gpio.yaml | 103 ++++++++++++++++++ 2 files changed, 103 insertions(+), 80 deletions(-) delete mode 100644 Documentation/devicetree/bindings/i2c/i2c-mux-gpio.txt create mode 100644 Documentation/devicetree/bindings/i2c/i2c-mux-gpio.yaml diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-gpio.txt b/Documentation/devicetree/bindings/i2c/i2c-mux-gpio.txt deleted file mode 100644 index d4cf10582a26..000000000000 --- a/Documentation/devicetree/bindings/i2c/i2c-mux-gpio.txt +++ /dev/null @@ -1,80 +0,0 @@ -GPIO-based I2C Bus Mux - -This binding describes an I2C bus multiplexer that uses GPIOs to -route the I2C signals. - - +-----+ +-----+ - | dev | | dev | - +------------+ +-----+ +-----+ - | SoC | | | - | | /--------+--------+ - | +------+ | +------+ child bus A, on GPIO value set to 0 - | | I2C |-|--| Mux | - | +------+ | +--+---+ child bus B, on GPIO value set to 1 - | | | \----------+--------+--------+ - | +------+ | | | | | - | | GPIO |-|-----+ +-----+ +-----+ +-----+ - | +------+ | | dev | | dev | | dev | - +------------+ +-----+ +-----+ +-----+ - -Required properties: -- compatible: i2c-mux-gpio -- i2c-parent: The phandle of the I2C bus that this multiplexer's master-side - port is connected to. -- mux-gpios: list of gpios used to control the muxer -* Standard I2C mux properties. See i2c-mux.yaml in this directory. -* I2C child bus nodes. See i2c-mux.yaml in this directory. - -Optional properties: -- idle-state: value to set the muxer to when idle. When no value is - given, it defaults to the last value used. - -For each i2c child node, an I2C child bus will be created. They will -be numbered based on their order in the device tree. - -Whenever an access is made to a device on a child bus, the value set -in the relevant node's reg property will be output using the list of -GPIOs, the first in the list holding the least-significant value. - -If an idle state is defined, using the idle-state (optional) property, -whenever an access is not being made to a device on a child bus, the -GPIOs will be set according to the idle value. - -If an idle state is not defined, the most recently used value will be -left programmed into hardware whenever no access is being made to a -device on a child bus. - -Example: - i2cmux { - compatible = "i2c-mux-gpio"; - #address-cells = <1>; - #size-cells = <0>; - mux-gpios = <&gpio1 22 0 &gpio1 23 0>; - i2c-parent = <&i2c1>; - - i2c@1 { - reg = <1>; - #address-cells = <1>; - #size-cells = <0>; - - ssd1307: oled@3c { - compatible = "solomon,ssd1307fb-i2c"; - reg = <0x3c>; - pwms = <&pwm 4 3000>; - reset-gpios = <&gpio2 7 1>; - }; - }; - - i2c@3 { - reg = <3>; - #address-cells = <1>; - #size-cells = <0>; - - pca9555: pca9555@20 { - compatible = "nxp,pca9555"; - gpio-controller; - #gpio-cells = <2>; - reg = <0x20>; - }; - }; - }; diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-gpio.yaml b/Documentation/devicetree/bindings/i2c/i2c-mux-gpio.yaml new file mode 100644 index 000000000000..6934a445e226 --- /dev/null +++ b/Documentation/devicetree/bindings/i2c/i2c-mux-gpio.yaml @@ -0,0 +1,103 @@ +# SPDX-License-Identifier: GPL-2.0-only +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/i2c/i2c-mux-gpio.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: GPIO-based I2C Bus Mux + +maintainers: + - Wolfram Sang + +description: | + This binding describes an I2C bus multiplexer that uses GPIOs to route the I2C signals. + + +-----+ +-----+ + | dev | | dev | + +------------+ +-----+ +-----+ + | SoC | | | + | | /--------+--------+ + | +------+ | +------+ child bus A, on GPIO value set to 0 + | | I2C |-|--| Mux | + | +------+ | +--+---+ child bus B, on GPIO value set to 1 + | | | \----------+--------+--------+ + | +------+ | | | | | + | | GPIO |-|-----+ +-----+ +-----+ +-----+ + | +------+ | | dev | | dev | | dev | + +------------+ +-----+ +-----+ +-----+ + + For each I2C child node, an I2C child bus will be created. They will be numbered based on their + order in the device tree. + + Whenever an access is made to a device on a child bus, the value set in the relevant node's reg + property will be output using the list of GPIOs, the first in the list holding the least- + significant value. + + If an idle state is defined, using the idle-state (optional) property, whenever an access is not + being made to a device on a child bus, the GPIOs will be set according to the idle value. + + If an idle state is not defined, the most recently used value will be left programmed into + hardware whenever no access is being made to a device on a child bus. + +properties: + compatible: + const: i2c-mux-gpio + + i2c-parent: + description: phandle of the I2C bus that this multiplexer's master-side port is connected to + $ref: "/schemas/types.yaml#/definitions/phandle" + + mux-gpios: + description: list of GPIOs used to control the muxer + $ref: "/schemas/types.yaml#/definitions/phandle-array" + + idle-state: + description: Value to set the muxer to when idle. When no value is given, it defaults to the + last value used. + $ref: "/schemas/types.yaml#/definitions/uint32" + +allOf: + - $ref: i2c-mux.yaml + +unevaluatedProperties: false + +required: + - compatible + - i2c-parent + - mux-gpios + +examples: + - | + i2cmux { + compatible = "i2c-mux-gpio"; + #address-cells = <1>; + #size-cells = <0>; + mux-gpios = <&gpio1 22 0 &gpio1 23 0>; + i2c-parent = <&i2c1>; + + i2c@1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + + ssd1307: oled@3c { + compatible = "solomon,ssd1307fb-i2c"; + reg = <0x3c>; + pwms = <&pwm 4 3000>; + reset-gpios = <&gpio2 7 1>; + }; + }; + + i2c@3 { + reg = <3>; + #address-cells = <1>; + #size-cells = <0>; + + pca9555: pca9555@20 { + compatible = "nxp,pca9555"; + gpio-controller; + #gpio-cells = <2>; + reg = <0x20>; + }; + }; + };