linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] dt-bindings: Convert mux bindings to schema
@ 2021-05-18 23:28 Rob Herring
  2021-05-18 23:28 ` [PATCH 1/6] dt-bindings: mfd: ti,j721e-system-controller: Fix mux node errors Rob Herring
                   ` (5 more replies)
  0 siblings, 6 replies; 20+ messages in thread
From: Rob Herring @ 2021-05-18 23:28 UTC (permalink / raw)
  To: devicetree, Peter Rosin, Wolfram Sang
  Cc: linux-kernel, Alexandre Belloni, Jacopo Mondi, Kieran Bingham,
	Kishon Vijay Abraham I, Laurent Pinchart, Lee Jones,
	Niklas Söderlund, Roger Quadros, Jonathan Cameron

This series converts the mux-controller and some i2c mux bindings to DT
schema. This was a rabbit hole of trying to fix undocumented (by schema)
compatibles (enabled by setting DT_CHECKER_FLAGS=-m). So this is mux
bindings, and then a few others that are used in the mux binding
examples.

The mdio and iio mux bindings still need to be done. Patches welcome.TM

It's probably easiest if I take the whole series.

Rob

Rob Herring (6):
  dt-bindings: mfd: ti,j721e-system-controller: Fix mux node errors
  dt-bindings: rtc: nxp,pcf8563: Convert to DT schema
  dt-bindings: mux: Convert mux controller bindings to schema
  dt-bindings: i2c: Convert i2c-mux bindings to DT schema
  dt-bindings: i2c: i2c-mux-pca954x: Convert to DT schema
  dt-bindings: i2c: maxim,max9286: Use the i2c-mux.yaml schema

 .../bindings/i2c/i2c-demux-pinctrl.txt        |   2 +-
 .../devicetree/bindings/i2c/i2c-mux-gpio.txt  |   4 +-
 .../devicetree/bindings/i2c/i2c-mux-gpmux.txt |  99 ----------
 .../bindings/i2c/i2c-mux-gpmux.yaml           | 124 ++++++++++++
 .../bindings/i2c/i2c-mux-ltc4306.txt          |   4 +-
 .../bindings/i2c/i2c-mux-pca954x.txt          |  74 -------
 .../bindings/i2c/i2c-mux-pca954x.yaml         | 106 ++++++++++
 .../bindings/i2c/i2c-mux-pinctrl.txt          |   4 +-
 .../devicetree/bindings/i2c/i2c-mux-reg.txt   |   4 +-
 .../devicetree/bindings/i2c/i2c-mux.txt       |  73 -------
 .../devicetree/bindings/i2c/i2c-mux.yaml      |  87 +++++++++
 .../iio/multiplexer/io-channel-mux.txt        |   2 +-
 .../bindings/media/i2c/maxim,max9286.yaml     |  23 +--
 .../mfd/ti,j721e-system-controller.yaml       |  19 +-
 .../devicetree/bindings/mtd/ti,am654-hbmc.txt |   2 +-
 .../devicetree/bindings/mux/adi,adg792a.txt   |   2 +-
 .../devicetree/bindings/mux/adi,adgs1408.txt  |   2 +-
 .../devicetree/bindings/mux/gpio-mux.txt      |  69 -------
 .../devicetree/bindings/mux/gpio-mux.yaml     |  92 +++++++++
 .../devicetree/bindings/mux/mux-consumer.yaml |  46 +++++
 .../bindings/mux/mux-controller.txt           | 157 ---------------
 .../bindings/mux/mux-controller.yaml          | 182 ++++++++++++++++++
 .../devicetree/bindings/mux/reg-mux.txt       | 129 -------------
 .../devicetree/bindings/mux/reg-mux.yaml      | 143 ++++++++++++++
 .../bindings/net/mdio-mux-multiplexer.txt     |   2 +-
 .../devicetree/bindings/rtc/nxp,pcf8563.yaml  |  50 +++++
 .../devicetree/bindings/rtc/pcf8563.txt       |  29 ---
 27 files changed, 860 insertions(+), 670 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.txt
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.yaml
 delete mode 100644 Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.txt
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.yaml
 delete mode 100644 Documentation/devicetree/bindings/i2c/i2c-mux.txt
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-mux.yaml
 delete mode 100644 Documentation/devicetree/bindings/mux/gpio-mux.txt
 create mode 100644 Documentation/devicetree/bindings/mux/gpio-mux.yaml
 create mode 100644 Documentation/devicetree/bindings/mux/mux-consumer.yaml
 delete mode 100644 Documentation/devicetree/bindings/mux/mux-controller.txt
 create mode 100644 Documentation/devicetree/bindings/mux/mux-controller.yaml
 delete mode 100644 Documentation/devicetree/bindings/mux/reg-mux.txt
 create mode 100644 Documentation/devicetree/bindings/mux/reg-mux.yaml
 create mode 100644 Documentation/devicetree/bindings/rtc/nxp,pcf8563.yaml
 delete mode 100644 Documentation/devicetree/bindings/rtc/pcf8563.txt

-- 
2.27.0


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH 1/6] dt-bindings: mfd: ti,j721e-system-controller: Fix mux node errors
  2021-05-18 23:28 [PATCH 0/6] dt-bindings: Convert mux bindings to schema Rob Herring
@ 2021-05-18 23:28 ` Rob Herring
  2021-05-19 15:00   ` Lee Jones
  2021-05-20 14:41   ` Kishon Vijay Abraham I
  2021-05-18 23:28 ` [PATCH 2/6] dt-bindings: rtc: nxp,pcf8563: Convert to DT schema Rob Herring
                   ` (4 subsequent siblings)
  5 siblings, 2 replies; 20+ messages in thread
From: Rob Herring @ 2021-05-18 23:28 UTC (permalink / raw)
  To: devicetree, Peter Rosin, Wolfram Sang
  Cc: linux-kernel, Alexandre Belloni, Jacopo Mondi, Kieran Bingham,
	Kishon Vijay Abraham I, Laurent Pinchart, Lee Jones,
	Niklas Söderlund, Roger Quadros, Jonathan Cameron

The ti,j721e-system-controller binding does not follow the standard mux
controller node name 'mux-controller' and the example is incomplete. Fix
these to avoid schema errors before the mux controller binding is
converted to schema.

Cc: Lee Jones <lee.jones@linaro.org>
Cc: Kishon Vijay Abraham I <kishon@ti.com>
Cc: Roger Quadros <rogerq@ti.com>
Signed-off-by: Rob Herring <robh@kernel.org>
---
 .../mfd/ti,j721e-system-controller.yaml       | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/Documentation/devicetree/bindings/mfd/ti,j721e-system-controller.yaml b/Documentation/devicetree/bindings/mfd/ti,j721e-system-controller.yaml
index 19fcf59fd2fe..272832e9f8f2 100644
--- a/Documentation/devicetree/bindings/mfd/ti,j721e-system-controller.yaml
+++ b/Documentation/devicetree/bindings/mfd/ti,j721e-system-controller.yaml
@@ -43,12 +43,10 @@ properties:
 
 patternProperties:
   # Optional children
-  "^serdes-ln-ctrl@[0-9a-f]+$":
+  "^mux-controller@[0-9a-f]+$":
     type: object
-    description: |
-      This is the SERDES lane control mux. It should follow the bindings
-      specified in
-      Documentation/devicetree/bindings/mux/reg-mux.txt
+    description:
+      This is the SERDES lane control mux.
 
 required:
   - compatible
@@ -68,9 +66,18 @@ examples:
         #size-cells = <1>;
         ranges;
 
-        serdes_ln_ctrl: serdes-ln-ctrl@4080 {
+        serdes_ln_ctrl: mux-controller@4080 {
             compatible = "mmio-mux";
             reg = <0x00004080 0x50>;
+
+            #mux-control-cells = <1>;
+            mux-reg-masks =
+                <0x4080 0x3>, <0x4084 0x3>, /* SERDES0 lane0/1 select */
+                <0x4090 0x3>, <0x4094 0x3>, /* SERDES1 lane0/1 select */
+                <0x40a0 0x3>, <0x40a4 0x3>, /* SERDES2 lane0/1 select */
+                <0x40b0 0x3>, <0x40b4 0x3>, /* SERDES3 lane0/1 select */
+                <0x40c0 0x3>, <0x40c4 0x3>, <0x40c8 0x3>, <0x40cc 0x3>;
+                /* SERDES4 lane0/1/2/3 select */
         };
     };
 ...
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 2/6] dt-bindings: rtc: nxp,pcf8563: Convert to DT schema
  2021-05-18 23:28 [PATCH 0/6] dt-bindings: Convert mux bindings to schema Rob Herring
  2021-05-18 23:28 ` [PATCH 1/6] dt-bindings: mfd: ti,j721e-system-controller: Fix mux node errors Rob Herring
@ 2021-05-18 23:28 ` Rob Herring
  2021-05-19  1:25   ` Laurent Pinchart
  2021-05-25 21:27   ` Alexandre Belloni
  2021-05-18 23:28 ` [PATCH 3/6] dt-bindings: mux: Convert mux controller bindings to schema Rob Herring
                   ` (3 subsequent siblings)
  5 siblings, 2 replies; 20+ messages in thread
From: Rob Herring @ 2021-05-18 23:28 UTC (permalink / raw)
  To: devicetree, Peter Rosin, Wolfram Sang
  Cc: linux-kernel, Alexandre Belloni, Jacopo Mondi, Kieran Bingham,
	Kishon Vijay Abraham I, Laurent Pinchart, Lee Jones,
	Niklas Söderlund, Roger Quadros, Jonathan Cameron

Convert the Philips PCF8563/Epson RTC8564 binding to DT schema format.

Add 'interrupts' as this device has an interrupt which was not
documented, but in use.

Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Rob Herring <robh@kernel.org>
---
 .../devicetree/bindings/rtc/nxp,pcf8563.yaml  | 50 +++++++++++++++++++
 .../devicetree/bindings/rtc/pcf8563.txt       | 29 -----------
 2 files changed, 50 insertions(+), 29 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/rtc/nxp,pcf8563.yaml
 delete mode 100644 Documentation/devicetree/bindings/rtc/pcf8563.txt

diff --git a/Documentation/devicetree/bindings/rtc/nxp,pcf8563.yaml b/Documentation/devicetree/bindings/rtc/nxp,pcf8563.yaml
new file mode 100644
index 000000000000..15e67be0ef95
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/nxp,pcf8563.yaml
@@ -0,0 +1,50 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/rtc/nxp,pcf8563.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Philips PCF8563/Epson RTC8564 Real Time Clock
+
+maintainers:
+  - Alexandre Belloni <alexandre.belloni@bootlin.com>
+
+properties:
+  compatible:
+    enum:
+      - epson,rtc8564
+      - microcrystal,rv8564
+      - nxp,pcf8563
+      - nxp,pca8565
+
+  reg:
+    maxItems: 1
+
+  "#clock-cells":
+    const: 0
+
+  clock-output-names:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        rtc@51 {
+            compatible = "nxp,pcf8563";
+            reg = <0x51>;
+            #clock-cells = <0>;
+        };
+    };
+...
diff --git a/Documentation/devicetree/bindings/rtc/pcf8563.txt b/Documentation/devicetree/bindings/rtc/pcf8563.txt
deleted file mode 100644
index 0a900f7c8977..000000000000
--- a/Documentation/devicetree/bindings/rtc/pcf8563.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-* Philips PCF8563/Epson RTC8564 Real Time Clock
-
-Philips PCF8563/Epson RTC8564 Real Time Clock
-
-Required properties:
-- compatible: Should contain "nxp,pcf8563",
-	"epson,rtc8564" or
-	"microcrystal,rv8564" or
-	"nxp,pca8565"
-- reg: I2C address for chip.
-
-Optional property:
-- #clock-cells: Should be 0.
-- clock-output-names:
-  overwrite the default clock name "pcf8563-clkout"
-
-Example:
-
-pcf8563: pcf8563@51 {
-	compatible = "nxp,pcf8563";
-	reg = <0x51>;
-	#clock-cells = <0>;
-};
-
-device {
-...
-	clocks = <&pcf8563>;
-...
-};
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 3/6] dt-bindings: mux: Convert mux controller bindings to schema
  2021-05-18 23:28 [PATCH 0/6] dt-bindings: Convert mux bindings to schema Rob Herring
  2021-05-18 23:28 ` [PATCH 1/6] dt-bindings: mfd: ti,j721e-system-controller: Fix mux node errors Rob Herring
  2021-05-18 23:28 ` [PATCH 2/6] dt-bindings: rtc: nxp,pcf8563: Convert to DT schema Rob Herring
@ 2021-05-18 23:28 ` Rob Herring
  2021-05-22 10:41   ` Jonathan Cameron
  2021-05-18 23:28 ` [PATCH 4/6] dt-bindings: i2c: Convert i2c-mux bindings to DT schema Rob Herring
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 20+ messages in thread
From: Rob Herring @ 2021-05-18 23:28 UTC (permalink / raw)
  To: devicetree, Peter Rosin, Wolfram Sang
  Cc: linux-kernel, Alexandre Belloni, Jacopo Mondi, Kieran Bingham,
	Kishon Vijay Abraham I, Laurent Pinchart, Lee Jones,
	Niklas Söderlund, Roger Quadros, Jonathan Cameron

Convert the mux controller bindings to DT schema.

Cc: Peter Rosin <peda@axentia.se>
Signed-off-by: Rob Herring <robh@kernel.org>
---
 .../devicetree/bindings/i2c/i2c-mux-gpmux.txt |   2 +-
 .../bindings/i2c/i2c-mux-pca954x.txt          |   2 +-
 .../iio/multiplexer/io-channel-mux.txt        |   2 +-
 .../devicetree/bindings/mtd/ti,am654-hbmc.txt |   2 +-
 .../devicetree/bindings/mux/adi,adg792a.txt   |   2 +-
 .../devicetree/bindings/mux/adi,adgs1408.txt  |   2 +-
 .../devicetree/bindings/mux/gpio-mux.txt      |  69 -------
 .../devicetree/bindings/mux/gpio-mux.yaml     |  92 +++++++++
 .../devicetree/bindings/mux/mux-consumer.yaml |  46 +++++
 .../bindings/mux/mux-controller.txt           | 157 ---------------
 .../bindings/mux/mux-controller.yaml          | 182 ++++++++++++++++++
 .../devicetree/bindings/mux/reg-mux.txt       | 129 -------------
 .../devicetree/bindings/mux/reg-mux.yaml      | 143 ++++++++++++++
 .../bindings/net/mdio-mux-multiplexer.txt     |   2 +-
 14 files changed, 470 insertions(+), 362 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/mux/gpio-mux.txt
 create mode 100644 Documentation/devicetree/bindings/mux/gpio-mux.yaml
 create mode 100644 Documentation/devicetree/bindings/mux/mux-consumer.yaml
 delete mode 100644 Documentation/devicetree/bindings/mux/mux-controller.txt
 create mode 100644 Documentation/devicetree/bindings/mux/mux-controller.yaml
 delete mode 100644 Documentation/devicetree/bindings/mux/reg-mux.txt
 create mode 100644 Documentation/devicetree/bindings/mux/reg-mux.yaml

diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.txt b/Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.txt
index 8b444b94e92f..057083a8ba17 100644
--- a/Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.txt
+++ b/Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.txt
@@ -25,7 +25,7 @@ Required properties:
   mux.
 * Standard I2C mux properties. See i2c-mux.txt in this directory.
 * I2C child bus nodes. See i2c-mux.txt in this directory. The sub-bus number
-  is also the mux-controller state described in ../mux/mux-controller.txt
+  is also the mux-controller state described in ../mux/mux-controller.yaml
 
 Optional properties:
 - mux-locked: If present, explicitly allow unrelated I2C transactions on the
diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.txt b/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.txt
index 7abda506b828..9f3f3eb67e87 100644
--- a/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.txt
+++ b/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.txt
@@ -26,7 +26,7 @@ Optional Properties:
 
   - reset-gpios: Reference to the GPIO connected to the reset input.
   - idle-state: if present, overrides i2c-mux-idle-disconnect,
-    Please refer to Documentation/devicetree/bindings/mux/mux-controller.txt
+    Please refer to Documentation/devicetree/bindings/mux/mux-controller.yaml
   - i2c-mux-idle-disconnect: Boolean; if defined, forces mux to disconnect all
     children in idle state. This is necessary for example, if there are several
     multiplexers on the bus and the devices behind them use same I2C addresses.
diff --git a/Documentation/devicetree/bindings/iio/multiplexer/io-channel-mux.txt b/Documentation/devicetree/bindings/iio/multiplexer/io-channel-mux.txt
index 89647d714387..d2b3105dba67 100644
--- a/Documentation/devicetree/bindings/iio/multiplexer/io-channel-mux.txt
+++ b/Documentation/devicetree/bindings/iio/multiplexer/io-channel-mux.txt
@@ -17,7 +17,7 @@ For each non-empty string in the channels property, an io-channel will
 be created. The number of this io-channel is the same as the index into
 the list of strings in the channels property, and also matches the mux
 controller state. The mux controller state is described in
-../mux/mux-controller.txt
+../mux/mux-controller.yaml
 
 Example:
 	mux: mux-controller {
diff --git a/Documentation/devicetree/bindings/mtd/ti,am654-hbmc.txt b/Documentation/devicetree/bindings/mtd/ti,am654-hbmc.txt
index faa81c2e5da6..ccfd37b8a0ad 100644
--- a/Documentation/devicetree/bindings/mtd/ti,am654-hbmc.txt
+++ b/Documentation/devicetree/bindings/mtd/ti,am654-hbmc.txt
@@ -13,7 +13,7 @@ Optional properties:
 - mux-controls : phandle to the multiplexer that controls selection of
 		 HBMC vs OSPI inside Flash SubSystem (FSS). Default is OSPI,
 		 if property is absent.
-		 See Documentation/devicetree/bindings/mux/reg-mux.txt
+		 See Documentation/devicetree/bindings/mux/reg-mux.yaml
 		 for mmio-mux binding details
 
 Example:
diff --git a/Documentation/devicetree/bindings/mux/adi,adg792a.txt b/Documentation/devicetree/bindings/mux/adi,adg792a.txt
index 96b787a69f50..b0e5bf6903d8 100644
--- a/Documentation/devicetree/bindings/mux/adi,adg792a.txt
+++ b/Documentation/devicetree/bindings/mux/adi,adg792a.txt
@@ -5,7 +5,7 @@ Required properties:
 - #mux-control-cells : <0> if parallel (the three muxes are bound together
   with a single mux controller controlling all three muxes), or <1> if
   not (one mux controller for each mux).
-* Standard mux-controller bindings as described in mux-controller.txt
+* Standard mux-controller bindings as described in mux-controller.yaml
 
 Optional properties for ADG792G:
 - gpio-controller : if present, #gpio-cells below is required.
diff --git a/Documentation/devicetree/bindings/mux/adi,adgs1408.txt b/Documentation/devicetree/bindings/mux/adi,adgs1408.txt
index be6947f4d86b..453a38961c13 100644
--- a/Documentation/devicetree/bindings/mux/adi,adgs1408.txt
+++ b/Documentation/devicetree/bindings/mux/adi,adgs1408.txt
@@ -4,7 +4,7 @@ Required properties:
 - compatible : Should be one of
 	* "adi,adgs1408"
 	* "adi,adgs1409"
-* Standard mux-controller bindings as described in mux-controller.txt
+* Standard mux-controller bindings as described in mux-controller.yaml
 
 Optional properties for ADGS1408/1409:
 - gpio-controller : if present, #gpio-cells is required.
diff --git a/Documentation/devicetree/bindings/mux/gpio-mux.txt b/Documentation/devicetree/bindings/mux/gpio-mux.txt
deleted file mode 100644
index b8f746344d80..000000000000
--- a/Documentation/devicetree/bindings/mux/gpio-mux.txt
+++ /dev/null
@@ -1,69 +0,0 @@
-GPIO-based multiplexer controller bindings
-
-Define what GPIO pins are used to control a multiplexer. Or several
-multiplexers, if the same pins control more than one multiplexer.
-
-Required properties:
-- compatible : "gpio-mux"
-- mux-gpios : list of gpios used to control the multiplexer, least
-	      significant bit first.
-- #mux-control-cells : <0>
-* Standard mux-controller bindings as decribed in mux-controller.txt
-
-Optional properties:
-- idle-state : if present, the state the mux will have when idle. The
-	       special state MUX_IDLE_AS_IS is the default.
-
-The multiplexer state is defined as the number represented by the
-multiplexer GPIO pins, where the first pin is the least significant
-bit. An active pin is a binary 1, an inactive pin is a binary 0.
-
-Example:
-
-	mux: mux-controller {
-		compatible = "gpio-mux";
-		#mux-control-cells = <0>;
-
-		mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>,
-			    <&pioA 1 GPIO_ACTIVE_HIGH>;
-	};
-
-	adc-mux {
-		compatible = "io-channel-mux";
-		io-channels = <&adc 0>;
-		io-channel-names = "parent";
-
-		mux-controls = <&mux>;
-
-		channels = "sync-1", "in", "out", "sync-2";
-	};
-
-	i2c-mux {
-		compatible = "i2c-mux";
-		i2c-parent = <&i2c1>;
-
-		mux-controls = <&mux>;
-
-		#address-cells = <1>;
-		#size-cells = <0>;
-
-		i2c@0 {
-			reg = <0>;
-			#address-cells = <1>;
-			#size-cells = <0>;
-
-			ssd1307: oled@3c {
-				/* ... */
-			};
-		};
-
-		i2c@3 {
-			reg = <3>;
-			#address-cells = <1>;
-			#size-cells = <0>;
-
-			pca9555: pca9555@20 {
-				/* ... */
-			};
-		};
-	};
diff --git a/Documentation/devicetree/bindings/mux/gpio-mux.yaml b/Documentation/devicetree/bindings/mux/gpio-mux.yaml
new file mode 100644
index 000000000000..0a7c8d64981a
--- /dev/null
+++ b/Documentation/devicetree/bindings/mux/gpio-mux.yaml
@@ -0,0 +1,92 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mux/gpio-mux.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: GPIO-based multiplexer controller bindings
+
+maintainers:
+  - Peter Rosin <peda@axentia.se>
+
+description: |+
+  Define what GPIO pins are used to control a multiplexer. Or several
+  multiplexers, if the same pins control more than one multiplexer.
+
+  The multiplexer state is defined as the number represented by the
+  multiplexer GPIO pins, where the first pin is the least significant
+  bit. An active pin is a binary 1, an inactive pin is a binary 0.
+
+properties:
+  compatible:
+    const: gpio-mux
+
+  mux-gpios:
+    description:
+      List of gpios used to control the multiplexer, least significant bit first.
+
+  '#mux-control-cells':
+    const: 0
+
+  idle-state:
+    default: -1
+
+required:
+  - compatible
+  - mux-gpios
+  - "#mux-control-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    mux: mux-controller {
+        compatible = "gpio-mux";
+        #mux-control-cells = <0>;
+
+        mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>,
+              <&pioA 1 GPIO_ACTIVE_HIGH>;
+    };
+
+    adc-mux {
+        compatible = "io-channel-mux";
+        io-channels = <&adc 0>;
+        io-channel-names = "parent";
+
+        mux-controls = <&mux>;
+
+        channels = "sync-1", "in", "out", "sync-2";
+    };
+
+    i2c-mux {
+        compatible = "i2c-mux";
+        i2c-parent = <&i2c1>;
+
+        mux-controls = <&mux>;
+
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        i2c@0 {
+            reg = <0>;
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            ssd1307: oled@3c {
+                reg = <0x3c>;
+            };
+        };
+
+        i2c@3 {
+            reg = <3>;
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            pca9555: pca9555@20 {
+                reg = <0x20>;
+            };
+        };
+    };
+...
diff --git a/Documentation/devicetree/bindings/mux/mux-consumer.yaml b/Documentation/devicetree/bindings/mux/mux-consumer.yaml
new file mode 100644
index 000000000000..7af93298ab5c
--- /dev/null
+++ b/Documentation/devicetree/bindings/mux/mux-consumer.yaml
@@ -0,0 +1,46 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mux/mux-consumer.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Common multiplexer controller consumer bindings
+
+maintainers:
+  - Peter Rosin <peda@axentia.se>
+
+description: |
+  Mux controller consumers should specify a list of mux controllers that they
+  want to use with a property containing a 'mux-ctrl-list':
+
+    mux-ctrl-list ::= <single-mux-ctrl> [mux-ctrl-list]
+    single-mux-ctrl ::= <mux-ctrl-phandle> [mux-ctrl-specifier]
+    mux-ctrl-phandle : phandle to mux controller node
+    mux-ctrl-specifier : array of #mux-control-cells specifying the
+                         given mux controller (controller specific)
+
+  Mux controller properties should be named "mux-controls". The exact meaning of
+  each mux controller property must be documented in the device tree binding for
+  each consumer. An optional property "mux-control-names" may contain a list of
+  strings to label each of the mux controllers listed in the "mux-controls"
+  property.
+
+  mux-ctrl-specifier typically encodes the chip-relative mux controller number.
+  If the mux controller chip only provides a single mux controller, the
+  mux-ctrl-specifier can typically be left out.
+
+select: true
+
+properties:
+  mux-controls:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+
+  mux-control-names:
+    description:
+      Devices that use more than a single mux controller can use the
+      "mux-control-names" property to map the name of the requested mux
+      controller to an index into the list given by the "mux-controls" property.
+
+additionalProperties: true
+
+...
diff --git a/Documentation/devicetree/bindings/mux/mux-controller.txt b/Documentation/devicetree/bindings/mux/mux-controller.txt
deleted file mode 100644
index 4f47e4bd2fa0..000000000000
--- a/Documentation/devicetree/bindings/mux/mux-controller.txt
+++ /dev/null
@@ -1,157 +0,0 @@
-Common multiplexer controller bindings
-======================================
-
-A multiplexer (or mux) controller will have one, or several, consumer devices
-that uses the mux controller. Thus, a mux controller can possibly control
-several parallel multiplexers. Presumably there will be at least one
-multiplexer needed by each consumer, but a single mux controller can of course
-control several multiplexers for a single consumer.
-
-A mux controller provides a number of states to its consumers, and the state
-space is a simple zero-based enumeration. I.e. 0-1 for a 2-way multiplexer,
-0-7 for an 8-way multiplexer, etc.
-
-
-Consumers
----------
-
-Mux controller consumers should specify a list of mux controllers that they
-want to use with a property containing a 'mux-ctrl-list':
-
-	mux-ctrl-list ::= <single-mux-ctrl> [mux-ctrl-list]
-	single-mux-ctrl ::= <mux-ctrl-phandle> [mux-ctrl-specifier]
-	mux-ctrl-phandle : phandle to mux controller node
-	mux-ctrl-specifier : array of #mux-control-cells specifying the
-			     given mux controller (controller specific)
-
-Mux controller properties should be named "mux-controls". The exact meaning of
-each mux controller property must be documented in the device tree binding for
-each consumer. An optional property "mux-control-names" may contain a list of
-strings to label each of the mux controllers listed in the "mux-controls"
-property.
-
-Drivers for devices that use more than a single mux controller can use the
-"mux-control-names" property to map the name of the requested mux controller
-to an index into the list given by the "mux-controls" property.
-
-mux-ctrl-specifier typically encodes the chip-relative mux controller number.
-If the mux controller chip only provides a single mux controller, the
-mux-ctrl-specifier can typically be left out.
-
-Example:
-
-	/* One consumer of a 2-way mux controller (one GPIO-line) */
-	mux: mux-controller {
-		compatible = "gpio-mux";
-		#mux-control-cells = <0>;
-
-		mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>;
-	};
-
-	adc-mux {
-		compatible = "io-channel-mux";
-		io-channels = <&adc 0>;
-		io-channel-names = "parent";
-
-		mux-controls = <&mux>;
-		mux-control-names = "adc";
-
-		channels = "sync", "in";
-	};
-
-Note that in the example above, specifying the "mux-control-names" is redundant
-because there is only one mux controller in the list. However, if the driver
-for the consumer node in fact asks for a named mux controller, that name is of
-course still required.
-
-	/*
-	 * Two consumers (one for an ADC line and one for an i2c bus) of
-	 * parallel 4-way multiplexers controlled by the same two GPIO-lines.
-	 */
-	mux: mux-controller {
-		compatible = "gpio-mux";
-		#mux-control-cells = <0>;
-
-		mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>,
-			    <&pioA 1 GPIO_ACTIVE_HIGH>;
-	};
-
-	adc-mux {
-		compatible = "io-channel-mux";
-		io-channels = <&adc 0>;
-		io-channel-names = "parent";
-
-		mux-controls = <&mux>;
-
-		channels = "sync-1", "in", "out", "sync-2";
-	};
-
-	i2c-mux {
-		compatible = "i2c-mux";
-		i2c-parent = <&i2c1>;
-
-		mux-controls = <&mux>;
-
-		#address-cells = <1>;
-		#size-cells = <0>;
-
-		i2c@0 {
-			reg = <0>;
-			#address-cells = <1>;
-			#size-cells = <0>;
-
-			ssd1307: oled@3c {
-				/* ... */
-			};
-		};
-
-		i2c@3 {
-			reg = <3>;
-			#address-cells = <1>;
-			#size-cells = <0>;
-
-			pca9555: pca9555@20 {
-				/* ... */
-			};
-		};
-	};
-
-
-Mux controller nodes
---------------------
-
-Mux controller nodes must specify the number of cells used for the
-specifier using the '#mux-control-cells' property.
-
-Optionally, mux controller nodes can also specify the state the mux should
-have when it is idle. The idle-state property is used for this. If the
-idle-state is not present, the mux controller is typically left as is when
-it is idle. For multiplexer chips that expose several mux controllers, the
-idle-state property is an array with one idle state for each mux controller.
-
-The special value (-1) may be used to indicate that the mux should be left
-as is when it is idle. This is the default, but can still be useful for
-mux controller chips with more than one mux controller, particularly when
-there is a need to "step past" a mux controller and set some other idle
-state for a mux controller with a higher index.
-
-Some mux controllers have the ability to disconnect the input/output of the
-multiplexer. Using this disconnected high-impedance state as the idle state
-is indicated with idle state (-2).
-
-These constants are available in
-
-      #include <dt-bindings/mux/mux.h>
-
-as MUX_IDLE_AS_IS (-1) and MUX_IDLE_DISCONNECT (-2).
-
-An example mux controller node look like this (the adg972a chip is a triple
-4-way multiplexer):
-
-	mux: mux-controller@50 {
-		compatible = "adi,adg792a";
-		reg = <0x50>;
-		#mux-control-cells = <1>;
-
-		idle-state = <MUX_IDLE_DISCONNECT MUX_IDLE_AS_IS 2>;
-	};
diff --git a/Documentation/devicetree/bindings/mux/mux-controller.yaml b/Documentation/devicetree/bindings/mux/mux-controller.yaml
new file mode 100644
index 000000000000..736a84c3b6a5
--- /dev/null
+++ b/Documentation/devicetree/bindings/mux/mux-controller.yaml
@@ -0,0 +1,182 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mux/mux-controller.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Common multiplexer controller provider bindings
+
+maintainers:
+  - Peter Rosin <peda@axentia.se>
+
+description: |
+  A multiplexer (or mux) controller will have one, or several, consumer devices
+  that uses the mux controller. Thus, a mux controller can possibly control
+  several parallel multiplexers. Presumably there will be at least one
+  multiplexer needed by each consumer, but a single mux controller can of course
+  control several multiplexers for a single consumer.
+
+  A mux controller provides a number of states to its consumers, and the state
+  space is a simple zero-based enumeration. I.e. 0-1 for a 2-way multiplexer,
+  0-7 for an 8-way multiplexer, etc.
+
+
+  Mux controller nodes
+  --------------------
+
+  Mux controller nodes must specify the number of cells used for the
+  specifier using the '#mux-control-cells' property.
+
+  Optionally, mux controller nodes can also specify the state the mux should
+  have when it is idle. The idle-state property is used for this. If the
+  idle-state is not present, the mux controller is typically left as is when
+  it is idle. For multiplexer chips that expose several mux controllers, the
+  idle-state property is an array with one idle state for each mux controller.
+
+  The special value (-1) may be used to indicate that the mux should be left
+  as is when it is idle. This is the default, but can still be useful for
+  mux controller chips with more than one mux controller, particularly when
+  there is a need to "step past" a mux controller and set some other idle
+  state for a mux controller with a higher index.
+
+  Some mux controllers have the ability to disconnect the input/output of the
+  multiplexer. Using this disconnected high-impedance state as the idle state
+  is indicated with idle state (-2).
+
+  These constants are available in
+
+        #include <dt-bindings/mux/mux.h>
+
+  as MUX_IDLE_AS_IS (-1) and MUX_IDLE_DISCONNECT (-2).
+
+  An example mux controller node look like this (the adg972a chip is a triple
+  4-way multiplexer):
+
+    mux: mux-controller@50 {
+      compatible = "adi,adg792a";
+      reg = <0x50>;
+      #mux-control-cells = <1>;
+
+      idle-state = <MUX_IDLE_DISCONNECT MUX_IDLE_AS_IS 2>;
+    };
+
+select:
+  anyOf:
+    - properties:
+        $nodename:
+          pattern: '^mux-controller'
+    - required:
+        - '#mux-control-cells'
+
+properties:
+  $nodename:
+    pattern: '^mux-controller(@.*|-[0-9a-f]+)?$'
+
+  '#mux-control-cells':
+    enum: [ 0, 1 ]
+
+  idle-state:
+    $ref: /schemas/types.yaml#/definitions/int32
+    minimum: -2
+
+  idle-states:
+    description: |
+      Mux controller nodes can specify the state the mux should have when it is
+      idle. If the idle-state is not present, the mux controller is typically
+      left as is when it is idle. For multiplexer chips that expose several mux
+      controllers, the idle-state property is an array with one idle state for
+      each mux controller.
+
+      The special value (-1) may be used to indicate that the mux should be left
+      as is when it is idle. This is the default, but can still be useful for
+      mux controller chips with more than one mux controller, particularly when
+      there is a need to "step past" a mux controller and set some other idle
+      state for a mux controller with a higher index.
+
+      Some mux controllers have the ability to disconnect the input/output of the
+      multiplexer. Using this disconnected high-impedance state as the idle state
+      is indicated with idle state (-2).
+    $ref: /schemas/types.yaml#/definitions/int32-array
+    items:
+      minimum: -2
+
+additionalProperties: true
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    /* One consumer of a 2-way mux controller (one GPIO-line) */
+    mux: mux-controller {
+        compatible = "gpio-mux";
+        #mux-control-cells = <0>;
+
+        mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>;
+    };
+
+    adc-mux {
+        compatible = "io-channel-mux";
+        io-channels = <&adc 0>;
+        io-channel-names = "parent";
+
+        mux-controls = <&mux>;
+        mux-control-names = "adc";
+
+        channels = "sync", "in";
+    };
+
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    /*
+     * Two consumers (one for an ADC line and one for an i2c bus) of
+     * parallel 4-way multiplexers controlled by the same two GPIO-lines.
+     */
+    mux2: mux-controller {
+        compatible = "gpio-mux";
+        #mux-control-cells = <0>;
+
+        mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>,
+              <&pioA 1 GPIO_ACTIVE_HIGH>;
+    };
+
+    adc-mux {
+        compatible = "io-channel-mux";
+        io-channels = <&adc 0>;
+        io-channel-names = "parent";
+
+        mux-controls = <&mux2>;
+
+        channels = "sync-1", "in", "out", "sync-2";
+    };
+
+    i2c-mux {
+        compatible = "i2c-mux";
+        i2c-parent = <&i2c1>;
+
+        mux-controls = <&mux2>;
+
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        i2c@0 {
+            reg = <0>;
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            ssd1307: oled@3c {
+                reg = <0x3c>;
+            };
+        };
+
+        i2c@3 {
+            reg = <3>;
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            pca9555: pca9555@20 {
+                reg = <0x20>;
+            };
+        };
+    };
+...
diff --git a/Documentation/devicetree/bindings/mux/reg-mux.txt b/Documentation/devicetree/bindings/mux/reg-mux.txt
deleted file mode 100644
index 4afd7ba73d60..000000000000
--- a/Documentation/devicetree/bindings/mux/reg-mux.txt
+++ /dev/null
@@ -1,129 +0,0 @@
-Generic register bitfield-based multiplexer controller bindings
-
-Define register bitfields to be used to control multiplexers. The parent
-device tree node must be a device node to provide register r/w access.
-
-Required properties:
-- compatible : should be one of
-	"reg-mux" : if parent device of mux controller is not syscon device
-	"mmio-mux" : if parent device of mux controller is syscon device
-- #mux-control-cells : <1>
-- mux-reg-masks : an array of register offset and pre-shifted bitfield mask
-                  pairs, each describing a single mux control.
-* Standard mux-controller bindings as decribed in mux-controller.txt
-
-Optional properties:
-- idle-states : if present, the state the muxes will have when idle. The
-		special state MUX_IDLE_AS_IS is the default.
-
-The multiplexer state of each multiplexer is defined as the value of the
-bitfield described by the corresponding register offset and bitfield mask
-pair in the mux-reg-masks array.
-
-Example 1:
-The parent device of mux controller is not a syscon device.
-
-&i2c0 {
-	fpga@66 { // fpga connected to i2c
-		compatible = "fsl,lx2160aqds-fpga", "fsl,fpga-qixis-i2c",
-			     "simple-mfd";
-		reg = <0x66>;
-
-		mux: mux-controller {
-			compatible = "reg-mux";
-			#mux-control-cells = <1>;
-			mux-reg-masks = <0x54 0xf8>, /* 0: reg 0x54, bits 7:3 */
-					<0x54 0x07>; /* 1: reg 0x54, bits 2:0 */
-		};
-	};
-};
-
-mdio-mux-1 {
-	compatible = "mdio-mux-multiplexer";
-	mux-controls = <&mux 0>;
-	mdio-parent-bus = <&emdio1>;
-	#address-cells = <1>;
-	#size-cells = <0>;
-
-	mdio@0 {
-		reg = <0x0>;
-		#address-cells = <1>;
-		#size-cells = <0>;
-	};
-
-	mdio@8 {
-		reg = <0x8>;
-		#address-cells = <1>;
-		#size-cells = <0>;
-	};
-
-	..
-	..
-};
-
-mdio-mux-2 {
-	compatible = "mdio-mux-multiplexer";
-	mux-controls = <&mux 1>;
-	mdio-parent-bus = <&emdio2>;
-	#address-cells = <1>;
-	#size-cells = <0>;
-
-	mdio@0 {
-		reg = <0x0>;
-		#address-cells = <1>;
-		#size-cells = <0>;
-	};
-
-	mdio@1 {
-		reg = <0x1>;
-		#address-cells = <1>;
-		#size-cells = <0>;
-	};
-
-	..
-	..
-};
-
-Example 2:
-The parent device of mux controller is syscon device.
-
-syscon {
-	compatible = "syscon";
-
-	mux: mux-controller {
-		compatible = "mmio-mux";
-		#mux-control-cells = <1>;
-
-		mux-reg-masks = <0x3 0x30>, /* 0: reg 0x3, bits 5:4 */
-				<0x3 0x40>, /* 1: reg 0x3, bit 6 */
-		idle-states = <MUX_IDLE_AS_IS>, <0>;
-	};
-};
-
-video-mux {
-	compatible = "video-mux";
-	mux-controls = <&mux 0>;
-	#address-cells = <1>;
-	#size-cells = <0>;
-
-	ports {
-		/* inputs 0..3 */
-		port@0 {
-			reg = <0>;
-		};
-		port@1 {
-			reg = <1>;
-		};
-		port@2 {
-			reg = <2>;
-		};
-		port@3 {
-			reg = <3>;
-		};
-
-		/* output */
-		port@4 {
-			reg = <4>;
-		};
-	};
-};
diff --git a/Documentation/devicetree/bindings/mux/reg-mux.yaml b/Documentation/devicetree/bindings/mux/reg-mux.yaml
new file mode 100644
index 000000000000..60d5746eb39d
--- /dev/null
+++ b/Documentation/devicetree/bindings/mux/reg-mux.yaml
@@ -0,0 +1,143 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mux/reg-mux.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Generic register bitfield-based multiplexer controller bindings
+
+maintainers:
+  - Peter Rosin <peda@axentia.se>
+
+description: |+
+  Define register bitfields to be used to control multiplexers. The parent
+  device tree node must be a device node to provide register r/w access.
+
+properties:
+  compatible:
+    enum:
+      - reg-mux   # parent device of mux controller is not syscon device
+      - mmio-mux  # parent device of mux controller is syscon device
+
+  reg: true
+
+  '#mux-control-cells':
+    const: 1
+
+  mux-reg-masks:
+    description: an array of register offset and pre-shifted bitfield mask
+      pairs, each describing a single mux control.
+
+  idle-states: true
+
+required:
+  - compatible
+  - mux-reg-masks
+  - '#mux-control-cells'
+
+additionalProperties: false
+
+examples:
+  - |
+    /* The parent device of mux controller is not a syscon device. */
+
+    #include <dt-bindings/mux/mux.h>
+
+    mux-controller {
+        compatible = "reg-mux";
+        #mux-control-cells = <1>;
+        mux-reg-masks =
+            <0x54 0xf8>, /* 0: reg 0x54, bits 7:3 */
+            <0x54 0x07>; /* 1: reg 0x54, bits 2:0 */
+    };
+
+    mdio-mux-1 {
+        compatible = "mdio-mux-multiplexer";
+        mux-controls = <&mux1 0>;
+        mdio-parent-bus = <&emdio1>;
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        mdio@0 {
+            reg = <0x0>;
+            #address-cells = <1>;
+            #size-cells = <0>;
+        };
+
+        mdio@8 {
+            reg = <0x8>;
+            #address-cells = <1>;
+            #size-cells = <0>;
+        };
+    };
+
+    mdio-mux-2 {
+        compatible = "mdio-mux-multiplexer";
+        mux-controls = <&mux1 1>;
+        mdio-parent-bus = <&emdio2>;
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        mdio@0 {
+            reg = <0x0>;
+            #address-cells = <1>;
+            #size-cells = <0>;
+        };
+
+        mdio@1 {
+            reg = <0x1>;
+            #address-cells = <1>;
+            #size-cells = <0>;
+        };
+    };
+
+  - |
+    /* The parent device of mux controller is syscon device. */
+
+    #include <dt-bindings/mux/mux.h>
+    syscon@1000 {
+        compatible = "fsl,imx7d-iomuxc-gpr", "fsl,imx6q-iomuxc-gpr", "syscon", "simple-mfd";
+        reg = <0x1000 0x100>;
+
+        mux2: mux-controller {
+            compatible = "mmio-mux";
+            #mux-control-cells = <1>;
+
+            mux-reg-masks =
+                <0x3 0x30>, /* 0: reg 0x3, bits 5:4 */
+                <0x3 0x40>; /* 1: reg 0x3, bit 6 */
+            idle-states = <MUX_IDLE_AS_IS>, <0>;
+        };
+    };
+
+    video-mux {
+        compatible = "video-mux";
+        mux-controls = <&mux2 0>;
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        ports {
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            /* inputs 0..3 */
+            port@0 {
+                reg = <0>;
+            };
+            port@1 {
+                reg = <1>;
+            };
+            port@2 {
+                reg = <2>;
+            };
+            port@3 {
+                reg = <3>;
+            };
+
+            /* output */
+            port@4 {
+                reg = <4>;
+            };
+        };
+    };
+...
diff --git a/Documentation/devicetree/bindings/net/mdio-mux-multiplexer.txt b/Documentation/devicetree/bindings/net/mdio-mux-multiplexer.txt
index 534e38058fe0..87fd0b4f654f 100644
--- a/Documentation/devicetree/bindings/net/mdio-mux-multiplexer.txt
+++ b/Documentation/devicetree/bindings/net/mdio-mux-multiplexer.txt
@@ -14,7 +14,7 @@ each child node of mdio bus multiplexer consumer device represent a mdio
 bus.
 
 for more information please refer
-Documentation/devicetree/bindings/mux/mux-controller.txt
+Documentation/devicetree/bindings/mux/mux-controller.yaml
 and Documentation/devicetree/bindings/net/mdio-mux.txt
 
 Example:
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 4/6] dt-bindings: i2c: Convert i2c-mux bindings to DT schema
  2021-05-18 23:28 [PATCH 0/6] dt-bindings: Convert mux bindings to schema Rob Herring
                   ` (2 preceding siblings ...)
  2021-05-18 23:28 ` [PATCH 3/6] dt-bindings: mux: Convert mux controller bindings to schema Rob Herring
@ 2021-05-18 23:28 ` Rob Herring
  2021-05-19  1:39   ` Laurent Pinchart
  2021-05-18 23:28 ` [PATCH 5/6] dt-bindings: i2c: i2c-mux-pca954x: Convert " Rob Herring
  2021-05-18 23:28 ` [PATCH 6/6] dt-bindings: i2c: maxim,max9286: Use the i2c-mux.yaml schema Rob Herring
  5 siblings, 1 reply; 20+ messages in thread
From: Rob Herring @ 2021-05-18 23:28 UTC (permalink / raw)
  To: devicetree, Peter Rosin, Wolfram Sang
  Cc: linux-kernel, Alexandre Belloni, Jacopo Mondi, Kieran Bingham,
	Kishon Vijay Abraham I, Laurent Pinchart, Lee Jones,
	Niklas Söderlund, Roger Quadros, Jonathan Cameron

As some of the example I2C devices don't have schemas yet, change them to
ones that do.

Cc: Peter Rosin <peda@axentia.se>
Signed-off-by: Rob Herring <robh@kernel.org>
---
 .../bindings/i2c/i2c-demux-pinctrl.txt        |   2 +-
 .../devicetree/bindings/i2c/i2c-mux-gpio.txt  |   4 +-
 .../devicetree/bindings/i2c/i2c-mux-gpmux.txt |  99 --------------
 .../bindings/i2c/i2c-mux-gpmux.yaml           | 124 ++++++++++++++++++
 .../bindings/i2c/i2c-mux-ltc4306.txt          |   4 +-
 .../bindings/i2c/i2c-mux-pinctrl.txt          |   4 +-
 .../devicetree/bindings/i2c/i2c-mux-reg.txt   |   4 +-
 .../devicetree/bindings/i2c/i2c-mux.txt       |  73 -----------
 .../devicetree/bindings/i2c/i2c-mux.yaml      |  87 ++++++++++++
 9 files changed, 220 insertions(+), 181 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.txt
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.yaml
 delete mode 100644 Documentation/devicetree/bindings/i2c/i2c-mux.txt
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-mux.yaml

diff --git a/Documentation/devicetree/bindings/i2c/i2c-demux-pinctrl.txt b/Documentation/devicetree/bindings/i2c/i2c-demux-pinctrl.txt
index 81b5d55086fa..86b2e433a969 100644
--- a/Documentation/devicetree/bindings/i2c/i2c-demux-pinctrl.txt
+++ b/Documentation/devicetree/bindings/i2c/i2c-demux-pinctrl.txt
@@ -27,7 +27,7 @@ Required properties:
 - i2c-bus-name: The name of this bus. Also needed as pinctrl-name for the I2C
 		parents.
 
-Furthermore, I2C mux properties and child nodes. See i2c-mux.txt in this
+Furthermore, I2C mux properties and child nodes. See i2c-mux.yaml in this
 directory.
 
 Example:
diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-gpio.txt b/Documentation/devicetree/bindings/i2c/i2c-mux-gpio.txt
index 21da3ecbb370..e00d2b9e957a 100644
--- a/Documentation/devicetree/bindings/i2c/i2c-mux-gpio.txt
+++ b/Documentation/devicetree/bindings/i2c/i2c-mux-gpio.txt
@@ -22,8 +22,8 @@ Required properties:
 - 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.txt in this directory.
