From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lubomir Rintel Subject: [PATCH 12/28] spi: dt-bindings: spi-controller: Slaves have no address cells Date: Tue, 17 Mar 2020 10:39:06 +0100 Message-ID: <20200317093922.20785-13-lkundrak@v3.sk> References: <20200317093922.20785-1-lkundrak@v3.sk> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: Linus Walleij , Bartosz Golaszewski , Thomas Gleixner , Jason Cooper , Marc Zyngier , Mauro Carvalho Chehab , Ulf Hansson , Kishon Vijay Abraham I , Alessandro Zummo , Alexandre Belloni , Greg Kroah-Hartman , Mark Brown , Daniel Lezcano , Andrew Lunn , Gregory Clement , Daniel Mack , Haojian Zhuang , Robert Jarzmik , devicetree@vger.kerne To: Rob Herring Return-path: In-Reply-To: <20200317093922.20785-1-lkundrak@v3.sk> Sender: linux-serial-owner@vger.kernel.org List-Id: linux-spi.vger.kernel.org SPI controllers in slave mode have a single child node that has no address. Enforce #address-cells of zero instead of one. Fixes: 0a1b929356830 ("spi: Add YAML schemas for the generic SPI options") Signed-off-by: Lubomir Rintel --- .../bindings/spi/spi-controller.yaml | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/Documentation/devicetree/bindings/spi/spi-controller.yaml b/Documentation/devicetree/bindings/spi/spi-controller.yaml index d8e5509a70816..30d774cf6cc95 100644 --- a/Documentation/devicetree/bindings/spi/spi-controller.yaml +++ b/Documentation/devicetree/bindings/spi/spi-controller.yaml @@ -15,16 +15,27 @@ description: | controller may be described for use in SPI master mode or in SPI slave mode, but not for both at the same time. +allOf: + - if: + required: + - spi-slave + then: + properties: + "#address-cells": + const: 0 + "#size-cells": + const: 0 + else: + properties: + "#address-cells": + const: 1 + "#size-cells": + const: 0 + properties: $nodename: pattern: "^spi(@.*|-[0-9a-f])*$" - "#address-cells": - const: 1 - - "#size-cells": - const: 0 - cs-gpios: description: | GPIOs used as chip selects. -- 2.25.1