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=-7.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 58D45C3A59F for ; Mon, 26 Aug 2019 12:06:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 230232184D for ; Mon, 26 Aug 2019 12:06:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566821183; bh=pSm3PvDMTIhWrias2jUj42UGA5TFBFdrlS5QO6QgtCQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=kDSiG5RSrz1wg2n5BPqzc4ngfN/ac9nSHmU/iQf3Drg/eZ+z5MseWhzYqvaISWIrZ q4hzWnZLF6u8IOiXn7pkHyVykZcNhyp/hYz6hhfAyfFElXL6LNwqp/wRQRKipeL6Ao 5URs7cm0MR7uKcoIbg5uT0fprHZYv5DuNIUoitOo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731462AbfHZMGS (ORCPT ); Mon, 26 Aug 2019 08:06:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:55034 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731060AbfHZMGS (ORCPT ); Mon, 26 Aug 2019 08:06:18 -0400 Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com [209.85.160.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 64D3F2187F; Mon, 26 Aug 2019 12:06:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566821176; bh=pSm3PvDMTIhWrias2jUj42UGA5TFBFdrlS5QO6QgtCQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=io3aMAGY1vLQLpnXBTGGQRmRoMF0Z3ucgOly06j72Whv8rl7xT1KFCYyKmlLidWs3 Qit/fL3LL7kfMz6VSYutfHMnEYhIKe+/vtK0zd5YWrozSPVEGU8qnMYwsvvDG/CMl8 nKvLGU3h6Se1hrH6oINn9wwihCiN7pzs42pZsyN4= Received: by mail-qt1-f176.google.com with SMTP id j15so17486591qtl.13; Mon, 26 Aug 2019 05:06:16 -0700 (PDT) X-Gm-Message-State: APjAAAV6TFX+4zvCfT+S2DIM9+B1r8stCY6Gl6bFY2XSL5eN8eX4poZg liVbv00ZOIytea9cknjGnvpzdrMUgPgr7uyOFQ== X-Google-Smtp-Source: APXvYqywXvicr53vDpn7Lf7WyzQ+wjP/YIGuHrEhvTUukwIr28KdgsvczQlUyUAExmZ1tGD9jxYqR9nGPsTCyWlJexY= X-Received: by 2002:ad4:4050:: with SMTP id r16mr15115021qvp.200.1566821175529; Mon, 26 Aug 2019 05:06:15 -0700 (PDT) MIME-Version: 1.0 References: <20190823145356.6341-1-krzk@kernel.org> <20190823145356.6341-7-krzk@kernel.org> In-Reply-To: <20190823145356.6341-7-krzk@kernel.org> From: Rob Herring Date: Mon, 26 Aug 2019 07:06:02 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC 7/9] dt-bindings: rtc: s3c: Convert S3C/Exynos RTC bindings to json-schema To: Krzysztof Kozlowski Cc: Mark Rutland , Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Alessandro Zummo , Alexandre Belloni , =?UTF-8?Q?Pawe=C5=82_Chmiel?= , devicetree@vger.kernel.org, "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , linux-samsung-soc , "linux-kernel@vger.kernel.org" , "open list:IIO SUBSYSTEM AND DRIVERS" , "open list:REAL TIME CLOCK (RTC) SUBSYSTEM" , notify@kernel.org, Arnd Bergmann , Olof Johansson , Marek Szyprowski , Tomasz Figa Content-Type: text/plain; charset="UTF-8" Sender: linux-rtc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rtc@vger.kernel.org On Fri, Aug 23, 2019 at 9:54 AM Krzysztof Kozlowski wrote: > > Convert Samsung S3C/Exynos Real Time Clock bindings to DT schema format > using json-schema. > > Signed-off-by: Krzysztof Kozlowski > --- > .../devicetree/bindings/rtc/s3c-rtc.txt | 31 ------ > .../devicetree/bindings/rtc/s3c-rtc.yaml | 95 +++++++++++++++++++ > 2 files changed, 95 insertions(+), 31 deletions(-) > delete mode 100644 Documentation/devicetree/bindings/rtc/s3c-rtc.txt > create mode 100644 Documentation/devicetree/bindings/rtc/s3c-rtc.yaml > diff --git a/Documentation/devicetree/bindings/rtc/s3c-rtc.yaml b/Documentation/devicetree/bindings/rtc/s3c-rtc.yaml > new file mode 100644 > index 000000000000..44b021812a83 > --- /dev/null > +++ b/Documentation/devicetree/bindings/rtc/s3c-rtc.yaml > @@ -0,0 +1,95 @@ > +# SPDX-License-Identifier: GPL-2.0 > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/rtc/s3c-rtc.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Samsung S3C, S5P and Exynos Real Time Clock controller > + > +maintainers: > + - Krzysztof Kozlowski > + > +# Select also deprecated compatibles (for finding deprecate usage) > +select: > + properties: > + compatible: > + items: > + - enum: > + - samsung,s3c2410-rtc > + - samsung,s3c2416-rtc > + - samsung,s3c2443-rtc > + - samsung,s3c6410-rtc > + # Deprecated, use samsung,s3c6410-rtc > + - samsung,exynos3250-rtc We've come up with a better way of doing this that doesn't need a custom 'select'. Add a 'oneOf' to compatible and add another entry: - const: samsung,exynos3250-rtc deprecated: true It's not implemented yet in the tool, but we'll keep the compatible for 'select' and otherwise drop schema marked deprecated. > + required: > + - compatible > + > +properties: > + compatible: > + items: > + - enum: You can drop 'items' when there's only 1 entry. > + - samsung,s3c2410-rtc > + - samsung,s3c2416-rtc > + - samsung,s3c2443-rtc > + - samsung,s3c6410-rtc > + reg: > + maxItems: 1 > + > + clocks: > + description: > + Must contain a list of phandle and clock specifier for the rtc > + clock and in the case of a s3c6410 compatible controller, also > + a source clock. > + minItems: 1 > + maxItems: 2 > + > + clock-names: > + description: > + Must contain "rtc" and for a s3c6410 compatible controller, > + a "rtc_src" sorted in the same order as the clocks property. > + oneOf: > + - items: > + - const: rtc > + - items: > + # TODO: This can be in any order matching clocks, how to express it? It shouldn't be in any order. Fix the dts files. > + - const: rtc > + - const: rtc_src You should drop all this and add an else clause below. > + > + interrupts: > + description: > + Two interrupt numbers to the cpu should be specified. First > + interrupt number is the rtc alarm interrupt and second interrupt number > + is the rtc tick interrupt. The number of cells representing a interrupt > + depends on the parent interrupt controller. > + minItems: 2 > + maxItems: 2 > + > +allOf: > + - if: > + properties: > + compatible: > + contains: > + enum: > + - samsung,s3c6410-rtc > + - samsung,exynos3250-rtc > + > + then: > + properties: > + clocks: > + minItems: 2 > + maxItems: 2 > + clock-names: > + items: > + - const: rtc > + - const: rtc_src Should be indented 2 more spaces. > + > +examples: > + - | > + rtc@10070000 { > + compatible = "samsung,s3c6410-rtc"; > + reg = <0x10070000 0x100>; > + interrupts = <0 44 4>, <0 45 4>; > + clocks = <&clock 0>, // CLK_RTC > + <&s2mps11_osc 0>; // S2MPS11_CLK_AP > + clock-names = "rtc", "rtc_src"; > + }; > -- > 2.17.1 >