-* I2C child bus nodes. See i2c-mux.txt in this directory.
+* 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
diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.txt b/Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.txt
deleted file mode 100644
index 057083a8ba17..000000000000
--- a/Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.txt
+++ /dev/null
@@ -1,99 +0,0 @@
-General Purpose I2C Bus Mux
-
-This binding describes an I2C bus multiplexer that uses a mux controller
-from the mux subsystem to route the I2C signals.
-
-                                  .-----.  .-----.
-                                  | dev |  | dev |
-    .------------.                '-----'  '-----'
-    | SoC        |                   |        |
-    |            |          .--------+--------'
-    |   .------. |  .------+    child bus A, on MUX value set to 0
-    |   | I2C  |-|--| Mux  |
-    |   '------' |  '--+---+    child bus B, on MUX value set to 1
-    |   .------. |     |    '----------+--------+--------.
-    |   | MUX- | |     |               |        |        |
-    |   | Ctrl |-|-----+            .-----.  .-----.  .-----.
-    |   '------' |                  | dev |  | dev |  | dev |
-    '------------'                  '-----'  '-----'  '-----'
-
-Required properties:
-- compatible: i2c-mux
-- i2c-parent: The phandle of the I2C bus that this multiplexer's master-side
-  port is connected to.
-- mux-controls: The phandle of the mux controller to use for operating the
-  mux.
-* Standard I2C mux properties. See i2c-mux.txt in this directory.
-* I2C child bus nodes. See i2c-mux.txt in this directory. The sub-bus number
-  is also the mux-controller state described in ../mux/mux-controller.yaml
-
-Optional properties:
-- mux-locked: If present, explicitly allow unrelated I2C transactions on the
-  parent I2C adapter at these times:
-   + during setup of the multiplexer
-   + between setup of the multiplexer and the child bus I2C transaction
-   + between the child bus I2C transaction and releasing of the multiplexer
-   + during releasing of the multiplexer
-  However, I2C transactions to devices behind all I2C multiplexers connected
-  to the same parent adapter that this multiplexer is connected to are blocked
-  for the full duration of the complete multiplexed I2C transaction (i.e.
-  including the times covered by the above list).
-  If mux-locked is not present, the multiplexer is assumed to be parent-locked.
-  This means that no unrelated I2C transactions are allowed on the parent I2C
-  adapter for the complete multiplexed I2C transaction.
-  The properties of mux-locked and parent-locked multiplexers are discussed
-  in more detail in Documentation/i2c/i2c-topology.rst.
-
-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 set as the state in the
-mux controller.
-
-Example:
-	mux: mux-controller {
-		compatible = "gpio-mux";
-		#mux-control-cells = <0>;
-
-		mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>,
-			    <&pioA 1 GPIO_ACTIVE_HIGH>;
-	};
-
-	i2c-mux {
-		compatible = "i2c-mux";
-		mux-locked;
-		i2c-parent = <&i2c1>;
-
-		mux-controls = <&mux>;
-
-		#address-cells = <1>;
-		#size-cells = <0>;
-
-		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>;
-				reset-active-low;
-			};
-		};
-
-		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-gpmux.yaml b/Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.yaml
new file mode 100644
index 000000000000..3e6ea59aea68
--- /dev/null
+++ b/Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.yaml
@@ -0,0 +1,124 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/i2c/i2c-mux-gpmux.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: General Purpose I2C Bus Mux
+
+maintainers:
+  - Peter Rosin <peda@axentia.se>
+
+description: |+
+  This binding describes an I2C bus multiplexer that uses a mux controller
+  from the mux subsystem to route the I2C signals.
+
+                                    .-----.  .-----.
+                                    | dev |  | dev |
+      .------------.                '-----'  '-----'
+      | SoC        |                   |        |
+      |            |          .--------+--------'
+      |   .------. |  .------+    child bus A, on MUX value set to 0
+      |   | I2C  |-|--| Mux  |
+      |   '------' |  '--+---+    child bus B, on MUX value set to 1
+      |   .------. |     |    '----------+--------+--------.
+      |   | MUX- | |     |               |        |        |
+      |   | Ctrl |-|-----+            .-----.  .-----.  .-----.
+      |   '------' |                  | dev |  | dev |  | dev |
+      '------------'                  '-----'  '-----'  '-----'
+
+
+
+allOf:
+  - $ref: /schemas/i2c/i2c-mux.yaml#
+
+properties:
+  compatible:
+    const: i2c-mux
+
+  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.
+
+  mux-controls:
+    maxItems: 1
+    description:
+      The mux-controller states are the I2C sub-bus numbers.
+
+  mux-locked:
+    type: boolean
+    description: |
+      Explicitly allow unrelated I2C transactions on the parent I2C adapter at
+      these times:
+       + during setup of the multiplexer
+       + between setup of the multiplexer and the child bus I2C transaction
+       + between the child bus I2C transaction and releasing of the multiplexer
+       + during releasing of the multiplexer
+
+      However, I2C transactions to devices behind all I2C multiplexers connected
+      to the same parent adapter that this multiplexer is connected to are blocked
+      for the full duration of the complete multiplexed I2C transaction (i.e.
+      including the times covered by the above list).
+      If mux-locked is not present, the multiplexer is assumed to be parent-locked.
+      This means that no unrelated I2C transactions are allowed on the parent I2C
+      adapter for the complete multiplexed I2C transaction.
+      The properties of mux-locked and parent-locked multiplexers are discussed
+      in more detail in Documentation/i2c/i2c-topology.rst.
+
+required:
+  - compatible
+  - i2c-parent
+  - mux-controls
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    mux: mux-controller {
+        compatible = "gpio-mux";
+        #mux-control-cells = <0>;
+
+        mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>,
+                    <&pioA 1 GPIO_ACTIVE_HIGH>;
+    };
+
+    i2c-mux {
+        compatible = "i2c-mux";
+        mux-locked;
+        i2c-parent = <&i2c1>;
+
+        mux-controls = <&mux>;
+
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        i2c@1 {
+            reg = <1>;
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            gpio@20 {
+                compatible = "nxp,pca9555";
+                gpio-controller;
+                #gpio-cells = <2>;
+                reg = <0x20>;
+            };
+        };
+
+        i2c@3 {
+            reg = <3>;
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            gpio@20 {
+                compatible = "nxp,pca9555";
+                gpio-controller;
+                #gpio-cells = <2>;
+                reg = <0x20>;
+            };
+        };
+    };
+...
diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-ltc4306.txt b/Documentation/devicetree/bindings/i2c/i2c-mux-ltc4306.txt
index 8b1e49cdce3f..29c4550c9782 100644
--- a/Documentation/devicetree/bindings/i2c/i2c-mux-ltc4306.txt
+++ b/Documentation/devicetree/bindings/i2c/i2c-mux-ltc4306.txt
@@ -8,8 +8,8 @@ Required Properties:
 
   The following required properties are defined externally:
 
-  - Standard I2C mux properties. See i2c-mux.txt in this directory.
-  - I2C child bus nodes. See i2c-mux.txt in this directory.
+  - Standard I2C mux properties. See i2c-mux.yaml in this directory.
+  - I2C child bus nodes. See i2c-mux.yaml in this directory.
 
 Optional Properties:
 
diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-pinctrl.txt b/Documentation/devicetree/bindings/i2c/i2c-mux-pinctrl.txt
index 33119a98e144..997a287ed3f6 100644
--- a/Documentation/devicetree/bindings/i2c/i2c-mux-pinctrl.txt
+++ b/Documentation/devicetree/bindings/i2c/i2c-mux-pinctrl.txt
@@ -28,9 +28,9 @@ 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.txt in this directory.
+* Standard I2C mux properties. See i2c-mux.yaml in this directory.
 
-* I2C child bus nodes. See i2c-mux.txt 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
diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-reg.txt b/Documentation/devicetree/bindings/i2c/i2c-mux-reg.txt
index de00d7fc450b..b9d9755e4172 100644
--- a/Documentation/devicetree/bindings/i2c/i2c-mux-reg.txt
+++ b/Documentation/devicetree/bindings/i2c/i2c-mux-reg.txt
@@ -7,8 +7,8 @@ Required properties:
 - compatible: i2c-mux-reg
 - i2c-parent: The phandle of the I2C bus that this multiplexer's master-side
   port is connected to.
-* Standard I2C mux properties. See i2c-mux.txt in this directory.
-* I2C child bus nodes. See i2c-mux.txt in this directory.
+* Standard I2C mux properties. See i2c-mux.yaml in this directory.
+* I2C child bus nodes. See i2c-mux.yaml in this directory.
 
 Optional properties:
 - reg: this pair of <offset size> specifies the register to control the mux.
diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux.txt b/Documentation/devicetree/bindings/i2c/i2c-mux.txt
deleted file mode 100644
index b38f58a1c878..000000000000
--- a/Documentation/devicetree/bindings/i2c/i2c-mux.txt
+++ /dev/null
@@ -1,73 +0,0 @@
-Common i2c bus multiplexer/switch properties.
-
-An i2c bus multiplexer/switch will have several child busses that are
-numbered uniquely in a device dependent manner.  The nodes for an i2c bus
-multiplexer/switch will have one child node for each child bus.
-
-Optional properties:
-- #address-cells = <1>;
-   This property is required if the i2c-mux child node does not exist.
-
-- #size-cells = <0>;
-   This property is required if the i2c-mux child node does not exist.
-
-- i2c-mux
-   For i2c multiplexers/switches that have child nodes that are a mixture
-   of both i2c child busses and other child nodes, the 'i2c-mux' subnode
-   can be used for populating the i2c child busses.  If an 'i2c-mux'
-   subnode is present, only subnodes of this will be considered as i2c
-   child busses.
-
-Required properties for the i2c-mux child node:
-- #address-cells = <1>;
-- #size-cells = <0>;
-
-Required properties for i2c child bus nodes:
-- #address-cells = <1>;
-- #size-cells = <0>;
-- reg : The sub-bus number.
-
-Optional properties for i2c child bus nodes:
-- Other properties specific to the multiplexer/switch hardware.
-- Child nodes conforming to i2c bus binding
-
-
-Example :
-
-	/*
-	   An NXP pca9548 8 channel I2C multiplexer at address 0x70
-	   with two NXP pca8574 GPIO expanders attached, one each to
-	   ports 3 and 4.
-	 */
-
-	mux@70 {
-		compatible = "nxp,pca9548";
-		reg = <0x70>;
-		#address-cells = <1>;
-		#size-cells = <0>;
-
-		i2c@3 {
-			#address-cells = <1>;
-			#size-cells = <0>;
-			reg = <3>;
-
-			gpio1: gpio@38 {
-				compatible = "nxp,pca8574";
-				reg = <0x38>;
-				#gpio-cells = <2>;
-				gpio-controller;
-			};
-		};
-		i2c@4 {
-			#address-cells = <1>;
-			#size-cells = <0>;
-			reg = <4>;
-
-			gpio2: gpio@38 {
-				compatible = "nxp,pca8574";
-				reg = <0x38>;
-				#gpio-cells = <2>;
-				gpio-controller;
-			};
-		};
-	};
diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux.yaml b/Documentation/devicetree/bindings/i2c/i2c-mux.yaml
new file mode 100644
index 000000000000..3aa4d84a6610
--- /dev/null
+++ b/Documentation/devicetree/bindings/i2c/i2c-mux.yaml
@@ -0,0 +1,87 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/i2c/i2c-mux.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Common i2c bus multiplexer/switch properties.
+
+maintainers:
+  - Peter Rosin <peda@axentia.se>
+
+description: |+
+  An i2c bus multiplexer/switch will have several child busses that are numbered
+  uniquely in a device dependent manner.  The nodes for an i2c bus
+  multiplexer/switch will have one child node for each child bus.
+
+  For i2c multiplexers/switches that have child nodes that are a mixture of both
+  i2c child busses and other child nodes, the 'i2c-mux' subnode can be used for
+  populating the i2c child busses.  If an 'i2c-mux' subnode is present, only
+  subnodes of this will be considered as i2c child busses.
+
+properties:
+  $nodename:
+    pattern: '^(i2c-?)?mux'
+
+  '#address-cells':
+    const: 1
+
+  '#size-cells':
+    const: 0
+
+patternProperties:
+  '^i2c@[0-9a-f]+$':
+    $ref: /schemas/i2c/i2c-controller.yaml
+    unevaluatedProperties: false
+
+    properties:
+      reg:
+        description: The mux selector sub-bus number for the child I2C bus.
+        maxItems: 1
+
+additionalProperties: true
+
+examples:
+  - |
+    /*
+       An NXP pca9548 8 channel I2C multiplexer at address 0x70
+       with two NXP pca8574 GPIO expanders attached, one each to
+       ports 3 and 4.
+     */
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        i2c-mux@70 {
+            compatible = "nxp,pca9548";
+            reg = <0x70>;
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            i2c@3 {
+                #address-cells = <1>;
+                #size-cells = <0>;
+                reg = <3>;
+
+                gpio@20 {
+                    compatible = "nxp,pca9555";
+                    gpio-controller;
+                    #gpio-cells = <2>;
+                    reg = <0x20>;
+                };
+            };
+            i2c@4 {
+                #address-cells = <1>;
+                #size-cells = <0>;
+                reg = <4>;
+
+                gpio@20 {
+                    compatible = "nxp,pca9555";
+                    gpio-controller;
+                    #gpio-cells = <2>;
+                    reg = <0x20>;
+                };
+            };
+        };
+    };
+...
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 5/6] dt-bindings: i2c: i2c-mux-pca954x: Convert to DT schema
  2021-05-18 23:28 [PATCH 0/6] dt-bindings: Convert mux bindings to schema Rob Herring
                   ` (3 preceding siblings ...)
  2021-05-18 23:28 ` [PATCH 4/6] dt-bindings: i2c: Convert i2c-mux bindings to DT schema Rob Herring
@ 2021-05-18 23:28 ` Rob Herring
  2021-05-19  1:23   ` Laurent Pinchart
  2021-05-18 23:28 ` [PATCH 6/6] dt-bindings: i2c: maxim,max9286: Use the i2c-mux.yaml schema Rob Herring
  5 siblings, 1 reply; 20+ messages in thread
From: Rob Herring @ 2021-05-18 23:28 UTC (permalink / raw)
  To: devicetree, Peter Rosin, Wolfram Sang
  Cc: linux-kernel, Alexandre Belloni, Jacopo Mondi, Kieran Bingham,
	Kishon Vijay Abraham I, Laurent Pinchart, Lee Jones,
	Niklas Söderlund, Roger Quadros, Jonathan Cameron

Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Rob Herring <robh@kernel.org>
---
 .../bindings/i2c/i2c-mux-pca954x.txt          |  74 ------------
 .../bindings/i2c/i2c-mux-pca954x.yaml         | 106 ++++++++++++++++++
 2 files changed, 106 insertions(+), 74 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.txt
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.yaml

diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.txt b/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.txt
deleted file mode 100644
index 9f3f3eb67e87..000000000000
--- a/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.txt
+++ /dev/null
@@ -1,74 +0,0 @@
-* NXP PCA954x I2C bus switch
-
-The driver supports NXP PCA954x and PCA984x I2C mux/switch devices.
-
-Required Properties:
-
-  - compatible: Must contain one of the following.
-    "nxp,pca9540",
-    "nxp,pca9542",
-    "nxp,pca9543",
-    "nxp,pca9544",
-    "nxp,pca9545",
-    "nxp,pca9546", "nxp,pca9846",
-    "nxp,pca9547", "nxp,pca9847",
-    "nxp,pca9548", "nxp,pca9848",
-    "nxp,pca9849"
-
-  - reg: The I2C address of the device.
-
-  The following required properties are defined externally:
-
-  - Standard I2C mux properties. See i2c-mux.txt in this directory.
-  - I2C child bus nodes. See i2c-mux.txt in this directory.
-
-Optional Properties:
-
-  - reset-gpios: Reference to the GPIO connected to the reset input.
-  - idle-state: if present, overrides i2c-mux-idle-disconnect,
-    Please refer to Documentation/devicetree/bindings/mux/mux-controller.yaml
-  - i2c-mux-idle-disconnect: Boolean; if defined, forces mux to disconnect all
-    children in idle state. This is necessary for example, if there are several
-    multiplexers on the bus and the devices behind them use same I2C addresses.
-  - interrupts: Interrupt mapping for IRQ.
-  - interrupt-controller: Marks the device node as an interrupt controller.
-  - #interrupt-cells : Should be two.
-    - first cell is the pin number
-    - second cell is used to specify flags.
-    See also Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
-
-Example:
-
-	i2c-switch@74 {
-		compatible = "nxp,pca9548";
-		#address-cells = <1>;
-		#size-cells = <0>;
-		reg = <0x74>;
-
-		interrupt-parent = <&ipic>;
-		interrupts = <17 IRQ_TYPE_LEVEL_LOW>;
-		interrupt-controller;
-		#interrupt-cells = <2>;
-
-		i2c@2 {
-			#address-cells = <1>;
-			#size-cells = <0>;
-			reg = <2>;
-
-			eeprom@54 {
-				compatible = "atmel,24c08";
-				reg = <0x54>;
-			};
-		};
-
-		i2c@4 {
-			#address-cells = <1>;
-			#size-cells = <0>;
-			reg = <4>;
-
-			rtc@51 {
-				compatible = "nxp,pcf8563";
-				reg = <0x51>;
-			};
-		};
-	};
diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.yaml b/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.yaml
new file mode 100644
index 000000000000..82d9101098c7
--- /dev/null
+++ b/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.yaml
@@ -0,0 +1,106 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/i2c/i2c-mux-pca954x.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP PCA954x I2C bus switch
+
+maintainers:
+  - Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+
+description:
+  The binding supports NXP PCA954x and PCA984x I2C mux/switch devices.
+
+allOf:
+  - $ref: /schemas/i2c/i2c-mux.yaml#
+
+properties:
+  compatible:
+    enum:
+      - nxp,pca9540
+      - nxp,pca9542
+      - nxp,pca9543
+      - nxp,pca9544
+      - nxp,pca9545
+      - nxp,pca9546
+      - nxp,pca9547
+      - nxp,pca9548
+      - nxp,pca9849
+      - nxp,pca9846
+      - nxp,pca9847
+      - nxp,pca9848
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  "#interrupt-cells":
+    const: 2
+
+  interrupt-controller: true
+
+  reset-gpios:
+    maxItems: 1
+
+  i2c-mux-idle-disconnect:
+    type: boolean
+    description: Forces mux to disconnect all children in idle state. This is
+      necessary for example, if there are several multiplexers on the bus and
+      the devices behind them use same I2C addresses.
+
+  idle-state:
+    description: if present, overrides i2c-mux-idle-disconnect
+    $ref: /schemas/mux/mux-controller.yaml#/properties/idle-state
+
+required:
+  - compatible
+  - reg
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        i2c-mux@74 {
+            compatible = "nxp,pca9548";
+            #address-cells = <1>;
+            #size-cells = <0>;
+            reg = <0x74>;
+
+            interrupt-parent = <&ipic>;
+            interrupts = <17 IRQ_TYPE_LEVEL_LOW>;
+            interrupt-controller;
+            #interrupt-cells = <2>;
+
+            i2c@2 {
+                #address-cells = <1>;
+                #size-cells = <0>;
+                reg = <2>;
+
+                eeprom@54 {
+                    compatible = "atmel,24c08";
+                    reg = <0x54>;
+                };
+            };
+
+            i2c@4 {
+                #address-cells = <1>;
+                #size-cells = <0>;
+                reg = <4>;
+
+                rtc@51 {
+                    compatible = "nxp,pcf8563";
+                    reg = <0x51>;
+                };
+            };
+        };
+    };
+...
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 6/6] dt-bindings: i2c: maxim,max9286: Use the i2c-mux.yaml schema
  2021-05-18 23:28 [PATCH 0/6] dt-bindings: Convert mux bindings to schema Rob Herring
                   ` (4 preceding siblings ...)
  2021-05-18 23:28 ` [PATCH 5/6] dt-bindings: i2c: i2c-mux-pca954x: Convert " Rob Herring
@ 2021-05-18 23:28 ` Rob Herring
  2021-05-19  1:18   ` Laurent Pinchart
  5 siblings, 1 reply; 20+ messages in thread
From: Rob Herring @ 2021-05-18 23:28 UTC (permalink / raw)
  To: devicetree, Peter Rosin, Wolfram Sang
  Cc: linux-kernel, Alexandre Belloni, Jacopo Mondi, Kieran Bingham,
	Kishon Vijay Abraham I, Laurent Pinchart, Lee Jones,
	Niklas Söderlund, Roger Quadros, Jonathan Cameron,
	Laurent Pinchart

Use the i2c-mux.yaml schema in the maxim,max9286 binding schema. With this,
several properties can be dropped as they are defined in i2c-mux.yaml
already.

Cc: Jacopo Mondi <jacopo+renesas@jmondi.org>
Cc: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Cc: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Rob Herring <robh@kernel.org>
---
 .../bindings/media/i2c/maxim,max9286.yaml     | 23 +++----------------
 1 file changed, 3 insertions(+), 20 deletions(-)

diff --git a/Documentation/devicetree/bindings/media/i2c/maxim,max9286.yaml b/Documentation/devicetree/bindings/media/i2c/maxim,max9286.yaml
index ee16102fdfe7..02f656e78700 100644
--- a/Documentation/devicetree/bindings/media/i2c/maxim,max9286.yaml
+++ b/Documentation/devicetree/bindings/media/i2c/maxim,max9286.yaml
@@ -111,17 +111,10 @@ properties:
 
   i2c-mux:
     type: object
+    $ref: /schemas/i2c/i2c-mux.yaml#
+    unevaluatedProperties: false
     description: |
-      Each GMSL link is modelled as a child bus of an i2c bus
-      multiplexer/switch, in accordance with bindings described in
-      Documentation/devicetree/bindings/i2c/i2c-mux.txt.
-
-    properties:
-      '#address-cells':
-        const: 1
-
-      '#size-cells':
-        const: 0
+      Each GMSL link is modelled as a child bus of an i2c bus multiplexer/switch.
 
     patternProperties:
       "^i2c@[0-3]$":
@@ -133,12 +126,6 @@ properties:
           channels.
 
         properties:
-          '#address-cells':
-            const: 1
-
-          '#size-cells':
-            const: 0
-
           reg:
             description: The index of the GMSL channel.
             maxItems: 1
@@ -173,10 +160,6 @@ properties:
 
             additionalProperties: false
 
-        additionalProperties: false
-
-    additionalProperties: false
-
 required:
   - compatible
   - reg
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: [PATCH 6/6] dt-bindings: i2c: maxim,max9286: Use the i2c-mux.yaml schema
  2021-05-18 23:28 ` [PATCH 6/6] dt-bindings: i2c: maxim,max9286: Use the i2c-mux.yaml schema Rob Herring
@ 2021-05-19  1:18   ` Laurent Pinchart
  0 siblings, 0 replies; 20+ messages in thread
From: Laurent Pinchart @ 2021-05-19  1:18 UTC (permalink / raw)
  To: Rob Herring
  Cc: devicetree, Peter Rosin, Wolfram Sang, linux-kernel,
	Alexandre Belloni, Jacopo Mondi, Kieran Bingham,
	Kishon Vijay Abraham I, Lee Jones, Niklas Söderlund,
	Roger Quadros, Jonathan Cameron

Hi Rob,

Thank you for the patch.

On Tue, May 18, 2021 at 06:28:58PM -0500, Rob Herring wrote:
> Use the i2c-mux.yaml schema in the maxim,max9286 binding schema. With this,
> several properties can be dropped as they are defined in i2c-mux.yaml
> already.
> 
> Cc: Jacopo Mondi <jacopo+renesas@jmondi.org>
> Cc: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
> Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> Cc: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> Signed-off-by: Rob Herring <robh@kernel.org>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  .../bindings/media/i2c/maxim,max9286.yaml     | 23 +++----------------
>  1 file changed, 3 insertions(+), 20 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/media/i2c/maxim,max9286.yaml b/Documentation/devicetree/bindings/media/i2c/maxim,max9286.yaml
> index ee16102fdfe7..02f656e78700 100644
> --- a/Documentation/devicetree/bindings/media/i2c/maxim,max9286.yaml
> +++ b/Documentation/devicetree/bindings/media/i2c/maxim,max9286.yaml
> @@ -111,17 +111,10 @@ properties:
>  
>    i2c-mux:
>      type: object
> +    $ref: /schemas/i2c/i2c-mux.yaml#
> +    unevaluatedProperties: false
>      description: |
> -      Each GMSL link is modelled as a child bus of an i2c bus
> -      multiplexer/switch, in accordance with bindings described in
> -      Documentation/devicetree/bindings/i2c/i2c-mux.txt.
> -
> -    properties:
> -      '#address-cells':
> -        const: 1
> -
> -      '#size-cells':
> -        const: 0
> +      Each GMSL link is modelled as a child bus of an i2c bus multiplexer/switch.
>  
>      patternProperties:
>        "^i2c@[0-3]$":
> @@ -133,12 +126,6 @@ properties:
>            channels.
>  
>          properties:
> -          '#address-cells':
> -            const: 1
> -
> -          '#size-cells':
> -            const: 0
> -
>            reg:
>              description: The index of the GMSL channel.
>              maxItems: 1
> @@ -173,10 +160,6 @@ properties:
>  
>              additionalProperties: false
>  
> -        additionalProperties: false
> -
> -    additionalProperties: false
> -
>  required:
>    - compatible
>    - reg

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 5/6] dt-bindings: i2c: i2c-mux-pca954x: Convert to DT schema
  2021-05-18 23:28 ` [PATCH 5/6] dt-bindings: i2c: i2c-mux-pca954x: Convert " Rob Herring
@ 2021-05-19  1:23   ` Laurent Pinchart
  2021-05-19  2:02     ` Rob Herring
  0 siblings, 1 reply; 20+ messages in thread
From: Laurent Pinchart @ 2021-05-19  1:23 UTC (permalink / raw)
  To: Rob Herring
  Cc: devicetree, Peter Rosin, Wolfram Sang, linux-kernel,
	Alexandre Belloni, Jacopo Mondi, Kieran Bingham,
	Kishon Vijay Abraham I, Lee Jones, Niklas Söderlund,
	Roger Quadros, Jonathan Cameron

Hi Rob,

Thank you for the patch.

On Tue, May 18, 2021 at 06:28:57PM -0500, Rob Herring wrote:
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  .../bindings/i2c/i2c-mux-pca954x.txt          |  74 ------------
>  .../bindings/i2c/i2c-mux-pca954x.yaml         | 106 ++++++++++++++++++
>  2 files changed, 106 insertions(+), 74 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.txt
>  create mode 100644 Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.yaml
> 
> diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.txt b/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.txt
> deleted file mode 100644
> index 9f3f3eb67e87..000000000000
> --- a/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.txt
> +++ /dev/null
> @@ -1,74 +0,0 @@
> -* NXP PCA954x I2C bus switch
> -
> -The driver supports NXP PCA954x and PCA984x I2C mux/switch devices.
> -
> -Required Properties:
> -
> -  - compatible: Must contain one of the following.
> -    "nxp,pca9540",
> -    "nxp,pca9542",
> -    "nxp,pca9543",
> -    "nxp,pca9544",
> -    "nxp,pca9545",
> -    "nxp,pca9546", "nxp,pca9846",
> -    "nxp,pca9547", "nxp,pca9847",
> -    "nxp,pca9548", "nxp,pca9848",
> -    "nxp,pca9849"
> -
> -  - reg: The I2C address of the device.
> -
> -  The following required properties are defined externally:
> -
> -  - Standard I2C mux properties. See i2c-mux.txt in this directory.
> -  - I2C child bus nodes. See i2c-mux.txt in this directory.
> -
> -Optional Properties:
> -
> -  - reset-gpios: Reference to the GPIO connected to the reset input.
> -  - idle-state: if present, overrides i2c-mux-idle-disconnect,
> -    Please refer to Documentation/devicetree/bindings/mux/mux-controller.yaml
> -  - i2c-mux-idle-disconnect: Boolean; if defined, forces mux to disconnect all
> -    children in idle state. This is necessary for example, if there are several
> -    multiplexers on the bus and the devices behind them use same I2C addresses.
> -  - interrupts: Interrupt mapping for IRQ.
> -  - interrupt-controller: Marks the device node as an interrupt controller.
> -  - #interrupt-cells : Should be two.
> -    - first cell is the pin number
> -    - second cell is used to specify flags.
> -    See also Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
> -
> -Example:
> -
> -	i2c-switch@74 {
> -		compatible = "nxp,pca9548";
> -		#address-cells = <1>;
> -		#size-cells = <0>;
> -		reg = <0x74>;
> -
> -		interrupt-parent = <&ipic>;
> -		interrupts = <17 IRQ_TYPE_LEVEL_LOW>;
> -		interrupt-controller;
> -		#interrupt-cells = <2>;
> -
> -		i2c@2 {
> -			#address-cells = <1>;
> -			#size-cells = <0>;
> -			reg = <2>;
> -
> -			eeprom@54 {
> -				compatible = "atmel,24c08";
> -				reg = <0x54>;
> -			};
> -		};
> -
> -		i2c@4 {
> -			#address-cells = <1>;
> -			#size-cells = <0>;
> -			reg = <4>;
> -
> -			rtc@51 {
> -				compatible = "nxp,pcf8563";
> -				reg = <0x51>;
> -			};
> -		};
> -	};
> diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.yaml b/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.yaml
> new file mode 100644
> index 000000000000..82d9101098c7
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.yaml
> @@ -0,0 +1,106 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/i2c/i2c-mux-pca954x.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: NXP PCA954x I2C bus switch
> +
> +maintainers:
> +  - Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> +
> +description:
> +  The binding supports NXP PCA954x and PCA984x I2C mux/switch devices.
> +
> +allOf:
> +  - $ref: /schemas/i2c/i2c-mux.yaml#
> +
> +properties:
> +  compatible:
> +    enum:
> +      - nxp,pca9540
> +      - nxp,pca9542
> +      - nxp,pca9543
> +      - nxp,pca9544
> +      - nxp,pca9545
> +      - nxp,pca9546
> +      - nxp,pca9547
> +      - nxp,pca9548
> +      - nxp,pca9849

I'd put this entry last to keep them alphabetically sorted.

While at it, could you add nxp,pca9646 as the driver supports it ?

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> +      - nxp,pca9846
> +      - nxp,pca9847
> +      - nxp,pca9848
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  "#interrupt-cells":
> +    const: 2
> +
> +  interrupt-controller: true
> +
> +  reset-gpios:
> +    maxItems: 1
> +
> +  i2c-mux-idle-disconnect:
> +    type: boolean
> +    description: Forces mux to disconnect all children in idle state. This is
> +      necessary for example, if there are several multiplexers on the bus and
> +      the devices behind them use same I2C addresses.
> +
> +  idle-state:
> +    description: if present, overrides i2c-mux-idle-disconnect
> +    $ref: /schemas/mux/mux-controller.yaml#/properties/idle-state
> +
> +required:
> +  - compatible
> +  - reg
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        i2c-mux@74 {
> +            compatible = "nxp,pca9548";
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +            reg = <0x74>;
> +
> +            interrupt-parent = <&ipic>;
> +            interrupts = <17 IRQ_TYPE_LEVEL_LOW>;
> +            interrupt-controller;
> +            #interrupt-cells = <2>;
> +
> +            i2c@2 {
> +                #address-cells = <1>;
> +                #size-cells = <0>;
> +                reg = <2>;
> +
> +                eeprom@54 {
> +                    compatible = "atmel,24c08";
> +                    reg = <0x54>;
> +                };
> +            };
> +
> +            i2c@4 {
> +                #address-cells = <1>;
> +                #size-cells = <0>;
> +                reg = <4>;
> +
> +                rtc@51 {
> +                    compatible = "nxp,pcf8563";
> +                    reg = <0x51>;
> +                };
> +            };
> +        };
> +    };
> +...

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 2/6] dt-bindings: rtc: nxp,pcf8563: Convert to DT schema
  2021-05-18 23:28 ` [PATCH 2/6] dt-bindings: rtc: nxp,pcf8563: Convert to DT schema Rob Herring
@ 2021-05-19  1:25   ` Laurent Pinchart
  2021-05-25 21:27   ` Alexandre Belloni
  1 sibling, 0 replies; 20+ messages in thread
From: Laurent Pinchart @ 2021-05-19  1:25 UTC (permalink / raw)
  To: Rob Herring
  Cc: devicetree, Peter Rosin, Wolfram Sang, linux-kernel,
	Alexandre Belloni, Jacopo Mondi, Kieran Bingham,
	Kishon Vijay Abraham I, Lee Jones, Niklas Söderlund,
	Roger Quadros, Jonathan Cameron

Hi Rob,

Thank you for the patch.

On Tue, May 18, 2021 at 06:28:54PM -0500, Rob Herring wrote:
> Convert the Philips PCF8563/Epson RTC8564 binding to DT schema format.
> 
> Add 'interrupts' as this device has an interrupt which was not
> documented, but in use.
> 
> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
> Signed-off-by: Rob Herring <robh@kernel.org>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  .../devicetree/bindings/rtc/nxp,pcf8563.yaml  | 50 +++++++++++++++++++
>  .../devicetree/bindings/rtc/pcf8563.txt       | 29 -----------
>  2 files changed, 50 insertions(+), 29 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/rtc/nxp,pcf8563.yaml
>  delete mode 100644 Documentation/devicetree/bindings/rtc/pcf8563.txt
> 
> diff --git a/Documentation/devicetree/bindings/rtc/nxp,pcf8563.yaml b/Documentation/devicetree/bindings/rtc/nxp,pcf8563.yaml
> new file mode 100644
> index 000000000000..15e67be0ef95
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/rtc/nxp,pcf8563.yaml
> @@ -0,0 +1,50 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/rtc/nxp,pcf8563.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Philips PCF8563/Epson RTC8564 Real Time Clock
> +
> +maintainers:
> +  - Alexandre Belloni <alexandre.belloni@bootlin.com>
> +
> +properties:
> +  compatible:
> +    enum:
> +      - epson,rtc8564
> +      - microcrystal,rv8564
> +      - nxp,pcf8563
> +      - nxp,pca8565
> +
> +  reg:
> +    maxItems: 1
> +
> +  "#clock-cells":
> +    const: 0
> +
> +  clock-output-names:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +required:
> +  - compatible
> +  - reg
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        rtc@51 {
> +            compatible = "nxp,pcf8563";
> +            reg = <0x51>;
> +            #clock-cells = <0>;
> +        };
> +    };
> +...
> diff --git a/Documentation/devicetree/bindings/rtc/pcf8563.txt b/Documentation/devicetree/bindings/rtc/pcf8563.txt
> deleted file mode 100644
> index 0a900f7c8977..000000000000
> --- a/Documentation/devicetree/bindings/rtc/pcf8563.txt
> +++ /dev/null
> @@ -1,29 +0,0 @@
> -* Philips PCF8563/Epson RTC8564 Real Time Clock
> -
> -Philips PCF8563/Epson RTC8564 Real Time Clock
> -
> -Required properties:
> -- compatible: Should contain "nxp,pcf8563",
> -	"epson,rtc8564" or
> -	"microcrystal,rv8564" or
> -	"nxp,pca8565"
> -- reg: I2C address for chip.
> -
> -Optional property:
> -- #clock-cells: Should be 0.
> -- clock-output-names:
> -  overwrite the default clock name "pcf8563-clkout"
> -
> -Example:
> -
> -pcf8563: pcf8563@51 {
> -	compatible = "nxp,pcf8563";
> -	reg = <0x51>;
> -	#clock-cells = <0>;
> -};
> -
> -device {
> -...
> -	clocks = <&pcf8563>;
> -...
> -};

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 4/6] dt-bindings: i2c: Convert i2c-mux bindings to DT schema
  2021-05-18 23:28 ` [PATCH 4/6] dt-bindings: i2c: Convert i2c-mux bindings to DT schema Rob Herring
@ 2021-05-19  1:39   ` Laurent Pinchart
  2021-05-19  1:40     ` Laurent Pinchart
  2021-05-19  2:10     ` Rob Herring
  0 siblings, 2 replies; 20+ messages in thread
From: Laurent Pinchart @ 2021-05-19  1:39 UTC (permalink / raw)
  To: Rob Herring
  Cc: devicetree, Peter Rosin, Wolfram Sang, linux-kernel,
	Alexandre Belloni, Jacopo Mondi, Kieran Bingham,
	Kishon Vijay Abraham I, Lee Jones, Niklas Söderlund,
	Roger Quadros, Jonathan Cameron

Hi Rob,

Thank you for the patch.

On Tue, May 18, 2021 at 06:28:56PM -0500, Rob Herring wrote:
> As some of the example I2C devices don't have schemas yet, change them to
> ones that do.
> 
> Cc: Peter Rosin <peda@axentia.se>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  .../bindings/i2c/i2c-demux-pinctrl.txt        |   2 +-
>  .../devicetree/bindings/i2c/i2c-mux-gpio.txt  |   4 +-
>  .../devicetree/bindings/i2c/i2c-mux-gpmux.txt |  99 --------------
>  .../bindings/i2c/i2c-mux-gpmux.yaml           | 124 ++++++++++++++++++
>  .../bindings/i2c/i2c-mux-ltc4306.txt          |   4 +-
>  .../bindings/i2c/i2c-mux-pinctrl.txt          |   4 +-
>  .../devicetree/bindings/i2c/i2c-mux-reg.txt   |   4 +-
>  .../devicetree/bindings/i2c/i2c-mux.txt       |  73 -----------
>  .../devicetree/bindings/i2c/i2c-mux.yaml      |  87 ++++++++++++
>  9 files changed, 220 insertions(+), 181 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.txt
>  create mode 100644 Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.yaml
>  delete mode 100644 Documentation/devicetree/bindings/i2c/i2c-mux.txt
>  create mode 100644 Documentation/devicetree/bindings/i2c/i2c-mux.yaml
> 
> diff --git a/Documentation/devicetree/bindings/i2c/i2c-demux-pinctrl.txt b/Documentation/devicetree/bindings/i2c/i2c-demux-pinctrl.txt
> index 81b5d55086fa..86b2e433a969 100644
> --- a/Documentation/devicetree/bindings/i2c/i2c-demux-pinctrl.txt
> +++ b/Documentation/devicetree/bindings/i2c/i2c-demux-pinctrl.txt
> @@ -27,7 +27,7 @@ Required properties:
>  - i2c-bus-name: The name of this bus. Also needed as pinctrl-name for the I2C
>  		parents.
>  
> -Furthermore, I2C mux properties and child nodes. See i2c-mux.txt in this
> +Furthermore, I2C mux properties and child nodes. See i2c-mux.yaml in this
>  directory.
>  
>  Example:
> diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-gpio.txt b/Documentation/devicetree/bindings/i2c/i2c-mux-gpio.txt
> index 21da3ecbb370..e00d2b9e957a 100644
> --- a/Documentation/devicetree/bindings/i2c/i2c-mux-gpio.txt
> +++ b/Documentation/devicetree/bindings/i2c/i2c-mux-gpio.txt
> @@ -22,8 +22,8 @@ Required properties:
>  - 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.txt in this directory.
> -* I2C child bus nodes. See i2c-mux.txt in this directory.
> +* 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
> diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.txt b/Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.txt
> deleted file mode 100644
> index 057083a8ba17..000000000000
> --- a/Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.txt
> +++ /dev/null
> @@ -1,99 +0,0 @@
> -General Purpose I2C Bus Mux
> -
> -This binding describes an I2C bus multiplexer that uses a mux controller
> -from the mux subsystem to route the I2C signals.
> -
> -                                  .-----.  .-----.
> -                                  | dev |  | dev |
> -    .------------.                '-----'  '-----'
> -    | SoC        |                   |        |
> -    |            |          .--------+--------'
> -    |   .------. |  .------+    child bus A, on MUX value set to 0
> -    |   | I2C  |-|--| Mux  |
> -    |   '------' |  '--+---+    child bus B, on MUX value set to 1
> -    |   .------. |     |    '----------+--------+--------.
> -    |   | MUX- | |     |               |        |        |
> -    |   | Ctrl |-|-----+            .-----.  .-----.  .-----.
> -    |   '------' |                  | dev |  | dev |  | dev |
> -    '------------'                  '-----'  '-----'  '-----'
> -
> -Required properties:
> -- compatible: i2c-mux
> -- i2c-parent: The phandle of the I2C bus that this multiplexer's master-side
> -  port is connected to.
> -- mux-controls: The phandle of the mux controller to use for operating the
> -  mux.
> -* Standard I2C mux properties. See i2c-mux.txt in this directory.
> -* I2C child bus nodes. See i2c-mux.txt in this directory. The sub-bus number
> -  is also the mux-controller state described in ../mux/mux-controller.yaml
> -
> -Optional properties:
> -- mux-locked: If present, explicitly allow unrelated I2C transactions on the
> -  parent I2C adapter at these times:
> -   + during setup of the multiplexer
> -   + between setup of the multiplexer and the child bus I2C transaction
> -   + between the child bus I2C transaction and releasing of the multiplexer
> -   + during releasing of the multiplexer
> -  However, I2C transactions to devices behind all I2C multiplexers connected
> -  to the same parent adapter that this multiplexer is connected to are blocked
> -  for the full duration of the complete multiplexed I2C transaction (i.e.
> -  including the times covered by the above list).
> -  If mux-locked is not present, the multiplexer is assumed to be parent-locked.
> -  This means that no unrelated I2C transactions are allowed on the parent I2C
> -  adapter for the complete multiplexed I2C transaction.
> -  The properties of mux-locked and parent-locked multiplexers are discussed
> -  in more detail in Documentation/i2c/i2c-topology.rst.
> -
> -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 set as the state in the
> -mux controller.
> -
> -Example:
> -	mux: mux-controller {
> -		compatible = "gpio-mux";
> -		#mux-control-cells = <0>;
> -
> -		mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>,
> -			    <&pioA 1 GPIO_ACTIVE_HIGH>;
> -	};
> -
> -	i2c-mux {
> -		compatible = "i2c-mux";
> -		mux-locked;
> -		i2c-parent = <&i2c1>;
> -
> -		mux-controls = <&mux>;
> -
> -		#address-cells = <1>;
> -		#size-cells = <0>;
> -
> -		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>;
> -				reset-active-low;
> -			};
> -		};
> -
> -		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-gpmux.yaml b/Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.yaml
> new file mode 100644
> index 000000000000..3e6ea59aea68
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.yaml
> @@ -0,0 +1,124 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/i2c/i2c-mux-gpmux.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: General Purpose I2C Bus Mux
> +
> +maintainers:
> +  - Peter Rosin <peda@axentia.se>
> +
> +description: |+
> +  This binding describes an I2C bus multiplexer that uses a mux controller
> +  from the mux subsystem to route the I2C signals.
> +
> +                                    .-----.  .-----.
> +                                    | dev |  | dev |
> +      .------------.                '-----'  '-----'
> +      | SoC        |                   |        |
> +      |            |          .--------+--------'
> +      |   .------. |  .------+    child bus A, on MUX value set to 0
> +      |   | I2C  |-|--| Mux  |
> +      |   '------' |  '--+---+    child bus B, on MUX value set to 1
> +      |   .------. |     |    '----------+--------+--------.
> +      |   | MUX- | |     |               |        |        |
> +      |   | Ctrl |-|-----+            .-----.  .-----.  .-----.
> +      |   '------' |                  | dev |  | dev |  | dev |
> +      '------------'                  '-----'  '-----'  '-----'
> +
> +
> +
> +allOf:
> +  - $ref: /schemas/i2c/i2c-mux.yaml#
> +
> +properties:
> +  compatible:
> +    const: i2c-mux
> +
> +  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.
> +
> +  mux-controls:
> +    maxItems: 1
> +    description:
> +      The mux-controller states are the I2C sub-bus numbers.
> +
> +  mux-locked:
> +    type: boolean
> +    description: |
> +      Explicitly allow unrelated I2C transactions on the parent I2C adapter at
> +      these times:
> +       + during setup of the multiplexer
> +       + between setup of the multiplexer and the child bus I2C transaction
> +       + between the child bus I2C transaction and releasing of the multiplexer
> +       + during releasing of the multiplexer
> +
> +      However, I2C transactions to devices behind all I2C multiplexers connected
> +      to the same parent adapter that this multiplexer is connected to are blocked
> +      for the full duration of the complete multiplexed I2C transaction (i.e.
> +      including the times covered by the above list).
> +      If mux-locked is not present, the multiplexer is assumed to be parent-locked.
> +      This means that no unrelated I2C transactions are allowed on the parent I2C
> +      adapter for the complete multiplexed I2C transaction.
> +      The properties of mux-locked and parent-locked multiplexers are discussed
> +      in more detail in Documentation/i2c/i2c-topology.rst.
> +
> +required:
> +  - compatible
> +  - i2c-parent
> +  - mux-controls
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/gpio/gpio.h>
> +    mux: mux-controller {
> +        compatible = "gpio-mux";
> +        #mux-control-cells = <0>;
> +
> +        mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>,
> +                    <&pioA 1 GPIO_ACTIVE_HIGH>;
> +    };
> +
> +    i2c-mux {
> +        compatible = "i2c-mux";
> +        mux-locked;
> +        i2c-parent = <&i2c1>;
> +
> +        mux-controls = <&mux>;
> +
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        i2c@1 {
> +            reg = <1>;
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +
> +            gpio@20 {
> +                compatible = "nxp,pca9555";
> +                gpio-controller;
> +                #gpio-cells = <2>;
> +                reg = <0x20>;
> +            };
> +        };
> +
> +        i2c@3 {
> +            reg = <3>;
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +
> +            gpio@20 {
> +                compatible = "nxp,pca9555";
> +                gpio-controller;
> +                #gpio-cells = <2>;
> +                reg = <0x20>;
> +            };
> +        };
> +    };
> +...
> diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-ltc4306.txt b/Documentation/devicetree/bindings/i2c/i2c-mux-ltc4306.txt
> index 8b1e49cdce3f..29c4550c9782 100644
> --- a/Documentation/devicetree/bindings/i2c/i2c-mux-ltc4306.txt
> +++ b/Documentation/devicetree/bindings/i2c/i2c-mux-ltc4306.txt
> @@ -8,8 +8,8 @@ Required Properties:
>  
>    The following required properties are defined externally:
>  
> -  - Standard I2C mux properties. See i2c-mux.txt in this directory.
> -  - I2C child bus nodes. See i2c-mux.txt in this directory.
> +  - Standard I2C mux properties. See i2c-mux.yaml in this directory.
> +  - I2C child bus nodes. See i2c-mux.yaml in this directory.
>  
>  Optional Properties:
>  
> diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-pinctrl.txt b/Documentation/devicetree/bindings/i2c/i2c-mux-pinctrl.txt
> index 33119a98e144..997a287ed3f6 100644
> --- a/Documentation/devicetree/bindings/i2c/i2c-mux-pinctrl.txt
> +++ b/Documentation/devicetree/bindings/i2c/i2c-mux-pinctrl.txt
> @@ -28,9 +28,9 @@ 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.txt in this directory.
> +* Standard I2C mux properties. See i2c-mux.yaml in this directory.
>  
> -* I2C child bus nodes. See i2c-mux.txt 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
> diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-reg.txt b/Documentation/devicetree/bindings/i2c/i2c-mux-reg.txt
> index de00d7fc450b..b9d9755e4172 100644
> --- a/Documentation/devicetree/bindings/i2c/i2c-mux-reg.txt
> +++ b/Documentation/devicetree/bindings/i2c/i2c-mux-reg.txt
> @@ -7,8 +7,8 @@ Required properties:
>  - compatible: i2c-mux-reg
>  - i2c-parent: The phandle of the I2C bus that this multiplexer's master-side
>    port is connected to.
> -* Standard I2C mux properties. See i2c-mux.txt in this directory.
> -* I2C child bus nodes. See i2c-mux.txt in this directory.
> +* Standard I2C mux properties. See i2c-mux.yaml in this directory.
> +* I2C child bus nodes. See i2c-mux.yaml in this directory.
>  
>  Optional properties:
>  - reg: this pair of <offset size> specifies the register to control the mux.
> diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux.txt b/Documentation/devicetree/bindings/i2c/i2c-mux.txt
> deleted file mode 100644
> index b38f58a1c878..000000000000
> --- a/Documentation/devicetree/bindings/i2c/i2c-mux.txt
> +++ /dev/null
> @@ -1,73 +0,0 @@
> -Common i2c bus multiplexer/switch properties.
> -
> -An i2c bus multiplexer/switch will have several child busses that are
> -numbered uniquely in a device dependent manner.  The nodes for an i2c bus
> -multiplexer/switch will have one child node for each child bus.
> -
> -Optional properties:
> -- #address-cells = <1>;
> -   This property is required if the i2c-mux child node does not exist.
> -
> -- #size-cells = <0>;
> -   This property is required if the i2c-mux child node does not exist.
> -
> -- i2c-mux
> -   For i2c multiplexers/switches that have child nodes that are a mixture
> -   of both i2c child busses and other child nodes, the 'i2c-mux' subnode
> -   can be used for populating the i2c child busses.  If an 'i2c-mux'
> -   subnode is present, only subnodes of this will be considered as i2c
> -   child busses.
> -
> -Required properties for the i2c-mux child node:
> -- #address-cells = <1>;
> -- #size-cells = <0>;
> -
> -Required properties for i2c child bus nodes:
> -- #address-cells = <1>;
> -- #size-cells = <0>;
> -- reg : The sub-bus number.
> -
> -Optional properties for i2c child bus nodes:
> -- Other properties specific to the multiplexer/switch hardware.
> -- Child nodes conforming to i2c bus binding
> -
> -
> -Example :
> -
> -	/*
> -	   An NXP pca9548 8 channel I2C multiplexer at address 0x70
> -	   with two NXP pca8574 GPIO expanders attached, one each to
> -	   ports 3 and 4.
> -	 */
> -
> -	mux@70 {
> -		compatible = "nxp,pca9548";
> -		reg = <0x70>;
> -		#address-cells = <1>;
> -		#size-cells = <0>;
> -
> -		i2c@3 {
> -			#address-cells = <1>;
> -			#size-cells = <0>;
> -			reg = <3>;
> -
> -			gpio1: gpio@38 {
> -				compatible = "nxp,pca8574";
> -				reg = <0x38>;
> -				#gpio-cells = <2>;
> -				gpio-controller;
> -			};
> -		};
> -		i2c@4 {
> -			#address-cells = <1>;
> -			#size-cells = <0>;
> -			reg = <4>;
> -
> -			gpio2: gpio@38 {
> -				compatible = "nxp,pca8574";
> -				reg = <0x38>;
> -				#gpio-cells = <2>;
> -				gpio-controller;
> -			};
> -		};
> -	};
> diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux.yaml b/Documentation/devicetree/bindings/i2c/i2c-mux.yaml
> new file mode 100644
> index 000000000000..3aa4d84a6610
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/i2c/i2c-mux.yaml
> @@ -0,0 +1,87 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/i2c/i2c-mux.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Common i2c bus multiplexer/switch properties.
> +
> +maintainers:
> +  - Peter Rosin <peda@axentia.se>
> +
> +description: |+
> +  An i2c bus multiplexer/switch will have several child busses that are numbered
> +  uniquely in a device dependent manner.  The nodes for an i2c bus
> +  multiplexer/switch will have one child node for each child bus.
> +
> +  For i2c multiplexers/switches that have child nodes that are a mixture of both
> +  i2c child busses and other child nodes, the 'i2c-mux' subnode can be used for
> +  populating the i2c child busses.  If an 'i2c-mux' subnode is present, only
> +  subnodes of this will be considered as i2c child busses.

As I understand this, it means that child nodes corresponding to child
buses can be either direct children of the I2C mux node, or grouped in a
i2c-mux node (the same way we optionally group the 'port' nodes in a
'ports' node). This doesn't seem to be supported by the bindings below.

> +
> +properties:
> +  $nodename:
> +    pattern: '^(i2c-?)?mux'
> +
> +  '#address-cells':
> +    const: 1
> +
> +  '#size-cells':
> +    const: 0
> +
> +patternProperties:
> +  '^i2c@[0-9a-f]+$':
> +    $ref: /schemas/i2c/i2c-controller.yaml
> +    unevaluatedProperties: false
> +
> +    properties:
> +      reg:
> +        description: The mux selector sub-bus number for the child I2C bus.
> +        maxItems: 1
> +
> +additionalProperties: true
> +
> +examples:
> +  - |
> +    /*
> +       An NXP pca9548 8 channel I2C multiplexer at address 0x70
> +       with two NXP pca8574 GPIO expanders attached, one each to
> +       ports 3 and 4.

I'd add the missing * while at it.

> +     */
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        i2c-mux@70 {
> +            compatible = "nxp,pca9548";
> +            reg = <0x70>;
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +
> +            i2c@3 {
> +                #address-cells = <1>;
> +                #size-cells = <0>;
> +                reg = <3>;
> +
> +                gpio@20 {
> +                    compatible = "nxp,pca9555";
> +                    gpio-controller;
> +                    #gpio-cells = <2>;
> +                    reg = <0x20>;
> +                };
> +            };
> +            i2c@4 {
> +                #address-cells = <1>;
> +                #size-cells = <0>;
> +                reg = <4>;
> +
> +                gpio@20 {
> +                    compatible = "nxp,pca9555";
> +                    gpio-controller;
> +                    #gpio-cells = <2>;
> +                    reg = <0x20>;
> +                };
> +            };
> +        };
> +    };
> +...

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 4/6] dt-bindings: i2c: Convert i2c-mux bindings to DT schema
  2021-05-19  1:39   ` Laurent Pinchart
