From patchwork Mon Sep 12 20:50:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 9328025 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4734A60231 for ; Mon, 12 Sep 2016 20:50:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3784C28EB8 for ; Mon, 12 Sep 2016 20:50:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2C3C528EBA; Mon, 12 Sep 2016 20:50:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 161E428EB8 for ; Mon, 12 Sep 2016 20:50:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756389AbcILUuv (ORCPT ); Mon, 12 Sep 2016 16:50:51 -0400 Received: from michel.telenet-ops.be ([195.130.137.88]:54821 "EHLO michel.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754434AbcILUut (ORCPT ); Mon, 12 Sep 2016 16:50:49 -0400 Received: from ayla.of.borg ([84.193.137.253]) by michel.telenet-ops.be with bizsmtp id ikql1t0055UCtCs06kqlKh; Mon, 12 Sep 2016 22:50:48 +0200 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.82) (envelope-from ) id 1bjYBh-00027Y-4d; Mon, 12 Sep 2016 22:50:45 +0200 Received: from geert by ramsan with local (Exim 4.82) (envelope-from ) id 1bjYBl-0007uZ-8g; Mon, 12 Sep 2016 22:50:49 +0200 From: Geert Uytterhoeven To: Mark Brown Cc: Rob Herring , Mark Rutland , Magnus Damm , Wolfram Sang , Hisashi Nakamura , Hiromitsu Yamasaki , linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH/RFC v2 1/7] spi: Document DT bindings for SPI controllers in slave mode Date: Mon, 12 Sep 2016 22:50:40 +0200 Message-Id: <1473713446-30366-2-git-send-email-geert+renesas@glider.be> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1473713446-30366-1-git-send-email-geert+renesas@glider.be> References: <1473713446-30366-1-git-send-email-geert+renesas@glider.be> Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Geert Uytterhoeven --- v2: - Do not create a child node in SPI slave mode. Instead, add an "spi-slave" property, and put the mode properties in the controller node. --- Documentation/devicetree/bindings/spi/spi-bus.txt | 34 ++++++++++++++--------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/Documentation/devicetree/bindings/spi/spi-bus.txt b/Documentation/devicetree/bindings/spi/spi-bus.txt index 17822860cb98c34d..1ae28d7cafb68dc5 100644 --- a/Documentation/devicetree/bindings/spi/spi-bus.txt +++ b/Documentation/devicetree/bindings/spi/spi-bus.txt @@ -1,17 +1,23 @@ SPI (Serial Peripheral Interface) busses -SPI busses can be described with a node for the SPI master device -and a set of child nodes for each SPI slave on the bus. For this -discussion, it is assumed that the system's SPI controller is in -SPI master mode. This binding does not describe SPI controllers -in slave mode. +SPI busses can be described with a node for the SPI controller device +and a set of child nodes for each SPI slave on the bus. The system's SPI +controller may be described for use in SPI master mode or in SPI slave mode, +but not for both at the same time. -The SPI master node requires the following properties: +The SPI controller node requires the following properties: +- compatible - name of SPI bus controller following generic names + recommended practice. + +In master mode, the SPI controller node requires the following additional +properties: - #address-cells - number of cells required to define a chip select address on the SPI bus. - #size-cells - should be zero. -- compatible - name of SPI bus controller following generic names - recommended practice. + +In slave mode, the SPI controller node requires one additional property: +- spi-slave - Empty property. + No other properties are required in the SPI bus node. It is assumed that a driver for an SPI bus device will understand that it is an SPI bus. However, the binding does not attempt to define the specific method for @@ -21,7 +27,7 @@ assumption that board specific platform code will be used to manage chip selects. Individual drivers can define additional properties to support describing the chip select layout. -Optional properties: +Optional properties (master mode only): - cs-gpios - gpios chip select. - num-cs - total number of chipselects. @@ -41,12 +47,14 @@ cs1 : native cs2 : &gpio1 1 0 cs3 : &gpio1 2 0 -SPI slave nodes must be children of the SPI master node and can -contain the following properties. -- reg - (required) chip select address of device. +In master mode, SPI slave nodes must be children of the SPI controller node. +In slave mode, the (single) slave device is represented by the controller node +itself. SPI slave nodes can contain the following properties. +- reg - (required, master mode only) chip select address of device. - compatible - (required) name of SPI device following generic names recommended practice. -- spi-max-frequency - (required) Maximum SPI clocking speed of device in Hz. +- spi-max-frequency - (required, master mode only) Maximum SPI clocking speed + of device in Hz. - spi-cpol - (optional) Empty property indicating device requires inverse clock polarity (CPOL) mode. - spi-cpha - (optional) Empty property indicating device requires