From mboxrd@z Thu Jan 1 00:00:00 1970 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=-6.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS 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 17E95C0044D for ; Mon, 16 Mar 2020 20:49:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D3E732073C for ; Mon, 16 Mar 2020 20:48:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=cerno.tech header.i=@cerno.tech header.b="LP1I9ll8"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="WAc3H/gW" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732561AbgCPUs7 (ORCPT ); Mon, 16 Mar 2020 16:48:59 -0400 Received: from new1-smtp.messagingengine.com ([66.111.4.221]:44883 "EHLO new1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732537AbgCPUs7 (ORCPT ); Mon, 16 Mar 2020 16:48:59 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id 6699B58089A; Mon, 16 Mar 2020 16:48:57 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 16 Mar 2020 16:48:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=2tglQQZWc8w8BFYHHOuQ8FRIUWK jMyItVwVW13flha0=; b=LP1I9ll8CV/bx8h+KXkGxkFpvuXfPfTPSCZq1455SA6 oW1thhFn4p2zGNFDMWx6loA246ZNaggiWkI2PMPcUKyYdptl0DIh8jL8C/kRJY44 tARF8LnwNGRM6Gl3v8ramNfHvpTJ+SGRAoqEtU6BYb+izeX2sTJSlbbue1XNw9bp qvuyRXX1KXurx5LuxJLI+zEl9TmtS50a4RpvGn/qEP24jJm2sekECVQdrzxxFLnT iPCB/Y/Rh7IErGSNZmDvJDePWHTUK2OFFMx1HvdI9IDQmVnR8XSsMYVk81T8c96R Pqyb03DlVavmgxAqFnifFpV00TF6BQwDRw9cLPkCSow== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=2tglQQ ZWc8w8BFYHHOuQ8FRIUWKjMyItVwVW13flha0=; b=WAc3H/gWQdr3elcEYWxvbq wslSbdrMrxGnWftrdLz+1T+t/F//9bAbg65T7dsIxWHugJtMIliNktmFEjm1Bfp/ za2nvaGjmUE+uPZJaDQyJRWAj8eX8x+nTeIB7EPm+tFyNab6f/t+Kkjic8UGX7VA CbjcelqmPy5gAjtyfJ1UbZp/g+ejTPdYvIhyrzIbvokKPdgos+7j9sgrq7Q/sVdB FJHAJ37alG/F7T/2W2Crv/aePS63mAe4fFN6nX4Uf+SFXbparBLXLO1Mms/CCeBO UGkWo8ZhsfGrSWc+B9iatHK2tuE+17Z1ueJx+J5tBLraJSNCmtBI41arNQVj5F6A == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrudeffedgudegtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepofgrgihi mhgvucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucfkpheple dtrdekledrieekrdejieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgr ihhlfhhrohhmpehmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA id D21533280060; Mon, 16 Mar 2020 16:48:52 -0400 (EDT) Date: Mon, 16 Mar 2020 21:48:50 +0100 From: Maxime Ripard To: Sam Ravnborg Cc: dri-devel@lists.freedesktop.org, Thierry Reding , Rob Herring , devicetree@vger.kernel.org, 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 , Nickey Yang , Paul Cercueil , Peter Rosin , Peter Ujfalusi , Purism Kernel Team , Robert Chiras , Sandeep Panda , Stefan Mavrodiev , Tomi Valkeinen , Tony Lindgren , Vinay Simha BN , Werner Johansson Subject: Re: [PATCH v1 02/36] dt-bindings: spi: support non-spi bindings as SPI slaves Message-ID: <20200316204850.gggeyjulgiy53i7x@gilmour.lan> References: <20200315134416.16527-1-sam@ravnborg.org> <20200315134416.16527-3-sam@ravnborg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200315134416.16527-3-sam@ravnborg.org> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Hi Sam, On Sun, Mar 15, 2020 at 02:43:42PM +0100, Sam Ravnborg wrote: > 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. > - I can see what you're trying to do, but you don't really need to. All the SPI devices will be declared under a spi controller node that will validate its child nodes (and thus the devices) already. Doing it this way would actually make all the checks happen twice, once as part of the SPI controller, once as part of the SPI device binding, without any good reason. Maxime