Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1624029ybe; Tue, 3 Sep 2019 00:48:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqxhTwA8vwm5nmHDQLR55dyyfYVXCmSXoMwCnqDqDGaHe+KNiLDUfhcKPZUwa3VNyLoSuNY+ X-Received: by 2002:aa7:8a13:: with SMTP id m19mr15599365pfa.228.1567496891330; Tue, 03 Sep 2019 00:48:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567496891; cv=none; d=google.com; s=arc-20160816; b=PXQS6Z5TuAaxcnBIFej3jBxxULL4xsShQZB9RMUaTwVCFwOpwt1PED+sYAEkWbukMX GEzcieWpz+sY39wacCRVhVnxzp01npG4d1+ZcsjUCVddSp9PQxGWCYT7OTd+CRyWrp6Q ZUOmVyYoMdRjVYJVscsKPp1x5Sszz5Ospb6OehljcEbPwT+SwJXi6BaYhZvFF7gxvdLw cbrvfbyBePZ/C8obKuUv83Z9co1F91INaBya30i5z2NJy8KJ4i71AcVnVtTYzB74mVOp 3UDFt1NKxn2zmemE/GDeSB8zPkeR2L+hestkfy3wzic3BG4t7aY4fcje9Z7RDOPvc1v9 yCsA== 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=jZwJgjq5KI2Un8XXHLUFM+TUvy4GtLbEuW3z9VeiGCU=; b=0+SozEJDV784ONA7aVP9qLGOzHBQmxpfCiD4wqg0zp6VJWH6ka8/ER4PmDEHdfu+K8 NSSA60UUynRWjKrTJUgvcX+2Lq/LQQj5Fy2j7vUoc3I8aj0OebfASfCd1/vpcK8zLyMc wB02VsfKhXPVNshTjgntc5KbC/rRTOdjjSbY8AWg/pASq2JeZNJvgNEJf51B4vlWa9GS WyeBhzC2VdwqovengcDPrUyuBtbhvd1NXlJ1T0kUZnRnkZHB1b9W3Lly/9m2VSXl3EzO Cv4MP7tHvHkJXSB9nAp8tqrtsBHXAHYbnIHpMDeYSJZ8u8tYz643UqDNxZLVoqUgjDpj peiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mk468JDy; 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 k21si16452394pfk.266.2019.09.03.00.47.55; Tue, 03 Sep 2019 00:48:11 -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=mk468JDy; 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 S1727702AbfICHrE (ORCPT + 99 others); Tue, 3 Sep 2019 03:47:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:39546 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726452AbfICHrD (ORCPT ); Tue, 3 Sep 2019 03:47:03 -0400 Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (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 034AF2053B; Tue, 3 Sep 2019 07:47:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567496822; bh=RuEU75Q1POSO0w61+q41p+/7Q/GAHx2CK3Fki186RB4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=mk468JDy/2IvHvOcaxJbsYuG99xwARgNgtbjcqBHSQu8ZxKWjTpRUKPZ8+6WzKy2u Q5UCQ70neOx98y/LB/vY+qc2WCchR5+SAPzwfTj3sH/YU4RUWfSfr3QWuuYvflnq6R l5VC0HgOWIkh8koGlRSR/S4AZQ9q49Pu/8pfSCa4= Received: by mail-lf1-f45.google.com with SMTP id c12so12084783lfh.5; Tue, 03 Sep 2019 00:47:01 -0700 (PDT) X-Gm-Message-State: APjAAAUHIHnRdDPtMuB9ylzCp8gLwSTGF5hnJniVGoLsq3eN9uk+v/1v vxqxD0V9GIvKiPf5zQMpzh4z8dphdClfC6ehqO0= X-Received: by 2002:a19:c649:: with SMTP id w70mr20043799lff.33.1567496820229; Tue, 03 Sep 2019 00:47:00 -0700 (PDT) MIME-Version: 1.0 References: <20190902150336.3600-1-krzk@kernel.org> In-Reply-To: From: Krzysztof Kozlowski Date: Tue, 3 Sep 2019 09:46:49 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] dt-bindings: power: syscon-reboot: Convert bindings to json-schema To: Rob Herring Cc: Sebastian Reichel , Mark Rutland , "open list:THERMAL" , devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" 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 Tue, 3 Sep 2019 at 09:14, Rob Herring wrote: > > On Mon, Sep 2, 2019 at 4:03 PM Krzysztof Kozlowski wrote: > > > > Convert the Syscon reboot bindings to DT schema format using > > json-schema. > > > > Signed-off-by: Krzysztof Kozlowski > > --- > > .../bindings/power/reset/syscon-reboot.txt | 30 -------- > > .../bindings/power/reset/syscon-reboot.yaml | 68 +++++++++++++++++++ > > 2 files changed, 68 insertions(+), 30 deletions(-) > > delete mode 100644 Documentation/devicetree/bindings/power/reset/syscon-reboot.txt > > create mode 100644 Documentation/devicetree/bindings/power/reset/syscon-reboot.yaml > > > diff --git a/Documentation/devicetree/bindings/power/reset/syscon-reboot.yaml b/Documentation/devicetree/bindings/power/reset/syscon-reboot.yaml > > new file mode 100644 > > index 000000000000..a583f3dc8ef4 > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/power/reset/syscon-reboot.yaml > > @@ -0,0 +1,68 @@ > > +# SPDX-License-Identifier: GPL-2.0 > > +%YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/power/reset/syscon-reboot.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: Generic SYSCON mapped register reset driver > > + > > +maintainers: > > + - Sebastian Reichel > > + > > +description: |+ > > + This is a generic reset driver using syscon to map the reset register. > > + The reset is generally performed with a write to the reset register > > + defined by the register map pointed by syscon reference plus the offset > > + with the value and mask defined in the reboot node. > > + Default will be little endian mode, 32 bit access only. > > + > > +properties: > > + compatible: > > + const: syscon-reboot > > + > > + mask: > > + $ref: /schemas/types.yaml#/definitions/uint32 > > + description: Update only the register bits defined by the mask (32 bit). > > + maxItems: 1 > > Drop this as that is already defined for uint32. > > It also doesn't actually work. The $ref has to be under an 'allOf' if > you have additional schemas. A quirk of json-schema... > > > + > > + offset: > > + $ref: /schemas/types.yaml#/definitions/uint32 > > + description: Offset in the register map for the reboot register (in bytes). > > + maxItems: 1 > > + > > + regmap: > > + $ref: /schemas/types.yaml#/definitions/phandle > > + description: Phandle to the register map node. > > + maxItems: 1 > > + > > + value: > > + $ref: /schemas/types.yaml#/definitions/uint32 > > + description: The reset value written to the reboot register (32 bit access). > > + maxItems: 1 > > + > > +required: > > + - compatible > > + - regmap > > + - offset > > + > > +allOf: > > + - if: > > + properties: > > + value: > > + not: > > + type: array > > I think you could make this a bit more readable with: > > if: > not: > required: > - value I do not understand how does it work (value is not mentioned in the required fields so why checking of it?)... but it works fine. > However, if the tree is free of legacy usage, then you could just drop all this. One of them - mask or value - has to be provided. Thanks for review, Kryzsztof