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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2380AC64EC4 for ; Fri, 17 Feb 2023 23:27:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229695AbjBQX1I (ORCPT ); Fri, 17 Feb 2023 18:27:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229623AbjBQX1H (ORCPT ); Fri, 17 Feb 2023 18:27:07 -0500 Received: from mail-oa1-f41.google.com (mail-oa1-f41.google.com [209.85.160.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CE20460BE; Fri, 17 Feb 2023 15:27:04 -0800 (PST) Received: by mail-oa1-f41.google.com with SMTP id 586e51a60fabf-1718a49f834so2724692fac.8; Fri, 17 Feb 2023 15:27:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=LKUc5pbw1yazGVhBpNKjeMy/4FeHfZzgptlXZ0pQics=; b=sZM34XTQS+7Kp96zIzNUHm572rCcUUbxxsYYN/+nBR79O8g8Z6RGHjPLGz6obIqDoh 62PN3PKPDNKnS/YkWpluv8QJmqr3ItBbUNH4XvoTxmiZ3E/eQ7JJT4B7rEcwPrNcn1wy OloUn+A6Yz686cm9YJ02R1TwfKnzNvMSzqS4V6CaBaUpT6B2RKVXOWPYjNl/aZZWXkoa MmesgOO2iczagrAzgEewzR87pFbJ7rIFPEKIme6JXrwhGaiPcTnWbY9W4AykoAvLIbki +nhtTiJY7Gwc+bjQUEOAb6JGes5IK8Bqeuh8zKm4m1gHfoO4ES6HOnf7lQMULQEG33WI UGyg== X-Gm-Message-State: AO0yUKVK7YBBKZ/5RviQvLOXs0FJ1z+l/XMGjbSvOI62EhZMGhWhOlrP aEH6yoBH2u4pEsd6NEfwRA== X-Google-Smtp-Source: AK7set+mj3tCBmniQ4Vc/uuMNYw3VzuxafpQVmLbG/0nKq0jLJoNNkhvc7DvBjP86Zs2XAxRPe2WTA== X-Received: by 2002:a05:6870:b150:b0:169:dcba:1ec9 with SMTP id a16-20020a056870b15000b00169dcba1ec9mr1615221oal.41.1676676423521; Fri, 17 Feb 2023 15:27:03 -0800 (PST) Received: from robh_at_kernel.org (66-90-144-107.dyn.grandenetworks.net. [66.90.144.107]) by smtp.gmail.com with ESMTPSA id v1-20020a056870e28100b0015f4d1b195bsm2194520oad.36.2023.02.17.15.27.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Feb 2023 15:27:03 -0800 (PST) Received: (nullmailer pid 2260551 invoked by uid 1000); Fri, 17 Feb 2023 23:27:02 -0000 Date: Fri, 17 Feb 2023 17:27:02 -0600 From: Rob Herring To: Miquel Raynal Cc: Geert Uytterhoeven , Tudor Ambarus , Pratyush Yadav , Michael Walle , Richard Weinberger , Vignesh Raghavendra , Krzysztof Kozlowski , Mark Brown , linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org Subject: Re: [PATCH] dt-bindings: mtd: jedec,spi-nor: Document CPOL/CPHA support Message-ID: <20230217232702.GA2257281-robh@kernel.org> References: <20230214154433.6a421c51@xps-13> <20230214165637.56102b18@xps-13> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230214165637.56102b18@xps-13> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Tue, Feb 14, 2023 at 04:56:37PM +0100, Miquel Raynal wrote: > Hi Geert, > > geert@linux-m68k.org wrote on Tue, 14 Feb 2023 16:22:15 +0100: > > > Hi Miquel, > > > > On Tue, Feb 14, 2023 at 3:44 PM Miquel Raynal wrote: > > > geert+renesas@glider.be wrote on Tue, 14 Feb 2023 15:26:43 +0100: > > > > SPI EEPROMs typically support both SPI Mode 0 (CPOL=CPHA=0) and Mode 3 > > > > (CPOL=CPHA=1). However, using the latter is currently flagged as an > > > > error by "make dtbs_check", e.g.: > > > > > > > > arch/arm/boot/dts/r8a7791-koelsch.dtb: flash@0: Unevaluated properties are not allowed ('spi-cpha', 'spi-cpol' were unexpected) > > > > From schema: Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml > > > > > > > > Fix this by documenting support for CPOL=CPHA=1. > > > > > > > > Fixes: 233363aba72ac638 ("spi/panel: dt-bindings: drop CPHA and CPOL from common properties") > > > > Signed-off-by: Geert Uytterhoeven > > > > --- > > > > Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml | 7 +++++++ > > > > 1 file changed, 7 insertions(+) > > > > > > > > diff --git a/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml b/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml > > > > index f86255ce13af0871..bb62ac4585822982 100644 > > > > --- a/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml > > > > +++ b/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml > > > > @@ -76,6 +76,13 @@ properties: > > > > If "broken-flash-reset" is present then having this property does not > > > > make any difference. > > > > > > > > + spi-cpol: true > > > > + spi-cpha: true > > > > > > I see that spi-cpol and spi-cpha are described in spi-controller.yaml > > > which references spi-peripheral-props.yaml, but jedec,spi-nor.yaml > > > only references spi-peripheral-props.yaml leading to spi-cpol and > > > spi-cpha not being recognized as valid properties. > > > > > > Wouldn't it be cleaner to to have these two properties defined in > > > spi-peripheral-props.yaml instead? > > > > They were moved out of that file by the commit referenced in the > > Fixes: tag above, because they are not supported by all SPI targets. > > It's the responsibility of the SPI target bindings to list what is supported. > > Oops, I overlooked that line. > > I actually see no point in constraining device trees on that regard, > but, well, Krzysztof is the author, I believe he knows his stuff, so > let's go for it. It's a feature of the specific device as to what modes it supports. For most cases where there is only one choice it should be implied from the compatible, but there's some exceptions like this one. Rob