@ 2021-05-19  1:40     ` Laurent Pinchart
  2021-05-19  2:10     ` Rob Herring
  1 sibling, 0 replies; 20+ messages in thread
From: Laurent Pinchart @ 2021-05-19  1:40 UTC (permalink / raw)
  To: Rob Herring
  Cc: devicetree, Peter Rosin, Wolfram Sang, linux-kernel,
	Alexandre Belloni, Jacopo Mondi, Kieran Bingham,
	Kishon Vijay Abraham I, Lee Jones, Niklas Söderlund,
	Roger Quadros, Jonathan Cameron

Hi Rob,

One more comment.

On Wed, May 19, 2021 at 04:39:11AM +0300, Laurent Pinchart wrote:
> On Tue, May 18, 2021 at 06:28:56PM -0500, Rob Herring wrote:
> > As some of the example I2C devices don't have schemas yet, change them to
> > ones that do.
> > 
> > Cc: Peter Rosin <peda@axentia.se>
> > Signed-off-by: Rob Herring <robh@kernel.org>
> > ---
> >  .../bindings/i2c/i2c-demux-pinctrl.txt        |   2 +-
> >  .../devicetree/bindings/i2c/i2c-mux-gpio.txt  |   4 +-
> >  .../devicetree/bindings/i2c/i2c-mux-gpmux.txt |  99 --------------
> >  .../bindings/i2c/i2c-mux-gpmux.yaml           | 124 ++++++++++++++++++
> >  .../bindings/i2c/i2c-mux-ltc4306.txt          |   4 +-
> >  .../bindings/i2c/i2c-mux-pinctrl.txt          |   4 +-
> >  .../devicetree/bindings/i2c/i2c-mux-reg.txt   |   4 +-
> >  .../devicetree/bindings/i2c/i2c-mux.txt       |  73 -----------
> >  .../devicetree/bindings/i2c/i2c-mux.yaml      |  87 ++++++++++++
> >  9 files changed, 220 insertions(+), 181 deletions(-)
> >  delete mode 100644 Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.txt
> >  create mode 100644 Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.yaml
> >  delete mode 100644 Documentation/devicetree/bindings/i2c/i2c-mux.txt
> >  create mode 100644 Documentation/devicetree/bindings/i2c/i2c-mux.yaml
> > 
> > diff --git a/Documentation/devicetree/bindings/i2c/i2c-demux-pinctrl.txt b/Documentation/devicetree/bindings/i2c/i2c-demux-pinctrl.txt
> > index 81b5d55086fa..86b2e433a969 100644
> > --- a/Documentation/devicetree/bindings/i2c/i2c-demux-pinctrl.txt
> > +++ b/Documentation/devicetree/bindings/i2c/i2c-demux-pinctrl.txt
> > @@ -27,7 +27,7 @@ Required properties:
> >  - i2c-bus-name: The name of this bus. Also needed as pinctrl-name for the I2C
> >  		parents.
> >  
> > -Furthermore, I2C mux properties and child nodes. See i2c-mux.txt in this
> > +Furthermore, I2C mux properties and child nodes. See i2c-mux.yaml in this
> >  directory.
> >  
> >  Example:
> > diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-gpio.txt b/Documentation/devicetree/bindings/i2c/i2c-mux-gpio.txt
> > index 21da3ecbb370..e00d2b9e957a 100644
> > --- a/Documentation/devicetree/bindings/i2c/i2c-mux-gpio.txt
> > +++ b/Documentation/devicetree/bindings/i2c/i2c-mux-gpio.txt
> > @@ -22,8 +22,8 @@ Required properties:
> >  - 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.txt in this directory.
> > -* I2C child bus nodes. See i2c-mux.txt in this directory.
> > +* 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
> > diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.txt b/Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.txt
> > deleted file mode 100644
> > index 057083a8ba17..000000000000
> > --- a/Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.txt
> > +++ /dev/null
> > @@ -1,99 +0,0 @@
> > -General Purpose I2C Bus Mux
> > -
> > -This binding describes an I2C bus multiplexer that uses a mux controller
> > -from the mux subsystem to route the I2C signals.
> > -
> > -                                  .-----.  .-----.
> > -                                  | dev |  | dev |
> > -    .------------.                '-----'  '-----'
> > -    | SoC        |                   |        |
> > -    |            |          .--------+--------'
> > -    |   .------. |  .------+    child bus A, on MUX value set to 0
> > -    |   | I2C  |-|--| Mux  |
> > -    |   '------' |  '--+---+    child bus B, on MUX value set to 1
> > -    |   .------. |     |    '----------+--------+--------.
> > -    |   | MUX- | |     |               |        |        |
> > -    |   | Ctrl |-|-----+            .-----.  .-----.  .-----.
> > -    |   '------' |                  | dev |  | dev |  | dev |
> > -    '------------'                  '-----'  '-----'  '-----'
> > -
> > -Required properties:
> > -- compatible: i2c-mux
> > -- i2c-parent: The phandle of the I2C bus that this multiplexer's master-side
> > -  port is connected to.
> > -- mux-controls: The phandle of the mux controller to use for operating the
> > -  mux.
> > -* Standard I2C mux properties. See i2c-mux.txt in this directory.
> > -* I2C child bus nodes. See i2c-mux.txt in this directory. The sub-bus number
> > -  is also the mux-controller state described in ../mux/mux-controller.yaml
> > -
> > -Optional properties:
> > -- mux-locked: If present, explicitly allow unrelated I2C transactions on the
> > -  parent I2C adapter at these times:
> > -   + during setup of the multiplexer
> > -   + between setup of the multiplexer and the child bus I2C transaction
> > -   + between the child bus I2C transaction and releasing of the multiplexer
> > -   + during releasing of the multiplexer
> > -  However, I2C transactions to devices behind all I2C multiplexers connected
> > -  to the same parent adapter that this multiplexer is connected to are blocked
> > -  for the full duration of the complete multiplexed I2C transaction (i.e.
> > -  including the times covered by the above list).
> > -  If mux-locked is not present, the multiplexer is assumed to be parent-locked.
> > -  This means that no unrelated I2C transactions are allowed on the parent I2C
> > -  adapter for the complete multiplexed I2C transaction.
> > -  The properties of mux-locked and parent-locked multiplexers are discussed
> > -  in more detail in Documentation/i2c/i2c-topology.rst.
> > -
> > -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 set as the state in the
> > -mux controller.
> > -
> > -Example:
> > -	mux: mux-controller {
> > -		compatible = "gpio-mux";
> > -		#mux-control-cells = <0>;
> > -
> > -		mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>,
> > -			    <&pioA 1 GPIO_ACTIVE_HIGH>;
> > -	};
> > -
> > -	i2c-mux {
> > -		compatible = "i2c-mux";
> > -		mux-locked;
> > -		i2c-parent = <&i2c1>;
> > -
> > -		mux-controls = <&mux>;
> > -
> > -		#address-cells = <1>;
> > -		#size-cells = <0>;
> > -
> > -		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>;
> > -				reset-active-low;
> > -			};
> > -		};
> > -
> > -		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-gpmux.yaml b/Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.yaml
> > new file mode 100644
> > index 000000000000..3e6ea59aea68
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.yaml
> > @@ -0,0 +1,124 @@
> > +# SPDX-License-Identifier: GPL-2.0
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/i2c/i2c-mux-gpmux.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: General Purpose I2C Bus Mux
> > +
> > +maintainers:
> > +  - Peter Rosin <peda@axentia.se>
> > +
> > +description: |+
> > +  This binding describes an I2C bus multiplexer that uses a mux controller
> > +  from the mux subsystem to route the I2C signals.
> > +
> > +                                    .-----.  .-----.
> > +                                    | dev |  | dev |
> > +      .------------.                '-----'  '-----'
> > +      | SoC        |                   |        |
> > +      |            |          .--------+--------'
> > +      |   .------. |  .------+    child bus A, on MUX value set to 0
> > +      |   | I2C  |-|--| Mux  |
> > +      |   '------' |  '--+---+    child bus B, on MUX value set to 1
> > +      |   .------. |     |    '----------+--------+--------.
> > +      |   | MUX- | |     |               |        |        |
> > +      |   | Ctrl |-|-----+            .-----.  .-----.  .-----.
> > +      |   '------' |                  | dev |  | dev |  | dev |
> > +      '------------'                  '-----'  '-----'  '-----'
> > +
> > +
> > +
> > +allOf:
> > +  - $ref: /schemas/i2c/i2c-mux.yaml#
> > +
> > +properties:
> > +  compatible:
> > +    const: i2c-mux
> > +
> > +  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.
> > +
> > +  mux-controls:
> > +    maxItems: 1
> > +    description:
> > +      The mux-controller states are the I2C sub-bus numbers.
> > +
> > +  mux-locked:
> > +    type: boolean
> > +    description: |
> > +      Explicitly allow unrelated I2C transactions on the parent I2C adapter at
> > +      these times:
> > +       + during setup of the multiplexer
> > +       + between setup of the multiplexer and the child bus I2C transaction
> > +       + between the child bus I2C transaction and releasing of the multiplexer
> > +       + during releasing of the multiplexer

I know it comes from the original .txt file, but '+' is a weird marker
for a list. Could we replace them with '-' while at it ?

> > +
> > +      However, I2C transactions to devices behind all I2C multiplexers connected
> > +      to the same parent adapter that this multiplexer is connected to are blocked
> > +      for the full duration of the complete multiplexed I2C transaction (i.e.
> > +      including the times covered by the above list).
> > +      If mux-locked is not present, the multiplexer is assumed to be parent-locked.
> > +      This means that no unrelated I2C transactions are allowed on the parent I2C
> > +      adapter for the complete multiplexed I2C transaction.
> > +      The properties of mux-locked and parent-locked multiplexers are discussed
> > +      in more detail in Documentation/i2c/i2c-topology.rst.
> > +
> > +required:
> > +  - compatible
> > +  - i2c-parent
> > +  - mux-controls
> > +
> > +unevaluatedProperties: false
> > +
> > +examples:
> > +  - |
> > +    #include <dt-bindings/gpio/gpio.h>
> > +    mux: mux-controller {
> > +        compatible = "gpio-mux";
> > +        #mux-control-cells = <0>;
> > +
> > +        mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>,
> > +                    <&pioA 1 GPIO_ACTIVE_HIGH>;
> > +    };
> > +
> > +    i2c-mux {
> > +        compatible = "i2c-mux";
> > +        mux-locked;
> > +        i2c-parent = <&i2c1>;
> > +
> > +        mux-controls = <&mux>;
> > +
> > +        #address-cells = <1>;
> > +        #size-cells = <0>;
> > +
> > +        i2c@1 {
> > +            reg = <1>;
> > +            #address-cells = <1>;
> > +            #size-cells = <0>;
> > +
> > +            gpio@20 {
> > +                compatible = "nxp,pca9555";
> > +                gpio-controller;
> > +                #gpio-cells = <2>;
> > +                reg = <0x20>;
> > +            };
> > +        };
> > +
> > +        i2c@3 {
> > +            reg = <3>;
> > +            #address-cells = <1>;
> > +            #size-cells = <0>;
> > +
> > +            gpio@20 {
> > +                compatible = "nxp,pca9555";
> > +                gpio-controller;
> > +                #gpio-cells = <2>;
> > +                reg = <0x20>;
> > +            };
> > +        };
> > +    };
> > +...
> > diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-ltc4306.txt b/Documentation/devicetree/bindings/i2c/i2c-mux-ltc4306.txt
> > index 8b1e49cdce3f..29c4550c9782 100644
> > --- a/Documentation/devicetree/bindings/i2c/i2c-mux-ltc4306.txt
> > +++ b/Documentation/devicetree/bindings/i2c/i2c-mux-ltc4306.txt
> > @@ -8,8 +8,8 @@ Required Properties:
> >  
> >    The following required properties are defined externally:
> >  
> > -  - Standard I2C mux properties. See i2c-mux.txt in this directory.
> > -  - I2C child bus nodes. See i2c-mux.txt in this directory.
> > +  - Standard I2C mux properties. See i2c-mux.yaml in this directory.
> > +  - I2C child bus nodes. See i2c-mux.yaml in this directory.
> >  
> >  Optional Properties:
> >  
> > diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-pinctrl.txt b/Documentation/devicetree/bindings/i2c/i2c-mux-pinctrl.txt
> > index 33119a98e144..997a287ed3f6 100644
> > --- a/Documentation/devicetree/bindings/i2c/i2c-mux-pinctrl.txt
> > +++ b/Documentation/devicetree/bindings/i2c/i2c-mux-pinctrl.txt
> > @@ -28,9 +28,9 @@ 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.txt in this directory.
> > +* Standard I2C mux properties. See i2c-mux.yaml in this directory.
> >  
> > -* I2C child bus nodes. See i2c-mux.txt 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
> > diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-reg.txt b/Documentation/devicetree/bindings/i2c/i2c-mux-reg.txt
> > index de00d7fc450b..b9d9755e4172 100644
> > --- a/Documentation/devicetree/bindings/i2c/i2c-mux-reg.txt
> > +++ b/Documentation/devicetree/bindings/i2c/i2c-mux-reg.txt
> > @@ -7,8 +7,8 @@ Required properties:
> >  - compatible: i2c-mux-reg
> >  - i2c-parent: The phandle of the I2C bus that this multiplexer's master-side
> >    port is connected to.
> > -* Standard I2C mux properties. See i2c-mux.txt in this directory.
> > -* I2C child bus nodes. See i2c-mux.txt in this directory.
> > +* Standard I2C mux properties. See i2c-mux.yaml in this directory.
> > +* I2C child bus nodes. See i2c-mux.yaml in this directory.
> >  
> >  Optional properties:
> >  - reg: this pair of <offset size> specifies the register to control the mux.
> > diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux.txt b/Documentation/devicetree/bindings/i2c/i2c-mux.txt
> > deleted file mode 100644
> > index b38f58a1c878..000000000000
> > --- a/Documentation/devicetree/bindings/i2c/i2c-mux.txt
> > +++ /dev/null
> > @@ -1,73 +0,0 @@
> > -Common i2c bus multiplexer/switch properties.
> > -
> > -An i2c bus multiplexer/switch will have several child busses that are
> > -numbered uniquely in a device dependent manner.  The nodes for an i2c bus
> > -multiplexer/switch will have one child node for each child bus.
> > -
> > -Optional properties:
> > -- #address-cells = <1>;
> > -   This property is required if the i2c-mux child node does not exist.
> > -
> > -- #size-cells = <0>;
> > -   This property is required if the i2c-mux child node does not exist.
> > -
> > -- i2c-mux
> > -   For i2c multiplexers/switches that have child nodes that are a mixture
> > -   of both i2c child busses and other child nodes, the 'i2c-mux' subnode
> > -   can be used for populating the i2c child busses.  If an 'i2c-mux'
> > -   subnode is present, only subnodes of this will be considered as i2c
> > -   child busses.
> > -
> > -Required properties for the i2c-mux child node:
> > -- #address-cells = <1>;
> > -- #size-cells = <0>;
> > -
> > -Required properties for i2c child bus nodes:
> > -- #address-cells = <1>;
> > -- #size-cells = <0>;
> > -- reg : The sub-bus number.
> > -
> > -Optional properties for i2c child bus nodes:
> > -- Other properties specific to the multiplexer/switch hardware.
> > -- Child nodes conforming to i2c bus binding
> > -
> > -
> > -Example :
> > -
> > -	/*
> > -	   An NXP pca9548 8 channel I2C multiplexer at address 0x70
> > -	   with two NXP pca8574 GPIO expanders attached, one each to
> > -	   ports 3 and 4.
> > -	 */
> > -
> > -	mux@70 {
> > -		compatible = "nxp,pca9548";
> > -		reg = <0x70>;
> > -		#address-cells = <1>;
> > -		#size-cells = <0>;
> > -
> > -		i2c@3 {
> > -			#address-cells = <1>;
> > -			#size-cells = <0>;
> > -			reg = <3>;
> > -
> > -			gpio1: gpio@38 {
> > -				compatible = "nxp,pca8574";
> > -				reg = <0x38>;
> > -				#gpio-cells = <2>;
> > -				gpio-controller;
> > -			};
> > -		};
> > -		i2c@4 {
> > -			#address-cells = <1>;
> > -			#size-cells = <0>;
> > -			reg = <4>;
> > -
> > -			gpio2: gpio@38 {
> > -				compatible = "nxp,pca8574";
> > -				reg = <0x38>;
> > -				#gpio-cells = <2>;
> > -				gpio-controller;
> > -			};
> > -		};
> > -	};
> > diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux.yaml b/Documentation/devicetree/bindings/i2c/i2c-mux.yaml
> > new file mode 100644
> > index 000000000000..3aa4d84a6610
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/i2c/i2c-mux.yaml
> > @@ -0,0 +1,87 @@
> > +# SPDX-License-Identifier: GPL-2.0
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/i2c/i2c-mux.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Common i2c bus multiplexer/switch properties.
> > +
> > +maintainers:
> > +  - Peter Rosin <peda@axentia.se>
> > +
> > +description: |+
> > +  An i2c bus multiplexer/switch will have several child busses that are numbered
> > +  uniquely in a device dependent manner.  The nodes for an i2c bus
> > +  multiplexer/switch will have one child node for each child bus.
> > +
> > +  For i2c multiplexers/switches that have child nodes that are a mixture of both
> > +  i2c child busses and other child nodes, the 'i2c-mux' subnode can be used for
> > +  populating the i2c child busses.  If an 'i2c-mux' subnode is present, only
> > +  subnodes of this will be considered as i2c child busses.
> 
> As I understand this, it means that child nodes corresponding to child
> buses can be either direct children of the I2C mux node, or grouped in a
> i2c-mux node (the same way we optionally group the 'port' nodes in a
> 'ports' node). This doesn't seem to be supported by the bindings below.
> 
> > +
> > +properties:
> > +  $nodename:
> > +    pattern: '^(i2c-?)?mux'
> > +
> > +  '#address-cells':
> > +    const: 1
> > +
> > +  '#size-cells':
> > +    const: 0
> > +
> > +patternProperties:
> > +  '^i2c@[0-9a-f]+$':
> > +    $ref: /schemas/i2c/i2c-controller.yaml
> > +    unevaluatedProperties: false
> > +
> > +    properties:
> > +      reg:
> > +        description: The mux selector sub-bus number for the child I2C bus.
> > +        maxItems: 1
> > +
> > +additionalProperties: true
> > +
> > +examples:
> > +  - |
> > +    /*
> > +       An NXP pca9548 8 channel I2C multiplexer at address 0x70
> > +       with two NXP pca8574 GPIO expanders attached, one each to
> > +       ports 3 and 4.
> 
> I'd add the missing * while at it.
> 
> > +     */
> > +    i2c {
> > +        #address-cells = <1>;
> > +        #size-cells = <0>;
> > +
> > +        i2c-mux@70 {
> > +            compatible = "nxp,pca9548";
> > +            reg = <0x70>;
> > +            #address-cells = <1>;
> > +            #size-cells = <0>;
> > +
> > +            i2c@3 {
> > +                #address-cells = <1>;
> > +                #size-cells = <0>;
> > +                reg = <3>;
> > +
> > +                gpio@20 {
> > +                    compatible = "nxp,pca9555";
> > +                    gpio-controller;
> > +                    #gpio-cells = <2>;
> > +                    reg = <0x20>;
> > +                };
> > +            };
> > +            i2c@4 {
> > +                #address-cells = <1>;
> > +                #size-cells = <0>;
> > +                reg = <4>;
> > +
> > +                gpio@20 {
> > +                    compatible = "nxp,pca9555";
> > +                    gpio-controller;
> > +                    #gpio-cells = <2>;
> > +                    reg = <0x20>;
> > +                };
> > +            };
> > +        };
> > +    };
> > +...

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 5/6] dt-bindings: i2c: i2c-mux-pca954x: Convert to DT schema
  2021-05-19  1:23   ` Laurent Pinchart
@ 2021-05-19  2:02     ` Rob Herring
  0 siblings, 0 replies; 20+ messages in thread
From: Rob Herring @ 2021-05-19  2:02 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: devicetree, Peter Rosin, Wolfram Sang, linux-kernel,
	Alexandre Belloni, Jacopo Mondi, Kieran Bingham,
	Kishon Vijay Abraham I, Lee Jones, Niklas Söderlund,
	Roger Quadros, Jonathan Cameron

