Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4069178ybl; Mon, 26 Aug 2019 05:08:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqw6K8DJ8A+KItiAsTypgVXu/8u+lebCoO0QIFqRNEkNJSXAo5v9enqPglQOIbql3tCiGLPM X-Received: by 2002:a62:64d4:: with SMTP id y203mr19553497pfb.91.1566821282677; Mon, 26 Aug 2019 05:08:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566821282; cv=none; d=google.com; s=arc-20160816; b=efPJv1lXK3jkyiYrXZOpS65jI4Oce7lTS/8ioy4pSBkFq6Ir2LtBgVJnut/pdns0Y9 Em1DN1IsJ4T/CF+pYfRNuNxqWrL3tdf5fgqNP7IpCy60PqKulLj0aTr0A/tw6ruhJNBe HC9I7QD1+GHfjrEG/ijWegv5SysjGdMoJ1MSYMRZkzXgKIIwWN510wIrbEipe2wl7NoL wmpOu/LXP8K5RA1u0I6+IKVp+Zlx8cxQlhVMvgZ5jEvy1W3z8/QJWF7s4UJ0u1OyQytV ZA6695qjOs7O4DmFRzLIyiP1KZwuMTnbhdma4xVaCgDKhOiEP2hynSu7Z7H61iOiJzIU 1J2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=yg9yGi6aFmPMS8+/kbygbIi/Ssn/Id17Mxxya3vrwaA=; b=YcpxchqRYhuKmg6pz2tLBME1PaCtuLOmCj98NG9cjOOV/MVxi/haWCOpuX92zRWHrO rL7N57DamTPyn6+6Ck4rlKYbSc1Nuy8svNskWdilKerwSye8900TZuaoiLOGVzYfMvAt GAsFNSiv+bb78cPNfPEv7CGKh+1ZBbA5NRRhvC+y+MCSHAINrQUzQYDTFlIKcq/01uxU 5JKV9+dg2HYTntos2w1nFaT6eMSPI+9tIYsNWMf1vWE4UGXporCCUQASKVz+NyirPFZj ZeKPykYPfZZ63DEfe+SduL5IWN6+GbXQGcsTxZ+yVeug2xL200n27KsC5VMCGw/OCc3u ++/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=io3aMAGY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t24si8585177pgu.221.2019.08.26.05.07.44; Mon, 26 Aug 2019 05:08:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=io3aMAGY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731513AbfHZMGS (ORCPT + 99 others); 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-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 >