From patchwork Fri Jun 19 15:15:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 1313032 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=glider.be Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 49pMnl2LvNzB3vX for ; Sat, 20 Jun 2020 01:15:55 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392435AbgFSPPw (ORCPT ); Fri, 19 Jun 2020 11:15:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404049AbgFSPPr (ORCPT ); Fri, 19 Jun 2020 11:15:47 -0400 Received: from albert.telenet-ops.be (albert.telenet-ops.be [IPv6:2a02:1800:110:4::f00:1a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 376B4C0613F0 for ; Fri, 19 Jun 2020 08:15:45 -0700 (PDT) Received: from ramsan ([IPv6:2a02:1810:ac12:ed20:38b1:3718:f116:dc69]) by albert.telenet-ops.be with bizsmtp id t3Fj2200C1b8psi063FjHk; Fri, 19 Jun 2020 17:15:44 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1jmIk3-0005jD-Dj; Fri, 19 Jun 2020 17:15:43 +0200 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1jmIk3-0003vm-Bv; Fri, 19 Jun 2020 17:15:43 +0200 From: Geert Uytterhoeven To: Zhang Rui , Daniel Lezcano , Amit Kucheria , Rob Herring , =?utf-8?q?Niklas_S=C3=B6derlund?= Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] dt-bindings: thermal: rcar-thermal: Improve schema validation Date: Fri, 19 Jun 2020 17:15:41 +0200 Message-Id: <20200619151541.15069-1-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org - Document missing "#thermal-sensor-cells", - Factor out common required properties, - "interrupts", "clocks", and "power-domains" are required on R-Mobile APE6, too, - Invert logic to simplify descriptions, - Add "additionalProperties: false". Signed-off-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund Reviewed-by: Amit Kucheria Reviewed-by: Rob Herring --- .../bindings/thermal/rcar-thermal.yaml | 53 ++++++++++++------- 1 file changed, 34 insertions(+), 19 deletions(-) diff --git a/Documentation/devicetree/bindings/thermal/rcar-thermal.yaml b/Documentation/devicetree/bindings/thermal/rcar-thermal.yaml index 0994693d240f9ff4..88787b98992fe7c9 100644 --- a/Documentation/devicetree/bindings/thermal/rcar-thermal.yaml +++ b/Documentation/devicetree/bindings/thermal/rcar-thermal.yaml @@ -59,25 +59,40 @@ properties: resets: maxItems: 1 -if: - properties: - compatible: - contains: - enum: - - renesas,thermal-r8a73a4 # R-Mobile APE6 - - renesas,thermal-r8a7779 # R-Car H1 -then: - required: - - compatible - - reg -else: - required: - - compatible - - reg - - interrupts - - clocks - - power-domains - - resets + '#thermal-sensor-cells': + const: 0 + +required: + - compatible + - reg + +allOf: + - if: + not: + properties: + compatible: + contains: + enum: + - renesas,thermal-r8a73a4 # R-Mobile APE6 + - renesas,thermal-r8a7779 # R-Car H1 + then: + required: + - resets + - '#thermal-sensor-cells' + + - if: + not: + properties: + compatible: + contains: + const: renesas,thermal-r8a7779 # R-Car H1 + then: + required: + - interrupts + - clocks + - power-domains + +additionalProperties: false examples: # Example (non interrupt support)