On Tue, May 18, 2021 at 8:23 PM Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
>
> Hi Rob,
>
> Thank you for the patch.
>
> On Tue, May 18, 2021 at 06:28:57PM -0500, Rob Herring wrote:
> > Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > Signed-off-by: Rob Herring <robh@kernel.org>
> > ---
> >  .../bindings/i2c/i2c-mux-pca954x.txt          |  74 ------------
> >  .../bindings/i2c/i2c-mux-pca954x.yaml         | 106 ++++++++++++++++++
> >  2 files changed, 106 insertions(+), 74 deletions(-)
> >  delete mode 100644 Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.txt
> >  create mode 100644 Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.txt b/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.txt
> > deleted file mode 100644
> > index 9f3f3eb67e87..000000000000
> > --- a/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.txt
> > +++ /dev/null
> > @@ -1,74 +0,0 @@
> > -* NXP PCA954x I2C bus switch
> > -
> > -The driver supports NXP PCA954x and PCA984x I2C mux/switch devices.
> > -
> > -Required Properties:
> > -
> > -  - compatible: Must contain one of the following.
> > -    "nxp,pca9540",
> > -    "nxp,pca9542",
> > -    "nxp,pca9543",
> > -    "nxp,pca9544",
> > -    "nxp,pca9545",
> > -    "nxp,pca9546", "nxp,pca9846",
> > -    "nxp,pca9547", "nxp,pca9847",
> > -    "nxp,pca9548", "nxp,pca9848",
> > -    "nxp,pca9849"
> > -
> > -  - reg: The I2C address of the device.
> > -
> > -  The following required properties are defined externally:
> > -
> > -  - Standard I2C mux properties. See i2c-mux.txt in this directory.
> > -  - I2C child bus nodes. See i2c-mux.txt in this directory.
> > -
> > -Optional Properties:
> > -
> > -  - reset-gpios: Reference to the GPIO connected to the reset input.
> > -  - idle-state: if present, overrides i2c-mux-idle-disconnect,
> > -    Please refer to Documentation/devicetree/bindings/mux/mux-controller.yaml
> > -  - i2c-mux-idle-disconnect: Boolean; if defined, forces mux to disconnect all
> > -    children in idle state. This is necessary for example, if there are several
> > -    multiplexers on the bus and the devices behind them use same I2C addresses.
> > -  - interrupts: Interrupt mapping for IRQ.
> > -  - interrupt-controller: Marks the device node as an interrupt controller.
> > -  - #interrupt-cells : Should be two.
> > -    - first cell is the pin number
> > -    - second cell is used to specify flags.
> > -    See also Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
> > -
> > -Example:
> > -
> > -     i2c-switch@74 {
> > -             compatible = "nxp,pca9548";
> > -             #address-cells = <1>;
> > -             #size-cells = <0>;
> > -             reg = <0x74>;
> > -
> > -             interrupt-parent = <&ipic>;
> > -             interrupts = <17 IRQ_TYPE_LEVEL_LOW>;
> > -             interrupt-controller;
> > -             #interrupt-cells = <2>;
> > -
> > -             i2c@2 {
> > -                     #address-cells = <1>;
> > -                     #size-cells = <0>;
> > -                     reg = <2>;
> > -
> > -                     eeprom@54 {
> > -                             compatible = "atmel,24c08";
> > -                             reg = <0x54>;
> > -                     };
> > -             };
> > -
> > -             i2c@4 {
> > -                     #address-cells = <1>;
> > -                     #size-cells = <0>;
> > -                     reg = <4>;
> > -
> > -                     rtc@51 {
> > -                             compatible = "nxp,pcf8563";
> > -                             reg = <0x51>;
> > -                     };
> > -             };
> > -     };
> > diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.yaml b/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.yaml
> > new file mode 100644
> > index 000000000000..82d9101098c7
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.yaml
> > @@ -0,0 +1,106 @@
> > +# SPDX-License-Identifier: GPL-2.0
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/i2c/i2c-mux-pca954x.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: NXP PCA954x I2C bus switch
> > +
> > +maintainers:
> > +  - Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > +
> > +description:
> > +  The binding supports NXP PCA954x and PCA984x I2C mux/switch devices.
> > +
> > +allOf:
> > +  - $ref: /schemas/i2c/i2c-mux.yaml#
> > +
> > +properties:
> > +  compatible:
> > +    enum:
> > +      - nxp,pca9540
> > +      - nxp,pca9542
> > +      - nxp,pca9543
> > +      - nxp,pca9544
> > +      - nxp,pca9545
> > +      - nxp,pca9546
> > +      - nxp,pca9547
> > +      - nxp,pca9548
> > +      - nxp,pca9849
>
> I'd put this entry last to keep them alphabetically sorted.

Sigh, that was my intent...

> While at it, could you add nxp,pca9646 as the driver supports it ?

Sure.

> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Thanks!

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 4/6] dt-bindings: i2c: Convert i2c-mux bindings to DT schema
  2021-05-19  1:39   ` Laurent Pinchart
  2021-05-19  1:40     ` Laurent Pinchart
@ 2021-05-19  2:10     ` Rob Herring
  1 sibling, 0 replies; 20+ messages in thread
From: Rob Herring @ 2021-05-19  2:10 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: devicetree, Peter Rosin, Wolfram Sang, linux-kernel,
	Alexandre Belloni, Jacopo Mondi, Kieran Bingham,
	Kishon Vijay Abraham I, Lee Jones, Niklas Söderlund,
	Roger Quadros, Jonathan Cameron

On Tue, May 18, 2021 at 8:39 PM Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
>
> Hi Rob,
>
> Thank you for the patch.
>
> On Tue, May 18, 2021 at 06:28:56PM -0500, Rob Herring wrote:
> > As some of the example I2C devices don't have schemas yet, change them to
> > ones that do.
> >
> > Cc: Peter Rosin <peda@axentia.se>
> > Signed-off-by: Rob Herring <robh@kernel.org>
> > ---
> >  .../bindings/i2c/i2c-demux-pinctrl.txt        |   2 +-
> >  .../devicetree/bindings/i2c/i2c-mux-gpio.txt  |   4 +-
> >  .../devicetree/bindings/i2c/i2c-mux-gpmux.txt |  99 --------------
> >  .../bindings/i2c/i2c-mux-gpmux.yaml           | 124 ++++++++++++++++++
> >  .../bindings/i2c/i2c-mux-ltc4306.txt          |   4 +-
> >  .../bindings/i2c/i2c-mux-pinctrl.txt          |   4 +-
> >  .../devicetree/bindings/i2c/i2c-mux-reg.txt   |   4 +-
> >  .../devicetree/bindings/i2c/i2c-mux.txt       |  73 -----------
> >  .../devicetree/bindings/i2c/i2c-mux.yaml      |  87 ++++++++++++
> >  9 files changed, 220 insertions(+), 181 deletions(-)
> >  delete mode 100644 Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.txt
> >  create mode 100644 Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.yaml
> >  delete mode 100644 Documentation/devicetree/bindings/i2c/i2c-mux.txt
> >  create mode 100644 Documentation/devicetree/bindings/i2c/i2c-mux.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/i2c/i2c-demux-pinctrl.txt b/Documentation/devicetree/bindings/i2c/i2c-demux-pinctrl.txt
> > index 81b5d55086fa..86b2e433a969 100644
> > --- a/Documentation/devicetree/bindings/i2c/i2c-demux-pinctrl.txt
> > +++ b/Documentation/devicetree/bindings/i2c/i2c-demux-pinctrl.txt
> > @@ -27,7 +27,7 @@ Required properties:
> >  - i2c-bus-name: The name of this bus. Also needed as pinctrl-name for the I2C
> >               parents.
> >
> > -Furthermore, I2C mux properties and child nodes. See i2c-mux.txt in this
> > +Furthermore, I2C mux properties and child nodes. See i2c-mux.yaml in this
> >  directory.
> >
> >  Example:
> > diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-gpio.txt b/Documentation/devicetree/bindings/i2c/i2c-mux-gpio.txt
> > index 21da3ecbb370..e00d2b9e957a 100644
> > --- a/Documentation/devicetree/bindings/i2c/i2c-mux-gpio.txt
> > +++ b/Documentation/devicetree/bindings/i2c/i2c-mux-gpio.txt
> > @@ -22,8 +22,8 @@ Required properties:
> >  - 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.txt in this directory.
> > -* I2C child bus nodes. See i2c-mux.txt in this directory.
> > +* 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
> > diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.txt b/Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.txt
> > deleted file mode 100644
> > index 057083a8ba17..000000000000
> > --- a/Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.txt
> > +++ /dev/null
> > @@ -1,99 +0,0 @@
> > -General Purpose I2C Bus Mux
> > -
> > -This binding describes an I2C bus multiplexer that uses a mux controller
> > -from the mux subsystem to route the I2C signals.
> > -
> > -                                  .-----.  .-----.
> > -                                  | dev |  | dev |
> > -    .------------.                '-----'  '-----'
> > -    | SoC        |                   |        |
> > -    |            |          .--------+--------'
> > -    |   .------. |  .------+    child bus A, on MUX value set to 0
> > -    |   | I2C  |-|--| Mux  |
> > -    |   '------' |  '--+---+    child bus B, on MUX value set to 1
> > -    |   .------. |     |    '----------+--------+--------.
> > -    |   | MUX- | |     |               |        |        |
> > -    |   | Ctrl |-|-----+            .-----.  .-----.  .-----.
> > -    |   '------' |                  | dev |  | dev |  | dev |
> > -    '------------'                  '-----'  '-----'  '-----'
> > -
> > -Required properties:
> > -- compatible: i2c-mux
> > -- i2c-parent: The phandle of the I2C bus that this multiplexer's master-side
> > -  port is connected to.
> > -- mux-controls: The phandle of the mux controller to use for operating the
> > -  mux.
> > -* Standard I2C mux properties. See i2c-mux.txt in this directory.
> > -* I2C child bus nodes. See i2c-mux.txt in this directory. The sub-bus number
> > -  is also the mux-controller state described in ../mux/mux-controller.yaml
> > -
> > -Optional properties:
> > -- mux-locked: If present, explicitly allow unrelated I2C transactions on the
> > -  parent I2C adapter at these times:
> > -   + during setup of the multiplexer
> > -   + between setup of the multiplexer and the child bus I2C transaction
> > -   + between the child bus I2C transaction and releasing of the multiplexer
> > -   + during releasing of the multiplexer
> > -  However, I2C transactions to devices behind all I2C multiplexers connected
> > -  to the same parent adapter that this multiplexer is connected to are blocked
> > -  for the full duration of the complete multiplexed I2C transaction (i.e.
> > -  including the times covered by the above list).
> > -  If mux-locked is not present, the multiplexer is assumed to be parent-locked.
> > -  This means that no unrelated I2C transactions are allowed on the parent I2C
> > -  adapter for the complete multiplexed I2C transaction.
> > -  The properties of mux-locked and parent-locked multiplexers are discussed
> > -  in more detail in Documentation/i2c/i2c-topology.rst.
> > -
> > -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 set as the state in the
> > -mux controller.
> > -
> > -Example:
> > -     mux: mux-controller {
> > -             compatible = "gpio-mux";
> > -             #mux-control-cells = <0>;
> > -
> > -             mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>,
> > -                         <&pioA 1 GPIO_ACTIVE_HIGH>;
> > -     };
> > -
> > -     i2c-mux {
> > -             compatible = "i2c-mux";
> > -             mux-locked;
> > -             i2c-parent = <&i2c1>;
> > -
> > -             mux-controls = <&mux>;
> > -
> > -             #address-cells = <1>;
> > -             #size-cells = <0>;
> > -
> > -             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>;
> > -                             reset-active-low;
> > -                     };
> > -             };
> > -
> > -             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-gpmux.yaml b/Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.yaml
> > new file mode 100644
> > index 000000000000..3e6ea59aea68
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.yaml
> > @@ -0,0 +1,124 @@
> > +# SPDX-License-Identifier: GPL-2.0
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/i2c/i2c-mux-gpmux.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: General Purpose I2C Bus Mux
> > +
> > +maintainers:
> > +  - Peter Rosin <peda@axentia.se>
> > +
> > +description: |+
> > +  This binding describes an I2C bus multiplexer that uses a mux controller
> > +  from the mux subsystem to route the I2C signals.
> > +
> > +                                    .-----.  .-----.
> > +                                    | dev |  | dev |
> > +      .------------.                '-----'  '-----'
> > +      | SoC        |                   |        |
> > +      |            |          .--------+--------'
> > +      |   .------. |  .------+    child bus A, on MUX value set to 0
> > +      |   | I2C  |-|--| Mux  |
> > +      |   '------' |  '--+---+    child bus B, on MUX value set to 1
> > +      |   .------. |     |    '----------+--------+--------.
> > +      |   | MUX- | |     |               |        |        |
> > +      |   | Ctrl |-|-----+            .-----.  .-----.  .-----.
> > +      |   '------' |                  | dev |  | dev |  | dev |
> > +      '------------'                  '-----'  '-----'  '-----'
> > +
> > +
> > +
> > +allOf:
> > +  - $ref: /schemas/i2c/i2c-mux.yaml#
> > +
> > +properties:
> > +  compatible:
> > +    const: i2c-mux
> > +
> > +  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.
> > +
> > +  mux-controls:
> > +    maxItems: 1
> > +    description:
> > +      The mux-controller states are the I2C sub-bus numbers.
> > +
> > +  mux-locked:
> > +    type: boolean
> > +    description: |
> > +      Explicitly allow unrelated I2C transactions on the parent I2C adapter at
> > +      these times:
> > +       + during setup of the multiplexer
> > +       + between setup of the multiplexer and the child bus I2C transaction
> > +       + between the child bus I2C transaction and releasing of the multiplexer
> > +       + during releasing of the multiplexer
> > +
> > +      However, I2C transactions to devices behind all I2C multiplexers connected
> > +      to the same parent adapter that this multiplexer is connected to are blocked
> > +      for the full duration of the complete multiplexed I2C transaction (i.e.
> > +      including the times covered by the above list).
> > +      If mux-locked is not present, the multiplexer is assumed to be parent-locked.
> > +      This means that no unrelated I2C transactions are allowed on the parent I2C
> > +      adapter for the complete multiplexed I2C transaction.
> > +      The properties of mux-locked and parent-locked multiplexers are discussed
> > +      in more detail in Documentation/i2c/i2c-topology.rst.
> > +
> > +required:
> > +  - compatible
> > +  - i2c-parent
> > +  - mux-controls
> > +
> > +unevaluatedProperties: false
> > +
> > +examples:
> > +  - |
> > +    #include <dt-bindings/gpio/gpio.h>
> > +    mux: mux-controller {
> > +        compatible = "gpio-mux";
> > +        #mux-control-cells = <0>;
> > +
> > +        mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>,
> > +                    <&pioA 1 GPIO_ACTIVE_HIGH>;
> > +    };
> > +
> > +    i2c-mux {
> > +        compatible = "i2c-mux";
> > +        mux-locked;
> > +        i2c-parent = <&i2c1>;
> > +
> > +        mux-controls = <&mux>;
> > +
> > +        #address-cells = <1>;
> > +        #size-cells = <0>;
> > +
> > +        i2c@1 {
> > +            reg = <1>;
> > +            #address-cells = <1>;
> > +            #size-cells = <0>;
> > +
> > +            gpio@20 {
> > +                compatible = "nxp,pca9555";
> > +                gpio-controller;
> > +                #gpio-cells = <2>;
> > +                reg = <0x20>;
> > +            };
> > +        };
> > +
> > +        i2c@3 {
> > +            reg = <3>;
> > +            #address-cells = <1>;
> > +            #size-cells = <0>;
> > +
> > +            gpio@20 {
> > +                compatible = "nxp,pca9555";
> > +                gpio-controller;
> > +                #gpio-cells = <2>;
> > +                reg = <0x20>;
> > +            };
> > +        };
> > +    };
> > +...
> > diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-ltc4306.txt b/Documentation/devicetree/bindings/i2c/i2c-mux-ltc4306.txt
> > index 8b1e49cdce3f..29c4550c9782 100644
> > --- a/Documentation/devicetree/bindings/i2c/i2c-mux-ltc4306.txt
> > +++ b/Documentation/devicetree/bindings/i2c/i2c-mux-ltc4306.txt
> > @@ -8,8 +8,8 @@ Required Properties:
> >
> >    The following required properties are defined externally:
> >
> > -  - Standard I2C mux properties. See i2c-mux.txt in this directory.
> > -  - I2C child bus nodes. See i2c-mux.txt in this directory.
> > +  - Standard I2C mux properties. See i2c-mux.yaml in this directory.
> > +  - I2C child bus nodes. See i2c-mux.yaml in this directory.
> >
> >  Optional Properties:
> >
> > diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-pinctrl.txt b/Documentation/devicetree/bindings/i2c/i2c-mux-pinctrl.txt
> > index 33119a98e144..997a287ed3f6 100644
> > --- a/Documentation/devicetree/bindings/i2c/i2c-mux-pinctrl.txt
> > +++ b/Documentation/devicetree/bindings/i2c/i2c-mux-pinctrl.txt
> > @@ -28,9 +28,9 @@ 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.txt in this directory.
> > +* Standard I2C mux properties. See i2c-mux.yaml in this directory.
> >
> > -* I2C child bus nodes. See i2c-mux.txt 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
> > diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-reg.txt b/Documentation/devicetree/bindings/i2c/i2c-mux-reg.txt
> > index de00d7fc450b..b9d9755e4172 100644
> > --- a/Documentation/devicetree/bindings/i2c/i2c-mux-reg.txt
> > +++ b/Documentation/devicetree/bindings/i2c/i2c-mux-reg.txt
> > @@ -7,8 +7,8 @@ Required properties:
> >  - compatible: i2c-mux-reg
> >  - i2c-parent: The phandle of the I2C bus that this multiplexer's master-side
> >    port is connected to.
> > -* Standard I2C mux properties. See i2c-mux.txt in this directory.
> > -* I2C child bus nodes. See i2c-mux.txt in this directory.
> > +* Standard I2C mux properties. See i2c-mux.yaml in this directory.
> > +* I2C child bus nodes. See i2c-mux.yaml in this directory.
> >
> >  Optional properties:
> >  - reg: this pair of <offset size> specifies the register to control the mux.
> > diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux.txt b/Documentation/devicetree/bindings/i2c/i2c-mux.txt
> > deleted file mode 100644
> > index b38f58a1c878..000000000000
> > --- a/Documentation/devicetree/bindings/i2c/i2c-mux.txt
> > +++ /dev/null
> > @@ -1,73 +0,0 @@
> > -Common i2c bus multiplexer/switch properties.
> > -
> > -An i2c bus multiplexer/switch will have several child busses that are
> > -numbered uniquely in a device dependent manner.  The nodes for an i2c bus
> > -multiplexer/switch will have one child node for each child bus.
> > -
> > -Optional properties:
> > -- #address-cells = <1>;
> > -   This property is required if the i2c-mux child node does not exist.
> > -
> > -- #size-cells = <0>;
> > -   This property is required if the i2c-mux child node does not exist.
> > -
> > -- i2c-mux
> > -   For i2c multiplexers/switches that have child nodes that are a mixture
> > -   of both i2c child busses and other child nodes, the 'i2c-mux' subnode
> > -   can be used for populating the i2c child busses.  If an 'i2c-mux'
> > -   subnode is present, only subnodes of this will be considered as i2c
> > -   child busses.
> > -
> > -Required properties for the i2c-mux child node:
> > -- #address-cells = <1>;
> > -- #size-cells = <0>;
> > -
> > -Required properties for i2c child bus nodes:
> > -- #address-cells = <1>;
> > -- #size-cells = <0>;
> > -- reg : The sub-bus number.
> > -
> > -Optional properties for i2c child bus nodes:
> > -- Other properties specific to the multiplexer/switch hardware.
> > -- Child nodes conforming to i2c bus binding
> > -
> > -
> > -Example :
> > -
> > -     /*
> > -        An NXP pca9548 8 channel I2C multiplexer at address 0x70
> > -        with two NXP pca8574 GPIO expanders attached, one each to
> > -        ports 3 and 4.
> > -      */
> > -
> > -     mux@70 {
> > -             compatible = "nxp,pca9548";
> > -             reg = <0x70>;
> > -             #address-cells = <1>;
> > -             #size-cells = <0>;
> > -
> > -             i2c@3 {
> > -                     #address-cells = <1>;
> > -                     #size-cells = <0>;
> > -                     reg = <3>;
> > -
> > -                     gpio1: gpio@38 {
> > -                             compatible = "nxp,pca8574";
> > -                             reg = <0x38>;
> > -                             #gpio-cells = <2>;
> > -                             gpio-controller;
> > -                     };
> > -             };
> > -             i2c@4 {
> > -                     #address-cells = <1>;
> > -                     #size-cells = <0>;
> > -                     reg = <4>;
> > -
> > -                     gpio2: gpio@38 {
> > -                             compatible = "nxp,pca8574";
> > -                             reg = <0x38>;
> > -                             #gpio-cells = <2>;
> > -                             gpio-controller;
> > -                     };
> > -             };
> > -     };
> > diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux.yaml b/Documentation/devicetree/bindings/i2c/i2c-mux.yaml
> > new file mode 100644
> > index 000000000000..3aa4d84a6610
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/i2c/i2c-mux.yaml
> > @@ -0,0 +1,87 @@
> > +# SPDX-License-Identifier: GPL-2.0
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/i2c/i2c-mux.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Common i2c bus multiplexer/switch properties.
> > +
> > +maintainers:
> > +  - Peter Rosin <peda@axentia.se>
> > +
> > +description: |+
> > +  An i2c bus multiplexer/switch will have several child busses that are numbered
> > +  uniquely in a device dependent manner.  The nodes for an i2c bus
> > +  multiplexer/switch will have one child node for each child bus.
> > +
> > +  For i2c multiplexers/switches that have child nodes that are a mixture of both
> > +  i2c child busses and other child nodes, the 'i2c-mux' subnode can be used for
> > +  populating the i2c child busses.  If an 'i2c-mux' subnode is present, only
> > +  subnodes of this will be considered as i2c child busses.
>
> As I understand this, it means that child nodes corresponding to child
> buses can be either direct children of the I2C mux node, or grouped in a
> i2c-mux node (the same way we optionally group the 'port' nodes in a
> 'ports' node). This doesn't seem to be supported by the bindings below.

I take this as like any MFD. If i2c mux is one of the functions, we'll
have a child node for it. In that case, that device's binding will
define the 'i2c-mux' node and then reference this schema. The fact
that this mentions other nodes being I2C devices is not important and
a somewhat confusing detail. I considered just removing as I don't
think the paragraph is all that useful, but I try not to delete too
much from existing bindings.

Rob

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 1/6] dt-bindings: mfd: ti,j721e-system-controller: Fix mux node errors
  2021-05-18 23:28 ` [PATCH 1/6] dt-bindings: mfd: ti,j721e-system-controller: Fix mux node errors Rob Herring
@ 2021-05-19 15:00   ` Lee Jones
  2021-05-20 14:41   ` Kishon Vijay Abraham I
  1 sibling, 0 replies; 20+ messages in thread
From: Lee Jones @ 2021-05-19 15:00 UTC (permalink / raw)
  To: Rob Herring
  Cc: devicetree, Peter Rosin, Wolfram Sang, linux-kernel,
	Alexandre Belloni, Jacopo Mondi, Kieran Bingham,
	Kishon Vijay Abraham I, Laurent Pinchart, Niklas Söderlund,
	Roger Quadros, Jonathan Cameron

On Tue, 18 May 2021, Rob Herring wrote:

> The ti,j721e-system-controller binding does not follow the standard mux
> controller node name 'mux-controller' and the example is incomplete. Fix
> these to avoid schema errors before the mux controller binding is
> converted to schema.
> 
> Cc: Lee Jones <lee.jones@linaro.org>
> Cc: Kishon Vijay Abraham I <kishon@ti.com>
> Cc: Roger Quadros <rogerq@ti.com>

Would one of the original authors be kind enough to review please?

> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  .../mfd/ti,j721e-system-controller.yaml       | 19 +++++++++++++------
>  1 file changed, 13 insertions(+), 6 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/mfd/ti,j721e-system-controller.yaml b/Documentation/devicetree/bindings/mfd/ti,j721e-system-controller.yaml
> index 19fcf59fd2fe..272832e9f8f2 100644
> --- a/Documentation/devicetree/bindings/mfd/ti,j721e-system-controller.yaml
> +++ b/Documentation/devicetree/bindings/mfd/ti,j721e-system-controller.yaml
> @@ -43,12 +43,10 @@ properties:
>  
>  patternProperties:
>    # Optional children
> -  "^serdes-ln-ctrl@[0-9a-f]+$":
> +  "^mux-controller@[0-9a-f]+$":
>      type: object
> -    description: |
> -      This is the SERDES lane control mux. It should follow the bindings
> -      specified in
> -      Documentation/devicetree/bindings/mux/reg-mux.txt
> +    description:
> +      This is the SERDES lane control mux.
>  
>  required:
>    - compatible
> @@ -68,9 +66,18 @@ examples:
>          #size-cells = <1>;
>          ranges;
>  
> -        serdes_ln_ctrl: serdes-ln-ctrl@4080 {
> +        serdes_ln_ctrl: mux-controller@4080 {
>              compatible = "mmio-mux";
>              reg = <0x00004080 0x50>;
> +
> +            #mux-control-cells = <1>;
> +            mux-reg-masks =
> +                <0x4080 0x3>, <0x4084 0x3>, /* SERDES0 lane0/1 select */
> +                <0x4090 0x3>, <0x4094 0x3>, /* SERDES1 lane0/1 select */
> +                <0x40a0 0x3>, <0x40a4 0x3>, /* SERDES2 lane0/1 select */
> +                <0x40b0 0x3>, <0x40b4 0x3>, /* SERDES3 lane0/1 select */
> +                <0x40c0 0x3>, <0x40c4 0x3>, <0x40c8 0x3>, <0x40cc 0x3>;
> +                /* SERDES4 lane0/1/2/3 select */
>          };
>      };
>  ...

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 1/6] dt-bindings: mfd: ti,j721e-system-controller: Fix mux node errors
  2021-05-18 23:28 ` [PATCH 1/6] dt-bindings: mfd: ti,j721e-system-controller: Fix mux node errors Rob Herring
  2021-05-19 15:00   ` Lee Jones
@ 2021-05-20 14:41   ` Kishon Vijay Abraham I
  2021-05-20 15:19     ` Rob Herring
  1 sibling, 1 reply; 20+ messages in thread
From: Kishon Vijay Abraham I @ 2021-05-20 14:41 UTC (permalink / raw)
  To: Rob Herring, devicetree, Peter Rosin, Wolfram Sang
  Cc: linux-kernel, Alexandre Belloni, Jacopo Mondi, Kieran Bingham,
	Laurent Pinchart, Lee Jones, Niklas Söderlund,
	Jonathan Cameron

Hi Rob,

On 19/05/21 4:58 am, Rob Herring wrote:
> The ti,j721e-system-controller binding does not follow the standard mux
> controller node name 'mux-controller' and the example is incomplete. Fix
> these to avoid schema errors before the mux controller binding is
> converted to schema.
> 
> Cc: Lee Jones <lee.jones@linaro.org>
> Cc: Kishon Vijay Abraham I <kishon@ti.com>
> Cc: Roger Quadros <rogerq@ti.com>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  .../mfd/ti,j721e-system-controller.yaml       | 19 +++++++++++++------
>  1 file changed, 13 insertions(+), 6 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/mfd/ti,j721e-system-controller.yaml b/Documentation/devicetree/bindings/mfd/ti,j721e-system-controller.yaml
> index 19fcf59fd2fe..272832e9f8f2 100644
> --- a/Documentation/devicetree/bindings/mfd/ti,j721e-system-controller.yaml
> +++ b/Documentation/devicetree/bindings/mfd/ti,j721e-system-controller.yaml
> @@ -43,12 +43,10 @@ properties:
>  
>  patternProperties:
>    # Optional children
> -  "^serdes-ln-ctrl@[0-9a-f]+$":
> +  "^mux-controller@[0-9a-f]+$":
>      type: object
> -    description: |
> -      This is the SERDES lane control mux. It should follow the bindings
> -      specified in
> -      Documentation/devicetree/bindings/mux/reg-mux.txt
> +    description:
> +      This is the SERDES lane control mux.
>  
>  required:
>    - compatible
> @@ -68,9 +66,18 @@ examples:
>          #size-cells = <1>;
>          ranges;
>  
> -        serdes_ln_ctrl: serdes-ln-ctrl@4080 {
> +        serdes_ln_ctrl: mux-controller@4080 {
>              compatible = "mmio-mux";
>              reg = <0x00004080 0x50>;

"mmio-mux" compatible doesn't define using "reg" property. But a system
can have multiple mux-controllers which would require us to use
mux-controller@0, mux-controller@1,..

And IIRC if we have "@", 'reg' will be a required required property.
Would it be an issue here?

Thanks
Kishon

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 1/6] dt-bindings: mfd: ti,j721e-system-controller: Fix mux node errors
  2021-05-20 14:41   ` Kishon Vijay Abraham I
@ 2021-05-20 15:19     ` Rob Herring
  0 siblings, 0 replies; 20+ messages in thread
From: Rob Herring @ 2021-05-20 15:19 UTC (permalink / raw)
  To: Kishon Vijay Abraham I
  Cc: devicetree, Peter Rosin, Wolfram Sang, linux-kernel,
	Alexandre Belloni, Jacopo Mondi, Kieran Bingham,
	Laurent Pinchart, Lee Jones, Niklas Söderlund,
	Jonathan Cameron

On Thu, May 20, 2021 at 9:42 AM Kishon Vijay Abraham I <kishon@ti.com> wrote:
>
> Hi Rob,
>
> On 19/05/21 4:58 am, Rob Herring wrote:
> > The ti,j721e-system-controller binding does not follow the standard mux
> > controller node name 'mux-controller' and the example is incomplete. Fix
> > these to avoid schema errors before the mux controller binding is
> > converted to schema.
> >
> > Cc: Lee Jones <lee.jones@linaro.org>
> > Cc: Kishon Vijay Abraham I <kishon@ti.com>
> > Cc: Roger Quadros <rogerq@ti.com>
> > Signed-off-by: Rob Herring <robh@kernel.org>
> > ---
> >  .../mfd/ti,j721e-system-controller.yaml       | 19 +++++++++++++------
> >  1 file changed, 13 insertions(+), 6 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/mfd/ti,j721e-system-controller.yaml b/Documentation/devicetree/bindings/mfd/ti,j721e-system-controller.yaml
> > index 19fcf59fd2fe..272832e9f8f2 100644
> > --- a/Documentation/devicetree/bindings/mfd/ti,j721e-system-controller.yaml
> > +++ b/Documentation/devicetree/bindings/mfd/ti,j721e-system-controller.yaml
> > @@ -43,12 +43,10 @@ properties:
> >
> >  patternProperties:
> >    # Optional children
> > -  "^serdes-ln-ctrl@[0-9a-f]+$":
> > +  "^mux-controller@[0-9a-f]+$":
> >      type: object
> > -    description: |
> > -      This is the SERDES lane control mux. It should follow the bindings
> > -      specified in
> > -      Documentation/devicetree/bindings/mux/reg-mux.txt
> > +    description:
> > +      This is the SERDES lane control mux.
> >
> >  required:
> >    - compatible
> > @@ -68,9 +66,18 @@ examples:
> >          #size-cells = <1>;
> >          ranges;
> >
> > -        serdes_ln_ctrl: serdes-ln-ctrl@4080 {
> > +        serdes_ln_ctrl: mux-controller@4080 {
> >              compatible = "mmio-mux";
> >              reg = <0x00004080 0x50>;
>
> "mmio-mux" compatible doesn't define using "reg" property. But a system
> can have multiple mux-controllers which would require us to use
> mux-controller@0, mux-controller@1,..

It does now in patch 3 as part of the schema conversion. It's optional
as getting folks to use 'reg' for syscon child nodes is an uphill
battle.

Rob
>
> And IIRC if we have "@", 'reg' will be a required required property.
> Would it be an issue here?
>
> Thanks
> Kishon

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 3/6] dt-bindings: mux: Convert mux controller bindings to schema
  2021-05-18 23:28 ` [PATCH 3/6] dt-bindings: mux: Convert mux controller bindings to schema Rob Herring
@ 2021-05-22 10:41   ` Jonathan Cameron
  0 siblings, 0 replies; 20+ messages in thread
From: Jonathan Cameron @ 2021-05-22 10:41 UTC (permalink / raw)
  To: Rob Herring
  Cc: devicetree, Peter Rosin, Wolfram Sang, linux-kernel,
	Alexandre Belloni, Jacopo Mondi, Kieran Bingham,
	Kishon Vijay Abraham I, Laurent Pinchart, Lee Jones,
	Niklas Söderlund, Roger Quadros

On Tue, 18 May 2021 18:28:55 -0500
Rob Herring <robh@kernel.org> wrote:

> Convert the mux controller bindings to DT schema.
> 
> Cc: Peter Rosin <peda@axentia.se>
> Signed-off-by: Rob Herring <robh@kernel.org>
One trivial inline, but otherwise this looks pretty good to me.
Given I'll send out a yaml conversion of the IIO file in a few mins
anyway, perhaps better for it to get cleaned up during that.

I did wonder if carrying examples in both the top level 
mux-controller binding and the various controller bindings
was worth while duplication, but it doesn't do much harm.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> ---
>  .../devicetree/bindings/i2c/i2c-mux-gpmux.txt |   2 +-
>  .../bindings/i2c/i2c-mux-pca954x.txt          |   2 +-
>  .../iio/multiplexer/io-channel-mux.txt        |   2 +-
>  .../devicetree/bindings/mtd/ti,am654-hbmc.txt |   2 +-
>  .../devicetree/bindings/mux/adi,adg792a.txt   |   2 +-
>  .../devicetree/bindings/mux/adi,adgs1408.txt  |   2 +-
>  .../devicetree/bindings/mux/gpio-mux.txt      |  69 -------
>  .../devicetree/bindings/mux/gpio-mux.yaml     |  92 +++++++++
>  .../devicetree/bindings/mux/mux-consumer.yaml |  46 +++++
>  .../bindings/mux/mux-controller.txt           | 157 ---------------
>  .../bindings/mux/mux-controller.yaml          | 182 ++++++++++++++++++
>  .../devicetree/bindings/mux/reg-mux.txt       | 129 -------------
>  .../devicetree/bindings/mux/reg-mux.yaml      | 143 ++++++++++++++
>  .../bindings/net/mdio-mux-multiplexer.txt     |   2 +-
>  14 files changed, 470 insertions(+), 362 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/mux/gpio-mux.txt
>  create mode 100644 Documentation/devicetree/bindings/mux/gpio-mux.yaml
>  create mode 100644 Documentation/devicetree/bindings/mux/mux-consumer.yaml
>  delete mode 100644 Documentation/devicetree/bindings/mux/mux-controller.txt
>  create mode 100644 Documentation/devicetree/bindings/mux/mux-controller.yaml
>  delete mode 100644 Documentation/devicetree/bindings/mux/reg-mux.txt
>  create mode 100644 Documentation/devicetree/bindings/mux/reg-mux.yaml
> 
> diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.txt b/Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.txt
> index 8b444b94e92f..057083a8ba17 100644
> --- a/Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.txt
> +++ b/Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.txt
> @@ -25,7 +25,7 @@ Required properties:
>    mux.
>  * Standard I2C mux properties. See i2c-mux.txt in this directory.
>  * I2C child bus nodes. See i2c-mux.txt in this directory. The sub-bus number
> -  is also the mux-controller state described in ../mux/mux-controller.txt
> +  is also the mux-controller state described in ../mux/mux-controller.yaml
>  
>  Optional properties:
>  - mux-locked: If present, explicitly allow unrelated I2C transactions on the
> diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.txt b/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.txt
> index 7abda506b828..9f3f3eb67e87 100644
> --- a/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.txt
> +++ b/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.txt
> @@ -26,7 +26,7 @@ Optional Properties:
>  
>    - reset-gpios: Reference to the GPIO connected to the reset input.
>    - idle-state: if present, overrides i2c-mux-idle-disconnect,
> -    Please refer to Documentation/devicetree/bindings/mux/mux-controller.txt
> +    Please refer to Documentation/devicetree/bindings/mux/mux-controller.yaml
>    - i2c-mux-idle-disconnect: Boolean; if defined, forces mux to disconnect all
>      children in idle state. This is necessary for example, if there are several
>      multiplexers on the bus and the devices behind them use same I2C addresses.
> diff --git a/Documentation/devicetree/bindings/iio/multiplexer/io-channel-mux.txt b/Documentation/devicetree/bindings/iio/multiplexer/io-channel-mux.txt
> index 89647d714387..d2b3105dba67 100644
> --- a/Documentation/devicetree/bindings/iio/multiplexer/io-channel-mux.txt
> +++ b/Documentation/devicetree/bindings/iio/multiplexer/io-channel-mux.txt
> @@ -17,7 +17,7 @@ For each non-empty string in the channels property, an io-channel will
>  be created. The number of this io-channel is the same as the index into
>  the list of strings in the channels property, and also matches the mux
>  controller state. The mux controller state is described in
> -../mux/mux-controller.txt
> +../mux/mux-controller.yaml

Cross reference is wrong in original I think.
Should be
../../mux/mux-controller.yaml

I'll send out conversion of this file in a few mins though so can tidy this up
in that.  I'll change it to a full reference anyway to make this more
future proof.

>  
>  Example:
>  	mux: mux-controller {
> diff --git a/Documentation/devicetree/bindings/mtd/ti,am654-hbmc.txt b/Documentation/devicetree/bindings/mtd/ti,am654-hbmc.txt
> index faa81c2e5da6..ccfd37b8a0ad 100644
> --- a/Documentation/devicetree/bindings/mtd/ti,am654-hbmc.txt
> +++ b/Documentation/devicetree/bindings/mtd/ti,am654-hbmc.txt
> @@ -13,7 +13,7 @@ Optional properties:
>  - mux-controls : phandle to the multiplexer that controls selection of
>  		 HBMC vs OSPI inside Flash SubSystem (FSS). Default is OSPI,
>  		 if property is absent.
> -		 See Documentation/devicetree/bindings/mux/reg-mux.txt
> +		 See Documentation/devicetree/bindings/mux/reg-mux.yaml
>  		 for mmio-mux binding details
>  
>  Example:
> diff --git a/Documentation/devicetree/bindings/mux/adi,adg792a.txt b/Documentation/devicetree/bindings/mux/adi,adg792a.txt
> index 96b787a69f50..b0e5bf6903d8 100644
> --- a/Documentation/devicetree/bindings/mux/adi,adg792a.txt
> +++ b/Documentation/devicetree/bindings/mux/adi,adg792a.txt
> @@ -5,7 +5,7 @@ Required properties:
>  - #mux-control-cells : <0> if parallel (the three muxes are bound together
>    with a single mux controller controlling all three muxes), or <1> if
>    not (one mux controller for each mux).
> -* Standard mux-controller bindings as described in mux-controller.txt
> +* Standard mux-controller bindings as described in mux-controller.yaml
>  
>  Optional properties for ADG792G:
>  - gpio-controller : if present, #gpio-cells below is required.
> diff --git a/Documentation/devicetree/bindings/mux/adi,adgs1408.txt b/Documentation/devicetree/bindings/mux/adi,adgs1408.txt
> index be6947f4d86b..453a38961c13 100644
> --- a/Documentation/devicetree/bindings/mux/adi,adgs1408.txt
> +++ b/Documentation/devicetree/bindings/mux/adi,adgs1408.txt
> @@ -4,7 +4,7 @@ Required properties:
>  - compatible : Should be one of
>  	* "adi,adgs1408"
>  	* "adi,adgs1409"
> -* Standard mux-controller bindings as described in mux-controller.txt
> +* Standard mux-controller bindings as described in mux-controller.yaml
>  
>  Optional properties for ADGS1408/1409:
>  - gpio-controller : if present, #gpio-cells is required.
> diff --git a/Documentation/devicetree/bindings/mux/gpio-mux.txt b/Documentation/devicetree/bindings/mux/gpio-mux.txt
> deleted file mode 100644
> index b8f746344d80..000000000000
> --- a/Documentation/devicetree/bindings/mux/gpio-mux.txt
> +++ /dev/null
> @@ -1,69 +0,0 @@
> -GPIO-based multiplexer controller bindings
> -
> -Define what GPIO pins are used to control a multiplexer. Or several
> -multiplexers, if the same pins control more than one multiplexer.
> -
> -Required properties:
> -- compatible : "gpio-mux"
> -- mux-gpios : list of gpios used to control the multiplexer, least
> -	      significant bit first.
> -- #mux-control-cells : <0>
> -* Standard mux-controller bindings as decribed in mux-controller.txt
> -
> -Optional properties:
> -- idle-state : if present, the state the mux will have when idle. The
> -	       special state MUX_IDLE_AS_IS is the default.
> -
> -The multiplexer state is defined as the number represented by the
> -multiplexer GPIO pins, where the first pin is the least significant
> -bit. An active pin is a binary 1, an inactive pin is a binary 0.
> -
> -Example:
> -
> -	mux: mux-controller {
> -		compatible = "gpio-mux";
> -		#mux-control-cells = <0>;
> -
> -		mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>,
> -			    <&pioA 1 GPIO_ACTIVE_HIGH>;
> -	};
> -
> -	adc-mux {
> -		compatible = "io-channel-mux";
> -		io-channels = <&adc 0>;
> -		io-channel-names = "parent";
> -
> -		mux-controls = <&mux>;
> -
> -		channels = "sync-1", "in", "out", "sync-2";
> -	};
> -
> -	i2c-mux {
> -		compatible = "i2c-mux";
> -		i2c-parent = <&i2c1>;
> -
> -		mux-controls = <&mux>;
> -
> -		#address-cells = <1>;
> -		#size-cells = <0>;
> -
> -		i2c@0 {
> -			reg = <0>;
> -			#address-cells = <1>;
> -			#size-cells = <0>;
> -
> -			ssd1307: oled@3c {
> -				/* ... */
> -			};
> -		};
> -
> -		i2c@3 {
> -			reg = <3>;
> -			#address-cells = <1>;
> -			#size-cells = <0>;
> -
> -			pca9555: pca9555@20 {
> -				/* ... */
> -			};
> -		};
> -	};
> diff --git a/Documentation/devicetree/bindings/mux/gpio-mux.yaml b/Documentation/devicetree/bindings/mux/gpio-mux.yaml
> new file mode 100644
> index 000000000000..0a7c8d64981a
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mux/gpio-mux.yaml
> @@ -0,0 +1,92 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/mux/gpio-mux.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: GPIO-based multiplexer controller bindings
> +
> +maintainers:
> +  - Peter Rosin <peda@axentia.se>
> +
> +description: |+
> +  Define what GPIO pins are used to control a multiplexer. Or several
> +  multiplexers, if the same pins control more than one multiplexer.
> +
> +  The multiplexer state is defined as the number represented by the
> +  multiplexer GPIO pins, where the first pin is the least significant
> +  bit. An active pin is a binary 1, an inactive pin is a binary 0.
> +
> +properties:
> +  compatible:
> +    const: gpio-mux
> +
> +  mux-gpios:
> +    description:
> +      List of gpios used to control the multiplexer, least significant bit first.
> +
> +  '#mux-control-cells':
> +    const: 0
> +
> +  idle-state:
> +    default: -1
> +
> +required:
> +  - compatible
> +  - mux-gpios
> +  - "#mux-control-cells"
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/gpio/gpio.h>
> +
> +    mux: mux-controller {
> +        compatible = "gpio-mux";
> +        #mux-control-cells = <0>;
> +
> +        mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>,
> +              <&pioA 1 GPIO_ACTIVE_HIGH>;
> +    };
> +
> +    adc-mux {
> +        compatible = "io-channel-mux";
> +        io-channels = <&adc 0>;
> +        io-channel-names = "parent";
> +
> +        mux-controls = <&mux>;
> +
> +        channels = "sync-1", "in", "out", "sync-2";
> +    };
> +
> +    i2c-mux {
> +        compatible = "i2c-mux";
> +        i2c-parent = <&i2c1>;
> +
> +        mux-controls = <&mux>;
> +
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        i2c@0 {
> +            reg = <0>;
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +
> +            ssd1307: oled@3c {
> +                reg = <0x3c>;
> +            };
> +        };
> +
> +        i2c@3 {
> +            reg = <3>;
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +
> +            pca9555: pca9555@20 {
> +                reg = <0x20>;
> +            };
> +        };
> +    };
> +...
> diff --git a/Documentation/devicetree/bindings/mux/mux-consumer.yaml b/Documentation/devicetree/bindings/mux/mux-consumer.yaml
> new file mode 100644
> index 000000000000..7af93298ab5c
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mux/mux-consumer.yaml
> @@ -0,0 +1,46 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/mux/mux-consumer.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Common multiplexer controller consumer bindings
> +
> +maintainers:
> +  - Peter Rosin <peda@axentia.se>
> +
> +description: |
> +  Mux controller consumers should specify a list of mux controllers that they
> +  want to use with a property containing a 'mux-ctrl-list':
> +
> +    mux-ctrl-list ::= <single-mux-ctrl> [mux-ctrl-list]
> +    single-mux-ctrl ::= <mux-ctrl-phandle> [mux-ctrl-specifier]
> +    mux-ctrl-phandle : phandle to mux controller node
> +    mux-ctrl-specifier : array of #mux-control-cells specifying the
> +                         given mux controller (controller specific)
> +
> +  Mux controller properties should be named "mux-controls". The exact meaning of
> +  each mux controller property must be documented in the device tree binding for
> +  each consumer. An optional property "mux-control-names" may contain a list of
> +  strings to label each of the mux controllers listed in the "mux-controls"
> +  property.
> +
> +  mux-ctrl-specifier typically encodes the chip-relative mux controller number.
> +  If the mux controller chip only provides a single mux controller, the
> +  mux-ctrl-specifier can typically be left out.
> +
> +select: true
> +
> +properties:
> +  mux-controls:
> +    $ref: /schemas/types.yaml#/definitions/phandle-array
> +
> +  mux-control-names:
> +    description:
> +      Devices that use more than a single mux controller can use the
> +      "mux-control-names" property to map the name of the requested mux
> +      controller to an index into the list given by the "mux-controls" property.
> +
> +additionalProperties: true
> +
> +...
> diff --git a/Documentation/devicetree/bindings/mux/mux-controller.txt b/Documentation/devicetree/bindings/mux/mux-controller.txt
> deleted file mode 100644
> index 4f47e4bd2fa0..000000000000
> --- a/Documentation/devicetree/bindings/mux/mux-controller.txt
> +++ /dev/null
> @@ -1,157 +0,0 @@
> -Common multiplexer controller bindings
> -======================================
> -
> -A multiplexer (or mux) controller will have one, or several, consumer devices
> -that uses the mux controller. Thus, a mux controller can possibly control
> -several parallel multiplexers. Presumably there will be at least one
> -multiplexer needed by each consumer, but a single mux controller can of course
> -control several multiplexers for a single consumer.
> -
> -A mux controller provides a number of states to its consumers, and the state
> -space is a simple zero-based enumeration. I.e. 0-1 for a 2-way multiplexer,
> -0-7 for an 8-way multiplexer, etc.
> -
> -
> -Consumers
> ----------
> -
> -Mux controller consumers should specify a list of mux controllers that they
> -want to use with a property containing a 'mux-ctrl-list':
> -
> -	mux-ctrl-list ::= <single-mux-ctrl> [mux-ctrl-list]
> -	single-mux-ctrl ::= <mux-ctrl-phandle> [mux-ctrl-specifier]
> -	mux-ctrl-phandle : phandle to mux controller node
> -	mux-ctrl-specifier : array of #mux-control-cells specifying the
> -			     given mux controller (controller specific)
> -
> -Mux controller properties should be named "mux-controls". The exact meaning of
> -each mux controller property must be documented in the device tree binding for
> -each consumer. An optional property "mux-control-names" may contain a list of
> -strings to label each of the mux controllers listed in the "mux-controls"
> -property.
> -
> -Drivers for devices that use more than a single mux controller can use the
> -"mux-control-names" property to map the name of the requested mux controller
> -to an index into the list given by the "mux-controls" property.
> -
> -mux-ctrl-specifier typically encodes the chip-relative mux controller number.
> -If the mux controller chip only provides a single mux controller, the
> -mux-ctrl-specifier can typically be left out.
> -
> -Example:
> -
> -	/* One consumer of a 2-way mux controller (one GPIO-line) */
> -	mux: mux-controller {
> -		compatible = "gpio-mux";
> -		#mux-control-cells = <0>;
> -
> -		mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>;
> -	};
> -
> -	adc-mux {
> -		compatible = "io-channel-mux";
> -		io-channels = <&adc 0>;
> -		io-channel-names = "parent";
> -
> -		mux-controls = <&mux>;
> -		mux-control-names = "adc";
> -
> -		channels = "sync", "in";
> -	};
> -
> -Note that in the example above, specifying the "mux-control-names" is redundant
> -because there is only one mux controller in the list. However, if the driver
> -for the consumer node in fact asks for a named mux controller, that name is of
> -course still required.
> -
> -	/*
> -	 * Two consumers (one for an ADC line and one for an i2c bus) of
> -	 * parallel 4-way multiplexers controlled by the same two GPIO-lines.
> -	 */
> -	mux: mux-controller {
> -		compatible = "gpio-mux";
> -		#mux-control-cells = <0>;
> -
> -		mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>,
> -			    <&pioA 1 GPIO_ACTIVE_HIGH>;
> -	};
> -
> -	adc-mux {
> -		compatible = "io-channel-mux";
> -		io-channels = <&adc 0>;
> -		io-channel-names = "parent";
> -
> -		mux-controls = <&mux>;
> -
> -		channels = "sync-1", "in", "out", "sync-2";
> -	};
> -
> -	i2c-mux {
> -		compatible = "i2c-mux";
> -		i2c-parent = <&i2c1>;
> -
> -		mux-controls = <&mux>;
> -
> -		#address-cells = <1>;
> -		#size-cells = <0>;
> -
> -		i2c@0 {
> -			reg = <0>;
> -			#address-cells = <1>;
> -			#size-cells = <0>;
> -
> -			ssd1307: oled@3c {
> -				/* ... */
> -			};
> -		};
> -
> -		i2c@3 {
> -			reg = <3>;
> -			#address-cells = <1>;
> -			#size-cells = <0>;
> -
> -			pca9555: pca9555@20 {
> -				/* ... */
> -			};
> -		};
> -	};
> -
> -
> -Mux controller nodes
> ---------------------
> -
> -Mux controller nodes must specify the number of cells used for the
> -specifier using the '#mux-control-cells' property.
> -
> -Optionally, mux controller nodes can also specify the state the mux should
> -have when it is idle. The idle-state property is used for this. If the
> -idle-state is not present, the mux controller is typically left as is when
> -it is idle. For multiplexer chips that expose several mux controllers, the
> -idle-state property is an array with one idle state for each mux controller.
> -
> -The special value (-1) may be used to indicate that the mux should be left
> -as is when it is idle. This is the default, but can still be useful for
> -mux controller chips with more than one mux controller, particularly when
> -there is a need to "step past" a mux controller and set some other idle
> -state for a mux controller with a higher index.
> -
> -Some mux controllers have the ability to disconnect the input/output of the
> -multiplexer. Using this disconnected high-impedance state as the idle state
> -is indicated with idle state (-2).
> -
> -These constants are available in
> -
> -      #include <dt-bindings/mux/mux.h>
> -
> -as MUX_IDLE_AS_IS (-1) and MUX_IDLE_DISCONNECT (-2).
> -
> -An example mux controller node look like this (the adg972a chip is a triple
> -4-way multiplexer):
> -
> -	mux: mux-controller@50 {
> -		compatible = "adi,adg792a";
> -		reg = <0x50>;
> -		#mux-control-cells = <1>;
> -
> -		idle-state = <MUX_IDLE_DISCONNECT MUX_IDLE_AS_IS 2>;
> -	};
> diff --git a/Documentation/devicetree/bindings/mux/mux-controller.yaml b/Documentation/devicetree/bindings/mux/mux-controller.yaml
> new file mode 100644
> index 000000000000..736a84c3b6a5
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mux/mux-controller.yaml
> @@ -0,0 +1,182 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/mux/mux-controller.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Common multiplexer controller provider bindings
> +
> +maintainers:
> +  - Peter Rosin <peda@axentia.se>
> +
> +description: |
> +  A multiplexer (or mux) controller will have one, or several, consumer devices
> +  that uses the mux controller. Thus, a mux controller can possibly control
> +  several parallel multiplexers. Presumably there will be at least one
> +  multiplexer needed by each consumer, but a single mux controller can of course
> +  control several multiplexers for a single consumer.
> +
> +  A mux controller provides a number of states to its consumers, and the state
> +  space is a simple zero-based enumeration. I.e. 0-1 for a 2-way multiplexer,
> +  0-7 for an 8-way multiplexer, etc.
> +
> +
> +  Mux controller nodes
> +  --------------------
> +
> +  Mux controller nodes must specify the number of cells used for the
> +  specifier using the '#mux-control-cells' property.
> +
> +  Optionally, mux controller nodes can also specify the state the mux should
> +  have when it is idle. The idle-state property is used for this. If the
> +  idle-state is not present, the mux controller is typically left as is when
> +  it is idle. For multiplexer chips that expose several mux controllers, the
> +  idle-state property is an array with one idle state for each mux controller.
> +
> +  The special value (-1) may be used to indicate that the mux should be left
> +  as is when it is idle. This is the default, but can still be useful for
> +  mux controller chips with more than one mux controller, particularly when
> +  there is a need to "step past" a mux controller and set some other idle
> +  state for a mux controller with a higher index.
> +
> +  Some mux controllers have the ability to disconnect the input/output of the
> +  multiplexer. Using this disconnected high-impedance state as the idle state
> +  is indicated with idle state (-2).
> +
> +  These constants are available in
> +
> +        #include <dt-bindings/mux/mux.h>
> +
> +  as MUX_IDLE_AS_IS (-1) and MUX_IDLE_DISCONNECT (-2).
> +
> +  An example mux controller node look like this (the adg972a chip is a triple
> +  4-way multiplexer):
> +
> +    mux: mux-controller@50 {
> +      compatible = "adi,adg792a";
> +      reg = <0x50>;
> +      #mux-control-cells = <1>;
> +
> +      idle-state = <MUX_IDLE_DISCONNECT MUX_IDLE_AS_IS 2>;
> +    };
> +
> +select:
> +  anyOf:
> +    - properties:
> +        $nodename:
> +          pattern: '^mux-controller'
> +    - required:
> +        - '#mux-control-cells'
> +
> +properties:
> +  $nodename:
> +    pattern: '^mux-controller(@.*|-[0-9a-f]+)?$'
> +
> +  '#mux-control-cells':
> +    enum: [ 0, 1 ]
> +
> +  idle-state:
> +    $ref: /schemas/types.yaml#/definitions/int32
> +    minimum: -2
> +
> +  idle-states:
> +    description: |
> +      Mux controller nodes can specify the state the mux should have when it is
> +      idle. If the idle-state is not present, the mux controller is typically
> +      left as is when it is idle. For multiplexer chips that expose several mux
> +      controllers, the idle-state property is an array with one idle state for
> +      each mux controller.
> +
> +      The special value (-1) may be used to indicate that the mux should be left
> +      as is when it is idle. This is the default, but can still be useful for
> +      mux controller chips with more than one mux controller, particularly when
> +      there is a need to "step past" a mux controller and set some other idle
> +      state for a mux controller with a higher index.
> +
> +      Some mux controllers have the ability to disconnect the input/output of the
> +      multiplexer. Using this disconnected high-impedance state as the idle state
> +      is indicated with idle state (-2).
> +    $ref: /schemas/types.yaml#/definitions/int32-array
> +    items:
> +      minimum: -2
> +
> +additionalProperties: true
> +
> +examples:
> +  - |
> +    #include <dt-bindings/gpio/gpio.h>
> +
> +    /* One consumer of a 2-way mux controller (one GPIO-line) */
> +    mux: mux-controller {
> +        compatible = "gpio-mux";
> +        #mux-control-cells = <0>;
> +
> +        mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>;
> +    };
> +
> +    adc-mux {
> +        compatible = "io-channel-mux";
> +        io-channels = <&adc 0>;
> +        io-channel-names = "parent";
> +
> +        mux-controls = <&mux>;
> +        mux-control-names = "adc";
> +
> +        channels = "sync", "in";
> +    };
> +
> +  - |
> +    #include <dt-bindings/gpio/gpio.h>
> +
> +    /*
> +     * Two consumers (one for an ADC line and one for an i2c bus) of
> +     * parallel 4-way multiplexers controlled by the same two GPIO-lines.
> +     */
> +    mux2: mux-controller {
> +        compatible = "gpio-mux";
> +        #mux-control-cells = <0>;
> +
> +        mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>,
> +              <&pioA 1 GPIO_ACTIVE_HIGH>;
> +    };
> +
> +    adc-mux {
> +        compatible = "io-channel-mux";
> +        io-channels = <&adc 0>;
> +        io-channel-names = "parent";
> +
> +        mux-controls = <&mux2>;
> +
> +        channels = "sync-1", "in", "out", "sync-2";
> +    };
> +
> +    i2c-mux {
> +        compatible = "i2c-mux";
> +        i2c-parent = <&i2c1>;
> +
> +        mux-controls = <&mux2>;
> +
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        i2c@0 {
> +            reg = <0>;
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +
> +            ssd1307: oled@3c {
> +                reg = <0x3c>;
> +            };
> +        };
> +
> +        i2c@3 {
> +            reg = <3>;
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +
> +            pca9555: pca9555@20 {
> +                reg = <0x20>;
> +            };
> +        };
> +    };
> +...
> diff --git a/Documentation/devicetree/bindings/mux/reg-mux.txt b/Documentation/devicetree/bindings/mux/reg-mux.txt
> deleted file mode 100644
> index 4afd7ba73d60..000000000000
> --- a/Documentation/devicetree/bindings/mux/reg-mux.txt
> +++ /dev/null
> @@ -1,129 +0,0 @@
> -Generic register bitfield-based multiplexer controller bindings
> -
> -Define register bitfields to be used to control multiplexers. The parent
> -device tree node must be a device node to provide register r/w access.
> -
> -Required properties:
> -- compatible : should be one of
> -	"reg-mux" : if parent device of mux controller is not syscon device
> -	"mmio-mux" : if parent device of mux controller is syscon device
> -- #mux-control-cells : <1>
> -- mux-reg-masks : an array of register offset and pre-shifted bitfield mask
> -                  pairs, each describing a single mux control.
> -* Standard mux-controller bindings as decribed in mux-controller.txt
> -
> -Optional properties:
> -- idle-states : if present, the state the muxes will have when idle. The
> -		special state MUX_IDLE_AS_IS is the default.
> -
> -The multiplexer state of each multiplexer is defined as the value of the
> -bitfield described by the corresponding register offset and bitfield mask
> -pair in the mux-reg-masks array.
> -
> -Example 1:
> -The parent device of mux controller is not a syscon device.
> -
> -&i2c0 {
> -	fpga@66 { // fpga connected to i2c
> -		compatible = "fsl,lx2160aqds-fpga", "fsl,fpga-qixis-i2c",
> -			     "simple-mfd";
> -		reg = <0x66>;
> -
> -		mux: mux-controller {
> -			compatible = "reg-mux";
> -			#mux-control-cells = <1>;
> -			mux-reg-masks = <0x54 0xf8>, /* 0: reg 0x54, bits 7:3 */
> -					<0x54 0x07>; /* 1: reg 0x54, bits 2:0 */
> -		};
> -	};
> -};
> -
> -mdio-mux-1 {
> -	compatible = "mdio-mux-multiplexer";
> -	mux-controls = <&mux 0>;
> -	mdio-parent-bus = <&emdio1>;
> -	#address-cells = <1>;
> -	#size-cells = <0>;
> -
> -	mdio@0 {
> -		reg = <0x0>;
> -		#address-cells = <1>;
> -		#size-cells = <0>;
> -	};
> -
> -	mdio@8 {
> -		reg = <0x8>;
> -		#address-cells = <1>;
> -		#size-cells = <0>;
> -	};
> -
> -	..
> -	..
> -};
> -
> -mdio-mux-2 {
> -	compatible = "mdio-mux-multiplexer";
> -	mux-controls = <&mux 1>;
> -	mdio-parent-bus = <&emdio2>;
> -	#address-cells = <1>;
> -	#size-cells = <0>;
> -
> -	mdio@0 {
> -		reg = <0x0>;
> -		#address-cells = <1>;
> -		#size-cells = <0>;
> -	};
> -
> -	mdio@1 {
> -		reg = <0x1>;
> -		#address-cells = <1>;
> -		#size-cells = <0>;
> -	};
> -
> -	..
> -	..
> -};
> -
> -Example 2:
> -The parent device of mux controller is syscon device.
> -
> -syscon {
> -	compatible = "syscon";
> -
> -	mux: mux-controller {
> -		compatible = "mmio-mux";
> -		#mux-control-cells = <1>;
> -
> -		mux-reg-masks = <0x3 0x30>, /* 0: reg 0x3, bits 5:4 */
> -				<0x3 0x40>, /* 1: reg 0x3, bit 6 */
> -		idle-states = <MUX_IDLE_AS_IS>, <0>;
> -	};
> -};
> -
> -video-mux {
> -	compatible = "video-mux";
> -	mux-controls = <&mux 0>;
> -	#address-cells = <1>;
> -	#size-cells = <0>;
> -
> -	ports {
> -		/* inputs 0..3 */
> -		port@0 {
> -			reg = <0>;
> -		};
> -		port@1 {
> -			reg = <1>;
> -		};
> -		port@2 {
> -			reg = <2>;
> -		};
> -		port@3 {
> -			reg = <3>;
> -		};
> -
> -		/* output */
> -		port@4 {
> -			reg = <4>;
> -		};
> -	};
> -};
> diff --git a/Documentation/devicetree/bindings/mux/reg-mux.yaml b/Documentation/devicetree/bindings/mux/reg-mux.yaml
> new file mode 100644
> index 000000000000..60d5746eb39d
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mux/reg-mux.yaml
> @@ -0,0 +1,143 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/mux/reg-mux.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Generic register bitfield-based multiplexer controller bindings
> +
> +maintainers:
> +  - Peter Rosin <peda@axentia.se>
> +
> +description: |+
> +  Define register bitfields to be used to control multiplexers. The parent
> +  device tree node must be a device node to provide register r/w access.
> +
> +properties:
> +  compatible:
> +    enum:
> +      - reg-mux   # parent device of mux controller is not syscon device
> +      - mmio-mux  # parent device of mux controller is syscon device
> +
> +  reg: true
> +
> +  '#mux-control-cells':
> +    const: 1
> +
> +  mux-reg-masks:
> +    description: an array of register offset and pre-shifted bitfield mask
> +      pairs, each describing a single mux control.
> +
> +  idle-states: true
> +
> +required:
> +  - compatible
> +  - mux-reg-masks
> +  - '#mux-control-cells'
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    /* The parent device of mux controller is not a syscon device. */
> +
> +    #include <dt-bindings/mux/mux.h>
> +
> +    mux-controller {
> +        compatible = "reg-mux";
> +        #mux-control-cells = <1>;
> +        mux-reg-masks =
> +            <0x54 0xf8>, /* 0: reg 0x54, bits 7:3 */
> +            <0x54 0x07>; /* 1: reg 0x54, bits 2:0 */
> +    };
> +
> +    mdio-mux-1 {
> +        compatible = "mdio-mux-multiplexer";
> +        mux-controls = <&mux1 0>;
> +        mdio-parent-bus = <&emdio1>;
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        mdio@0 {
> +            reg = <0x0>;
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +        };
> +
> +        mdio@8 {
> +            reg = <0x8>;
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +        };
> +    };
> +
> +    mdio-mux-2 {
> +        compatible = "mdio-mux-multiplexer";
> +        mux-controls = <&mux1 1>;
> +        mdio-parent-bus = <&emdio2>;
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        mdio@0 {
> +            reg = <0x0>;
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +        };
> +
> +        mdio@1 {
> +            reg = <0x1>;
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +        };
> +    };
> +
> +  - |
> +    /* The parent device of mux controller is syscon device. */
> +
> +    #include <dt-bindings/mux/mux.h>
> +    syscon@1000 {
> +        compatible = "fsl,imx7d-iomuxc-gpr", "fsl,imx6q-iomuxc-gpr", "syscon", "simple-mfd";
> +        reg = <0x1000 0x100>;
> +
> +        mux2: mux-controller {
> +            compatible = "mmio-mux";
> +            #mux-control-cells = <1>;
> +
> +            mux-reg-masks =
> +                <0x3 0x30>, /* 0: reg 0x3, bits 5:4 */
> +                <0x3 0x40>; /* 1: reg 0x3, bit 6 */
> +            idle-states = <MUX_IDLE_AS_IS>, <0>;
> +        };
> +    };
> +
> +    video-mux {
> +        compatible = "video-mux";
> +        mux-controls = <&mux2 0>;
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        ports {
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +
> +            /* inputs 0..3 */
> +            port@0 {
> +                reg = <0>;
> +            };
> +            port@1 {
> +                reg = <1>;
> +            };
> +            port@2 {
> +                reg = <2>;
> +            };
> +            port@3 {
> +                reg = <3>;
> +            };
> +
> +            /* output */
> +            port@4 {
> +                reg = <4>;
> +            };
> +        };
> +    };
> +...
> diff --git a/Documentation/devicetree/bindings/net/mdio-mux-multiplexer.txt b/Documentation/devicetree/bindings/net/mdio-mux-multiplexer.txt
> index 534e38058fe0..87fd0b4f654f 100644
> --- a/Documentation/devicetree/bindings/net/mdio-mux-multiplexer.txt
> +++ b/Documentation/devicetree/bindings/net/mdio-mux-multiplexer.txt
> @@ -14,7 +14,7 @@ each child node of mdio bus multiplexer consumer device represent a mdio
>  bus.
>  
>  for more information please refer
> -Documentation/devicetree/bindings/mux/mux-controller.txt
> +Documentation/devicetree/bindings/mux/mux-controller.yaml
>  and Documentation/devicetree/bindings/net/mdio-mux.txt
>  
>  Example:


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 2/6] dt-bindings: rtc: nxp,pcf8563: Convert to DT schema
  2021-05-18 23:28 ` [PATCH 2/6] dt-bindings: rtc: nxp,pcf8563: Convert to DT schema Rob Herring
  2021-05-19  1:25   ` Laurent Pinchart
@ 2021-05-25 21:27   ` Alexandre Belloni
  2021-05-26 17:06     ` Rob Herring
  1 sibling, 1 reply; 20+ messages in thread
From: Alexandre Belloni @ 2021-05-25 21:27 UTC (permalink / raw)
  To: Rob Herring
  Cc: devicetree, Peter Rosin, Wolfram Sang, linux-kernel,
	Jacopo Mondi, Kieran Bingham, Kishon Vijay Abraham I,
	Laurent Pinchart, Lee Jones, Niklas Söderlund,
	Roger Quadros, Jonathan Cameron

Hello,

On 18/05/2021 18:28:54-0500, Rob Herring wrote:
> Convert the Philips PCF8563/Epson RTC8564 binding to DT schema format.
> 
> Add 'interrupts' as this device has an interrupt which was not
> documented, but in use.
> 

It also supports start-year from rtc.yaml.

> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  .../devicetree/bindings/rtc/nxp,pcf8563.yaml  | 50 +++++++++++++++++++
>  .../devicetree/bindings/rtc/pcf8563.txt       | 29 -----------
>  2 files changed, 50 insertions(+), 29 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/rtc/nxp,pcf8563.yaml
>  delete mode 100644 Documentation/devicetree/bindings/rtc/pcf8563.txt
> 
> diff --git a/Documentation/devicetree/bindings/rtc/nxp,pcf8563.yaml b/Documentation/devicetree/bindings/rtc/nxp,pcf8563.yaml
> new file mode 100644
> index 000000000000..15e67be0ef95
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/rtc/nxp,pcf8563.yaml
> @@ -0,0 +1,50 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/rtc/nxp,pcf8563.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Philips PCF8563/Epson RTC8564 Real Time Clock
> +
> +maintainers:
> +  - Alexandre Belloni <alexandre.belloni@bootlin.com>
> +
> +properties:
> +  compatible:
> +    enum:
> +      - epson,rtc8564
> +      - microcrystal,rv8564
> +      - nxp,pcf8563
> +      - nxp,pca8565
> +
> +  reg:
> +    maxItems: 1
> +
> +  "#clock-cells":
> +    const: 0
> +
> +  clock-output-names:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +required:
> +  - compatible
> +  - reg
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        rtc@51 {
> +            compatible = "nxp,pcf8563";
> +            reg = <0x51>;
> +            #clock-cells = <0>;
> +        };
> +    };
> +...
> diff --git a/Documentation/devicetree/bindings/rtc/pcf8563.txt b/Documentation/devicetree/bindings/rtc/pcf8563.txt
> deleted file mode 100644
> index 0a900f7c8977..000000000000
> --- a/Documentation/devicetree/bindings/rtc/pcf8563.txt
> +++ /dev/null
> @@ -1,29 +0,0 @@
> -* Philips PCF8563/Epson RTC8564 Real Time Clock
> -
> -Philips PCF8563/Epson RTC8564 Real Time Clock
> -
> -Required properties:
> -- compatible: Should contain "nxp,pcf8563",
> -	"epson,rtc8564" or
> -	"microcrystal,rv8564" or
> -	"nxp,pca8565"
> -- reg: I2C address for chip.
> -
> -Optional property:
> -- #clock-cells: Should be 0.
> -- clock-output-names:
> -  overwrite the default clock name "pcf8563-clkout"
> -
> -Example:
> -
> -pcf8563: pcf8563@51 {
> -	compatible = "nxp,pcf8563";
> -	reg = <0x51>;
> -	#clock-cells = <0>;
> -};
> -
> -device {
> -...
> -	clocks = <&pcf8563>;
> -...
> -};
> -- 
> 2.27.0
> 

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 2/6] dt-bindings: rtc: nxp,pcf8563: Convert to DT schema
  2021-05-25 21:27   ` Alexandre Belloni
@ 2021-05-26 17:06     ` Rob Herring
  0 siblings, 0 replies; 20+ messages in thread
