From patchwork Fri Mar 6 08:50:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 203757 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 48ED1C10F26 for ; Fri, 6 Mar 2020 08:50:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 17BF221739 for ; Fri, 6 Mar 2020 08:50:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726081AbgCFIun (ORCPT ); Fri, 6 Mar 2020 03:50:43 -0500 Received: from baptiste.telenet-ops.be ([195.130.132.51]:51386 "EHLO baptiste.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726231AbgCFIun (ORCPT ); Fri, 6 Mar 2020 03:50:43 -0500 Received: from ramsan ([84.195.182.253]) by baptiste.telenet-ops.be with bizsmtp id Awqg220095USYZQ01wqgQq; Fri, 06 Mar 2020 09:50:40 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1jA8gq-0002XJ-9M; Fri, 06 Mar 2020 09:50:40 +0100 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1jA8gq-00027c-5I; Fri, 06 Mar 2020 09:50:40 +0100 From: Geert Uytterhoeven To: Mark Brown , Rob Herring , Maxime Ripard Cc: Yoshihiro Shimoda , linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v3 1/2] spi: dt-bindings: spi-controller: Fix #address-cells for slave mode Date: Fri, 6 Mar 2020 09:50:37 +0100 Message-Id: <20200306085038.8111-2-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200306085038.8111-1-geert+renesas@glider.be> References: <20200306085038.8111-1-geert+renesas@glider.be> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Currently, the DT bindings for an SPI controller specify that "#address-cells" must be fixed to one. However, that applies to an SPI controller in master mode only. When running in SPI slave mode, "#address-cells" should not be specified. Fix this making "#address-cells" mutually-exclusive with "spi-slave". Fixes: 0a1b929356830257 ("spi: Add YAML schemas for the generic SPI options") Reported-by: Yoshihiro Shimoda Signed-off-by: Geert Uytterhoeven --- v3: - Make #address-cells mutually-exclusive with spi-slave, v2: - Use "enum: [0, 1]" instead of min/max limit, - use "- spi-slave" instead of "[ spi-slave ]". --- Documentation/devicetree/bindings/spi/spi-controller.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/spi/spi-controller.yaml b/Documentation/devicetree/bindings/spi/spi-controller.yaml index 1e0ca6ccf64bbd0a..0ebaf6677ac4f68d 100644 --- a/Documentation/devicetree/bindings/spi/spi-controller.yaml +++ b/Documentation/devicetree/bindings/spi/spi-controller.yaml @@ -52,6 +52,12 @@ properties: description: The SPI controller acts as a slave, instead of a master. +oneOf: + - required: + - "#address-cells" + - required: + - spi-slave + patternProperties: "^slave$": type: object From patchwork Fri Mar 6 08:50:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 203758 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=ham 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 60DFCC10F25 for ; Fri, 6 Mar 2020 08:50:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3990121D56 for ; Fri, 6 Mar 2020 08:50:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726240AbgCFIum (ORCPT ); Fri, 6 Mar 2020 03:50:42 -0500 Received: from andre.telenet-ops.be ([195.130.132.53]:38842 "EHLO andre.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726081AbgCFIum (ORCPT ); Fri, 6 Mar 2020 03:50:42 -0500 Received: from ramsan ([84.195.182.253]) by andre.telenet-ops.be with bizsmtp id Awqg220075USYZQ01wqg0k; Fri, 06 Mar 2020 09:50:40 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1jA8gq-0002XL-AJ; Fri, 06 Mar 2020 09:50:40 +0100 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1jA8gq-00027e-6t; Fri, 06 Mar 2020 09:50:40 +0100 From: Geert Uytterhoeven To: Mark Brown , Rob Herring , Maxime Ripard Cc: Yoshihiro Shimoda , linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v3 2/2] spi: dt-bindings: spi-controller: Fix spi-[rt]x-bus-width for slave mode Date: Fri, 6 Mar 2020 09:50:38 +0100 Message-Id: <20200306085038.8111-3-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200306085038.8111-1-geert+renesas@glider.be> References: <20200306085038.8111-1-geert+renesas@glider.be> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The descriptions for the spi-rx-bus-width and spi-tx-bus-width properties refer to "MISO" and "MOSI", which are not explained in the document. While these abbreviations are fairly common when talking about SPI, and thus may not need an explanation, they are not entirely correct in this context, as the SPI controller may be used in slave mode instead of master mode. Fix this by replacing them by "read transfers" resp. "write transfers", like is done for the spi-rx-delay-us and spi-tx-delay-us properties. Signed-off-by: Geert Uytterhoeven --- v3: - No changes, v2: - New. This issue was present in the .txt version of the bindings, too, so technically it needs Fixes: a8830cb19cfea04e ("spi: Document DT bindings for SPI controllers in slave mode") but of course it won't apply to that version. --- Documentation/devicetree/bindings/spi/spi-controller.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/spi/spi-controller.yaml b/Documentation/devicetree/bindings/spi/spi-controller.yaml index 0ebaf6677ac4f68d..d8e5509a70816df5 100644 --- a/Documentation/devicetree/bindings/spi/spi-controller.yaml +++ b/Documentation/devicetree/bindings/spi/spi-controller.yaml @@ -120,7 +120,7 @@ patternProperties: - enum: [ 1, 2, 4, 8 ] - default: 1 description: - Bus width to the SPI bus used for MISO. + Bus width to the SPI bus used for read transfers. spi-rx-delay-us: description: @@ -132,7 +132,7 @@ patternProperties: - enum: [ 1, 2, 4, 8 ] - default: 1 description: - Bus width to the SPI bus used for MOSI. + Bus width to the SPI bus used for write transfers. spi-tx-delay-us: description: