From patchwork Sun Mar 15 13:43:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 203300 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.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 47A87C10DCE for ; Sun, 15 Mar 2020 13:44:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 16CA920575 for ; Sun, 15 Mar 2020 13:44:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Oqq5zZmQ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726498AbgCONof (ORCPT ); Sun, 15 Mar 2020 09:44:35 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:33613 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728634AbgCONof (ORCPT ); Sun, 15 Mar 2020 09:44:35 -0400 Received: by mail-lj1-f196.google.com with SMTP id f13so15622071ljp.0; Sun, 15 Mar 2020 06:44:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=X45tw5KJlXhhJ3R6ynp7V7JRLgh1AOjgAQ5sYiJA7gQ=; b=Oqq5zZmQwYobC/AnUgTbv+2yNqZC1ysfOc2s7Dq7jJeMNanIhWjon9tWa5pfztJ6Oy Pej2RybnxI+89G9uHBa5IkXk6CoAIE/puDgRbN4dc3gybEtjgASgzlhLXnxUkEg0N53g jQkIaV4mdCElNhUzuuB1FR8JWCm8miXnIcYViF/mUf+gziC95xg6kXReV9Lx4NYnRMs5 A6OfsMYAdo36YXPL913Pb/T2v3A1vCVSEDCufLgZM8jA9Lj0wSarOW5f4eT8/GmzkkJ4 I81/N2rLrQxHi7Ren4MnSl5o1/9CHex0yrqCyUS74kwQsglYxMu2soNbKK/M2VHfol5A P5Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=X45tw5KJlXhhJ3R6ynp7V7JRLgh1AOjgAQ5sYiJA7gQ=; b=n21JYe9qLqKc57O0DKIWoqIbfmnD5ZVVsumZkpSuUnrMIfWll/tJ4NyhExECW3CuPJ J6KhsBmgz2BnfjSxK2fAHCR4RujOwFaZkUW2kBvwZR4Q0V4YXV3Eh+fnUU/mIZeVFM+0 I6eJ3powKB/0xAi6iJqzUGlugmmn7VswoS+z2ZdpW/h6UVmeBxBXyd6Q1pD7rIG89Cei J04wDugByqaO/PJAMwHZ/j1mb6SyDhxWj1nABInCWmYebqVqtcJP6e2J5d1jAbXC1I+m FMC8oJdWB+iDpdEibzXeKiWZ6dR768PKRnsr8INuMSOXIucHpQGpiPRqkQyLffU6mGkc cRbA== X-Gm-Message-State: ANhLgQ2jTvM16DpLkmAPnM2xDUnXw9JqBOzSwsMpAdqadvF5dsXLef+T HqWvaOlN49X12Ix70wVymtk= X-Google-Smtp-Source: ADFU+vvKezVrr5pKhPKFDDiDBtGVr/h70AHssvhC8VNZHgZJoJYzPcWqdWCvDfcTSWr33npk2S7GtA== X-Received: by 2002:a2e:3002:: with SMTP id w2mr10976729ljw.82.1584279872839; Sun, 15 Mar 2020 06:44:32 -0700 (PDT) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id a9sm23025212lfb.21.2020.03.15.06.44.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Mar 2020 06:44:32 -0700 (PDT) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding , Rob Herring , devicetree@vger.kernel.org Cc: Alexandre Courbot , Andrzej Hajda , Brian Masney , Chris Zhong , Douglas Anderson , Guido Gunther , Heiko Schocher , Nikolaus Schaller , Hoegeun Kwon , Jagan Teki , Jerry Han , Jonathan Bakker , Laurent Pinchart , Lin Huang , Linus Walleij , linux-spi@vger.kernel.org, Marco Franchi , Marek Belisko , Mark Brown , Maxime Ripard , Maxime Ripard , Nickey Yang , Paul Cercueil , Peter Rosin , Peter Ujfalusi , Purism Kernel Team , Robert Chiras , Sam Ravnborg , Sandeep Panda , Stefan Mavrodiev , Tomi Valkeinen , Tony Lindgren , Vinay Simha BN , Werner Johansson Subject: [PATCH v1 02/36] dt-bindings: spi: support non-spi bindings as SPI slaves Date: Sun, 15 Mar 2020 14:43:42 +0100 Message-Id: <20200315134416.16527-3-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200315134416.16527-1-sam@ravnborg.org> References: <20200315134416.16527-1-sam@ravnborg.org> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Independent bindings can be SPI slaves which for example is the case for several panel bindings. Move SPI slave properties to spi-slave.yaml so the independent SPI slave bindings can include spi-slave.yaml rather than duplicating the properties. Signed-off-by: Sam Ravnborg Cc: Maxime Ripard Cc: Rob Herring Cc: Mark Brown Cc: linux-spi@vger.kernel.org --- .../bindings/spi/spi-controller.yaml | 63 +------------- .../devicetree/bindings/spi/spi-slave.yaml | 83 +++++++++++++++++++ 2 files changed, 86 insertions(+), 60 deletions(-) create mode 100644 Documentation/devicetree/bindings/spi/spi-slave.yaml diff --git a/Documentation/devicetree/bindings/spi/spi-controller.yaml b/Documentation/devicetree/bindings/spi/spi-controller.yaml index 1e0ca6ccf64b..99531c8d10dd 100644 --- a/Documentation/devicetree/bindings/spi/spi-controller.yaml +++ b/Documentation/devicetree/bindings/spi/spi-controller.yaml @@ -67,71 +67,14 @@ patternProperties: "^.*@[0-9a-f]+$": type: object + allOf: + - $ref: spi-slave.yaml# + properties: compatible: description: Compatible of the SPI device. - reg: - minimum: 0 - maximum: 256 - description: - Chip select used by the device. - - spi-3wire: - $ref: /schemas/types.yaml#/definitions/flag - description: - The device requires 3-wire mode. - - spi-cpha: - $ref: /schemas/types.yaml#/definitions/flag - description: - The device requires shifted clock phase (CPHA) mode. - - spi-cpol: - $ref: /schemas/types.yaml#/definitions/flag - description: - The device requires inverse clock polarity (CPOL) mode. - - spi-cs-high: - $ref: /schemas/types.yaml#/definitions/flag - description: - The device requires the chip select active high. - - spi-lsb-first: - $ref: /schemas/types.yaml#/definitions/flag - description: - The device requires the LSB first mode. - - spi-max-frequency: - $ref: /schemas/types.yaml#/definitions/uint32 - description: - Maximum SPI clocking speed of the device in Hz. - - spi-rx-bus-width: - allOf: - - $ref: /schemas/types.yaml#/definitions/uint32 - - enum: [ 1, 2, 4, 8 ] - - default: 1 - description: - Bus width to the SPI bus used for MISO. - - spi-rx-delay-us: - description: - Delay, in microseconds, after a read transfer. - - spi-tx-bus-width: - allOf: - - $ref: /schemas/types.yaml#/definitions/uint32 - - enum: [ 1, 2, 4, 8 ] - - default: 1 - description: - Bus width to the SPI bus used for MOSI. - - spi-tx-delay-us: - description: - Delay, in microseconds, after a write transfer. - required: - compatible - reg diff --git a/Documentation/devicetree/bindings/spi/spi-slave.yaml b/Documentation/devicetree/bindings/spi/spi-slave.yaml new file mode 100644 index 000000000000..fa50d9dfab41 --- /dev/null +++ b/Documentation/devicetree/bindings/spi/spi-slave.yaml @@ -0,0 +1,83 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/spi/spi-slave.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: SPI slave generic binding + +maintainers: + - Mark Brown + +description: | + This document defines device tree properties common to SPI slaves. + It doesn't constitue a device tree binding specification by + itself but is meant to be referenced by device tree bindings. + + When referenced from device tree bindings the properties defined in this + document are defined as follows. The device tree bindings are responsible + for defining whether each property is required or optional. + +properties: + + reg: + minimum: 0 + maximum: 256 + description: + Chip select used by the device. + + spi-3wire: + $ref: /schemas/types.yaml#/definitions/flag + description: + The device requires 3-wire mode. + + spi-cpha: + $ref: /schemas/types.yaml#/definitions/flag + description: + The device requires shifted clock phase (CPHA) mode. + + spi-cpol: + $ref: /schemas/types.yaml#/definitions/flag + description: + The device requires inverse clock polarity (CPOL) mode. + + spi-cs-high: + $ref: /schemas/types.yaml#/definitions/flag + description: + The device requires the chip select active high. + + spi-lsb-first: + $ref: /schemas/types.yaml#/definitions/flag + description: + The device requires the LSB first mode. + + spi-max-frequency: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Maximum SPI clocking speed of the device in Hz. + + spi-rx-bus-width: + allOf: + - $ref: /schemas/types.yaml#/definitions/uint32 + - enum: [ 1, 2, 4, 8 ] + - default: 1 + description: + Bus width to the SPI bus used for MISO. + + spi-rx-delay-us: + description: + Delay, in microseconds, after a read transfer. + + spi-tx-bus-width: + allOf: + - $ref: /schemas/types.yaml#/definitions/uint32 + - enum: [ 1, 2, 4, 8 ] + - default: 1 + description: + Bus width to the SPI bus used for MOSI. + + spi-tx-delay-us: + description: + Delay, in microseconds, after a write transfer. + +...