From: Rob Herring @ 2021-05-26 17:06 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: devicetree, Peter Rosin, Wolfram Sang, linux-kernel,
	Jacopo Mondi, Kieran Bingham, Kishon Vijay Abraham I,
	Laurent Pinchart, Lee Jones, Niklas Söderlund,
	Roger Quadros, Jonathan Cameron

On Tue, May 25, 2021 at 4:27 PM Alexandre Belloni
<alexandre.belloni@bootlin.com> wrote:
>
> Hello,
>
> On 18/05/2021 18:28:54-0500, Rob Herring wrote:
> > Convert the Philips PCF8563/Epson RTC8564 binding to DT schema format.
> >
> > Add 'interrupts' as this device has an interrupt which was not
> > documented, but in use.
> >
>
> It also supports start-year from rtc.yaml.

And wakeup-source. I've added both.

Rob

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2021-05-26 17:07 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18 23:28 [PATCH 0/6] dt-bindings: Convert mux bindings to schema Rob Herring
2021-05-18 23:28 ` [PATCH 1/6] dt-bindings: mfd: ti,j721e-system-controller: Fix mux node errors Rob Herring
2021-05-19 15:00   ` Lee Jones
2021-05-20 14:41   ` Kishon Vijay Abraham I
2021-05-20 15:19     ` Rob Herring
2021-05-18 23:28 ` [PATCH 2/6] dt-bindings: rtc: nxp,pcf8563: Convert to DT schema Rob Herring
2021-05-19  1:25   ` Laurent Pinchart
2021-05-25 21:27   ` Alexandre Belloni
2021-05-26 17:06     ` Rob Herring
2021-05-18 23:28 ` [PATCH 3/6] dt-bindings: mux: Convert mux controller bindings to schema Rob Herring
2021-05-22 10:41   ` Jonathan Cameron
2021-05-18 23:28 ` [PATCH 4/6] dt-bindings: i2c: Convert i2c-mux bindings to DT schema Rob Herring
2021-05-19  1:39   ` Laurent Pinchart
2021-05-19  1:40     ` Laurent Pinchart
2021-05-19  2:10     ` Rob Herring
2021-05-18 23:28 ` [PATCH 5/6] dt-bindings: i2c: i2c-mux-pca954x: Convert " Rob Herring
2021-05-19  1:23   ` Laurent Pinchart
2021-05-19  2:02     ` Rob Herring
2021-05-18 23:28 ` [PATCH 6/6] dt-bindings: i2c: maxim,max9286: Use the i2c-mux.yaml schema Rob Herring
2021-05-19  1:18   ` Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).