Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp5810522ybc; Wed, 27 Nov 2019 09:46:18 -0800 (PST) X-Google-Smtp-Source: APXvYqxKTY5j+Qq2P+P828HwvvG+Svt7yFJ5lt3xNSVys3ErYuK7kYT9zQTAyqwwxy0sfgZLfo5f X-Received: by 2002:aa7:d9c6:: with SMTP id v6mr1430351eds.107.1574876778679; Wed, 27 Nov 2019 09:46:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574876778; cv=none; d=google.com; s=arc-20160816; b=VZfl5B0vsM4CEY3U+cuZ1SwvoYcsePQmLgeuXSNJFiHC2k4jkXY2bKzsWPC+QhC4i+ lKIiCmiNNieVo+x/VNO3geBAJlxTNLUj2A9e2D2t/8+qum+VxMDTaP1nhdb5dLQMwskq FF9WZUvTeO5yIhOZEHOL3TS6riCtTl3JpUxYzS+EEJ/Oajf1Gp/lpxHYC0p+onXzn6E/ jGsgciG0+s/Ua2NbW5pzYsyrSCa/u2NiAbl5PR1dS0kl4IuCJk9xHwmBtq6cOavZPMsW PD6b4jVZQyb/GCh7W3tQgocCN28LCyDGGBEvfjqIR2gZZ1RVhU6JKJMgr58TdrIstCrX VJ+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=Vml6ZKXKYJjpLfS0zOpWsrbtllo46xqE4boG5shzZcs=; b=pzw/rBmH9Y/yxZCy8ivWlqjaVSrBMEHCd6GAO4bw282RMtM2Czm3SkvNGvZs3Fglnp 3mi+n7RMz1UEkgtbHP2Di+qse668g5jUbFnS0gnwLoNoAoOsI4H5AEsRrJcmGTYXFYdM wnMIT29vHdt8y+FEayHuMkgj701oEowhdm4bh7nfA32XdsGh16zjVgaN4dkCUomL0vQ+ oiCGxQvdUEwgEbXQ3CKtFvXS/xJb4/hQf+8I2hJjWLgPEeq6i52ozkyboZXCyFZknRPG 35Hp18pXSGDB/NVE87fNf3Cd0WoaVLjCHtqCR3XstvFI5PyOSgxfDaXRrd+Srb5VG833 5Ygw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NVvBMB3w; 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 ce20si9801077ejb.183.2019.11.27.09.45.55; Wed, 27 Nov 2019 09:46:18 -0800 (PST) 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=NVvBMB3w; 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 S1727031AbfK0Roh (ORCPT + 99 others); Wed, 27 Nov 2019 12:44:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:34304 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726947AbfK0Roh (ORCPT ); Wed, 27 Nov 2019 12:44:37 -0500 Received: from localhost (lfbn-1-10718-76.w90-89.abo.wanadoo.fr [90.89.68.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2ECAE2071E; Wed, 27 Nov 2019 17:44:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574876676; bh=0mnbkXpRIAs1oWs7887fZ1hqjmi1n2cupNv6F6qcqnM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NVvBMB3wRKTxMbLvW7a7orEuxSa5qmKwIzhQPwJEA1hcD6wtHcM+iBbi2g12emuJU uB3XB7t7NFQXZT8q4MH4UiBt1ALildwE7zg/wS2PR1F0vre2NXqdxkNdu7oayb0qlF 3D9AdyA4pjS85SjD7oeKkaiCzB5oYB9gDNB4U4zo= Date: Wed, 27 Nov 2019 18:44:34 +0100 From: Maxime Ripard To: Vasily Khoruzhick Cc: Yangtao Li , Zhang Rui , Eduardo Valentin , Daniel Lezcano , Amit Kucheria , Rob Herring , Mark Rutland , Chen-Yu Tsai , Mauro Carvalho Chehab , "David S. Miller" , Greg Kroah-Hartman , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, =?utf-8?Q?Ond=C5=99ej?= Jirman , linux-kernel@vger.kernel.org Subject: Re: [PATCH v6 2/7] dt-bindings: thermal: add YAML schema for sun8i-thermal driver bindings Message-ID: <20191127174434.wousbqosmm5vxcsu@gilmour.lan> References: <20191127052935.1719897-1-anarsoul@gmail.com> <20191127052935.1719897-3-anarsoul@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="vy5yg3fxo523fkw5" Content-Disposition: inline In-Reply-To: <20191127052935.1719897-3-anarsoul@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --vy5yg3fxo523fkw5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, On Tue, Nov 26, 2019 at 09:29:30PM -0800, Vasily Khoruzhick wrote: > From: Yangtao Li > > sun8i-thermal driver supports thermal sensor in wide range of Allwinner > SoCs. Add YAML schema for its bindings. > > Signed-off-by: Yangtao Li > Signed-off-by: Vasily Khoruzhick > --- > .../thermal/allwinner,sun8i-a83t-ths.yaml | 103 ++++++++++++++++++ > 1 file changed, 103 insertions(+) > create mode 100644 Documentation/devicetree/bindings/thermal/allwinner,sun8i-a83t-ths.yaml > > diff --git a/Documentation/devicetree/bindings/thermal/allwinner,sun8i-a83t-ths.yaml b/Documentation/devicetree/bindings/thermal/allwinner,sun8i-a83t-ths.yaml > new file mode 100644 > index 000000000000..e622f0a4be90 > --- /dev/null > +++ b/Documentation/devicetree/bindings/thermal/allwinner,sun8i-a83t-ths.yaml > @@ -0,0 +1,103 @@ > +# SPDX-License-Identifier: GPL-2.0 > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/thermal/allwinner,sun8i-a83t-ths.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Allwinner SUN8I Thermal Controller Device Tree Bindings > + > +maintainers: > + - Yangtao Li > + > +properties: > + compatible: > + oneOf: > + - const: allwinner,sun8i-a83t-ths > + - const: allwinner,sun8i-h3-ths > + - const: allwinner,sun8i-r40-ths > + - const: allwinner,sun50i-a64-ths > + - const: allwinner,sun50i-h5-ths > + - const: allwinner,sun50i-h6-ths > + > + reg: > + maxItems: 1 > + > + interrupts: > + maxItems: 1 > + > + resets: > + maxItems: 1 > + > + clocks: > + minItems: 1 > + maxItems: 2 > + > + clock-names: > + anyOf: > + - items: > + - const: bus > + - const: mod > + - items: > + - const: bus This can be: clock-names: minItems: 1 maxItems: 2 items: - const: bus - const: mod And the length should be checked based on the compatible value, with something like if: properties: compatible: contains: const: allwinner,sun50i-h6-ths then: properties: clocks: maxItems: 1 clock-names: maxItems: 1 else: properties: clocks: maxItems: 2 clock-names: maxItems: 2 > + > + '#thermal-sensor-cells': > + enum: [ 0, 1 ] > + description: | > + Definition depends on soc version: > + > + For "allwinner,sun8i-h3-ths", > + value must be 0. > + For all other compatibles > + value must be 1. This should be checked using an if as well. > + > + nvmem-cells: > + maxItems: 1 > + items: > + - description: Calibration data for thermal sensors You can drop the items and just move the description up one level, under nvmem-cells > + > + nvmem-cell-names: > + items: > + - const: calibration Ditto for the const > + > +required: > + - compatible > + - reg > + - interrupts > + - '#thermal-sensor-cells' Whether clocks, clock-names and resets are thereshould be check using an if statement as well. > + > +examples: > + - | > + ths_a83t: ths@1f04000 { You don't need the label at all, and the node name should be temperature-sensor according to the DT spec, not ths. This applies to all you examples. > + compatible = "allwinner,sun8i-a83t-ths"; > + reg = <0x01f04000 0x100>; > + interrupts = <0 31 0>; > + nvmem-cells = <&ths_calibration>; > + nvmem-cell-names = "calibration"; > + #thermal-sensor-cells = <1>; > + }; New line. Thanks! Maxime --vy5yg3fxo523fkw5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCXd62AgAKCRDj7w1vZxhR xZhDAP92TopSGYK0i/lNbBksUI+7RNfvt+FhK2eVaXRB2/XToAD/S4RzDGUA4BXe Cx5DhAlOJY+WchG8X6c4StMtLQAUwAM= =6CMd -----END PGP SIGNATURE----- --vy5yg3fxo523fkw5--