From patchwork Tue Mar 17 09:39:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lubomir Rintel X-Patchwork-Id: 210583 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 530A6C10F29 for ; Tue, 17 Mar 2020 09:42:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 307FB20724 for ; Tue, 17 Mar 2020 09:42:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726789AbgCQJkZ (ORCPT ); Tue, 17 Mar 2020 05:40:25 -0400 Received: from v6.sk ([167.172.42.174]:50344 "EHLO v6.sk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726852AbgCQJkX (ORCPT ); Tue, 17 Mar 2020 05:40:23 -0400 Received: from localhost (v6.sk [IPv6:::1]) by v6.sk (Postfix) with ESMTP id 332816108C; Tue, 17 Mar 2020 09:40:21 +0000 (UTC) From: Lubomir Rintel To: Rob Herring 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.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-i2c@vger.kernel.org, linux-media@vger.kernel.org, linux-mmc@vger.kernel.org, linux-rtc@vger.kernel.org, linux-serial@vger.kernel.org, linux-spi@vger.kernel.org, linux-usb@vger.kernel.org, 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> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200317093922.20785-1-lkundrak@v3.sk> References: <20200317093922.20785-1-lkundrak@v3.sk> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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.