Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp5960969ybc; Wed, 27 Nov 2019 12:25:51 -0800 (PST) X-Google-Smtp-Source: APXvYqx+UNCZR1pKmUqNzhgaO0MYMpltnK//Dw1VwsehiDw6nejha+qo4mx/H793QEt3mgNJIL5w X-Received: by 2002:a17:906:a457:: with SMTP id cb23mr50800166ejb.191.1574886351447; Wed, 27 Nov 2019 12:25:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574886351; cv=none; d=google.com; s=arc-20160816; b=h8h/CVJUIHfm9B5x+3pzsjGIx1DSQgAC5LgLGgW3HxYDu4QKhlgbJTttbEbtCFwjWf 7u6kizL0PdjE0PpvHsjIGvpnykZXUIkXno/RPWGMsrrc1s8WTxnllYB+ZNs5aH5X7Hd6 v9axahOlHvdQWI09s1y1I9eDy7jwjCA3cPXi4dYFKKB+1NqmHRKXsmV6KqFkY97vKd6O rcoSywxvOWjpympH197l/PA3ExqTjfoDwOnyNpKVbKvOcSIqRSKaIoscl6epArwDZXLf CuR+LCSsqyvyzNMbQy9ubVR4pVYtzXhhu3LfxGfyor8Su49fMa5mCGvYNhuHyzitZkzX 14Eg== 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=MixxgPNvg3pUnry2JzNoXYx2kY3tKkdeMgXAkzkyNYs=; b=cLzAdSIGUJmDvJnkZ0ad6yTRK1d2ngfSQB8KhiroWR0SDglS/wh5jlbd/EWt7T156u hk1v4/4+Y8RGvJ+4FmtTPbv7wo+JcXIYykTzKow6TnffYVRHqCBLFt1R6P+ITQnFQwSI sTJSeT9/SzEaGfU9CrEuS5d03qU8iao75doosbEZGHwgJKPkL7SE20KyqOv+ipgR+94y nfoIMzQ/4WzDJu1NIbv04Zna2CkDKip5bzkY4YjSXuXQZuk4BBZu3f+gem54XfEMUH7T nkPbswCrduFVh9ykLpCKTL0sKIt442bFOt2hheUlRFMQecCAu2msxEvmyi8CR59ZF9Rx nzyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Q8xCo+Zb; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o22si10551965ejr.78.2019.11.27.12.25.26; Wed, 27 Nov 2019 12:25:51 -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=@gmail.com header.s=20161025 header.b=Q8xCo+Zb; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727156AbfK0UYV (ORCPT + 99 others); Wed, 27 Nov 2019 15:24:21 -0500 Received: from mail-ot1-f67.google.com ([209.85.210.67]:43695 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726703AbfK0UYU (ORCPT ); Wed, 27 Nov 2019 15:24:20 -0500 Received: by mail-ot1-f67.google.com with SMTP id l14so20227061oti.10; Wed, 27 Nov 2019 12:24:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MixxgPNvg3pUnry2JzNoXYx2kY3tKkdeMgXAkzkyNYs=; b=Q8xCo+ZbqsfjOgoXWTnHWNvKIjvPEEcwP+yXEBzmj2ekJJlDCBa94VFtCAGp2f+bzq elQN5VZ0Q6MrI3M85kFAM7EcRpIT6dOyhTlaodtLBSugf0KJru8davD/6imekZuJmkNx PKcyk5pw+9Yw45suj7kCI5epoouGLLTi0kYP0fey25mulV3BNtcIR6WKxFwJiFpSvh39 r+fZZtaHTh8Vqg56FBTN6g91jdzGaHCpToEq7ANGcvTUaONmosJTjEnzZ0amMb7T/Dfh 2sMqDroQQ4rqoAnUrp4pRzTkVcUnPo3MZ6ZYkFQ/jv9nMvj+GO/NOi53qfubSe832egJ s8hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MixxgPNvg3pUnry2JzNoXYx2kY3tKkdeMgXAkzkyNYs=; b=a0VItJa3X0pfxxUXygSTuVIzLf+Jj1Ay9e7FNkFGehThv21Ac1QcAL0TgBFNrMKmav 76BK+Ug/xqscFobx0z5J4N8o0c1Qp64bMbAFjtfbCUBsbGSO47Nsg/f/xNGPRyxgpiVC LdKTDGXfnB8+OiMsUtO2OQkSKNtSOOklxfWoE5MCVCH2v6Ju2EbZRTVqPWJHSo0qhhoV 9ibM5I5NzvPvQ8stHX2KVQ5S336wB5gi3kXR1dBQcXOOWKTluRLcTtA/uY8kA5b3cB3A IUZChD2dcYWYyJxnxE9FFuJPQwYELakbrdDle8kTr5JQ1aMHMtYhrln5MdxemGLT8SJX U25g== X-Gm-Message-State: APjAAAWFvwoHQdx1EOs+H00bN/xGUtlX3cTzNYxPbu3gyAI6BxPN4N/R Cy9gWWNYkmuTbICHGNGpWpdzpMH8htGFV8DmPpw= X-Received: by 2002:a9d:6acf:: with SMTP id m15mr5155723otq.312.1574886258682; Wed, 27 Nov 2019 12:24:18 -0800 (PST) MIME-Version: 1.0 References: <20191127052935.1719897-1-anarsoul@gmail.com> <20191127052935.1719897-3-anarsoul@gmail.com> <20191127174434.wousbqosmm5vxcsu@gilmour.lan> In-Reply-To: <20191127174434.wousbqosmm5vxcsu@gilmour.lan> From: Vasily Khoruzhick Date: Wed, 27 Nov 2019 12:23:53 -0800 Message-ID: Subject: Re: [PATCH v6 2/7] dt-bindings: thermal: add YAML schema for sun8i-thermal driver bindings To: Maxime Ripard 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 , devicetree , arm-linux , =?UTF-8?Q?Ond=C5=99ej_Jirman?= , linux-kernel 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 Wed, Nov 27, 2019 at 9:44 AM Maxime Ripard wrote: > > 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 OK, will do > > + > > + '#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. Will do. > > + > > + 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 Will do. > > + > > + nvmem-cell-names: > > + items: > > + - const: calibration > > Ditto for the const Sorry, I don't quite get it. What exactly do you want me to do with this one? nvmem-cell-names must be "calibration" > > + > > +required: > > + - compatible > > + - reg > > + - interrupts > > + - '#thermal-sensor-cells' > > Whether clocks, clock-names and resets are thereshould be check using > an if statement as well. Will do > > + > > +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. OK > > + 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. OK > > Thanks! > Maxime