Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1715383ybb; Thu, 9 Apr 2020 07:43:45 -0700 (PDT) X-Google-Smtp-Source: APiQypIvbQaFmF08WI7KRr5lNw/TzPcHfSAkqxlEGZgJ+jfPf/JiVWVX0pajCJ8Q3YOW+TTmxc6j X-Received: by 2002:a37:8b04:: with SMTP id n4mr159906qkd.222.1586443425674; Thu, 09 Apr 2020 07:43:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586443425; cv=none; d=google.com; s=arc-20160816; b=SmYefKYaK63YGtWPg0UjerzsnpqBoqTyl9dgUbI+DuRbPn2dwWdmRJ6av8wljXsaCv O9q90enI6tVizvfvjtS6doP2bXkYghEi6k9APi9KnshlVNasvCnzkI8nkxR63hndqJQw 0UZirSK3Kd6sVRpVjtqtfVegiEev5g5vhZRlJNCYET4GC/MTibW2ecRju1so6oqVush2 p3wi2qFaX5SHc5gIorVCOcnDYxk4pH7NfJL9Z5lIfxDRsA3X523WkE8DfXk6fXF/gE6r 48lj5E/godVpbJ2sMeDwzfNU4PDT8DmxkXXNKtlVzBS5souW9MAVASTgQ0QP+eE+GpTy 8Cgg== 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=f4mXwOzfoQFfmTyPdF7FI/nvZYzgTEkhsp/jnf7l374=; b=oY4pkhQJ9wKJGOIo14bJTJEnNQe11NmQWGtLLixIdbCKnvaKqhFRMaPIK1va77odPE D1yDXw420PjavxCnVWcUR2UqKvynI7KE/VO5tV4+02DxlxUeChZNhNdqS1+rlmFTFWWd aIh57CpZ8tfBH33CnltXnMLgapAbFLiKECu0xxURqnE0Vp6yz2FbMhMCqH/cbp3KMtt2 wejaPC2i+WQwLv7VEeRSW6w6CD3pj6MzUzVKoO1xLa5ZEit90LYJ+IAp4Cp8ZHSUWFy1 64Qx9l+2IUyB0gRx1ps9Ph8P7yIqRN4kfajfoKeyBXuljVYubcOye1XybC0Lar1CX5+4 Ge7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@verdurent-com.20150623.gappssmtp.com header.s=20150623 header.b=BmZ6GULs; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h15si5558663qvx.35.2020.04.09.07.43.29; Thu, 09 Apr 2020 07:43:45 -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=@verdurent-com.20150623.gappssmtp.com header.s=20150623 header.b=BmZ6GULs; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727851AbgDIOmC (ORCPT + 99 others); Thu, 9 Apr 2020 10:42:02 -0400 Received: from mail-vs1-f66.google.com ([209.85.217.66]:34597 "EHLO mail-vs1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727115AbgDIOmC (ORCPT ); Thu, 9 Apr 2020 10:42:02 -0400 Received: by mail-vs1-f66.google.com with SMTP id b5so7055315vsb.1 for ; Thu, 09 Apr 2020 07:42:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=verdurent-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=f4mXwOzfoQFfmTyPdF7FI/nvZYzgTEkhsp/jnf7l374=; b=BmZ6GULsIOlPMSeR4QFP6UMU8xiIGx++xbVXvG4Ec14xhXm9xO54PsRz2mxTHRE/zS hpnnjFBGw3DoPCT4XJ7XPcvn+ZgD5Dgv4qo5ptYViWYP2VA8mdbkSTJBY4YTL2N3HfKg NvMMJbwI124CbsUc49NgD5VNIjOLwitQnU4+iWusAWlVIN9V1lY+wZb1fxfzhVJg7Svf tLTlb0SMJOEU8ESAlUSC4HYXZv0ZCbmYiIxUY8zyGJ4F3r8I0gnyw7/uXQt0DyZIpP3Q oiGGkLLnrmCU41aWoN54rM9dBwhyKbJ7TaN+gyUI1YiyHTQd891cnjftlUVYLlc6ZDy5 DTcA== 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=f4mXwOzfoQFfmTyPdF7FI/nvZYzgTEkhsp/jnf7l374=; b=qzfj4VjBwnCkRacFFnvB+Z5rCLGMsdx50rGQoY1zlra1PJuJOw0wm1gbA0l1H795sB CKq9rxyl8scUu0r0r7ErMU6gg7xFcPuIq0gTGv3x2p0Vtv2fUS8JHMAE41Q8lJXaDgHv 7sKYQ9ZaGvi10DKMM/iI343iTsljzgqsPV50lUOFBL20FdRSJYgv07+t25332K1O5HbW uFrnocAUhV7BEBXjr3yqzLj5uPylHXwYklT6cE0WBS9b8h9ITEMRax6ZSLz/eeJO6EoK uqxhROGHR6raZDXCNfBVQ058bQi5LyUSQcc56HgMlRHpfrSsZjnqcF9mrDV3eXQr5uVn iFHQ== X-Gm-Message-State: AGi0PuZaFCNIhAWNFfzJy1SmVmpvYfs4pDOz1MkmXXNBUJyIaicumzKV dMlKI7H672nx8OaE2HiLFkzuoNdBFStvNUenKw5xqw== X-Received: by 2002:a67:4242:: with SMTP id p63mr243113vsa.159.1586443321181; Thu, 09 Apr 2020 07:42:01 -0700 (PDT) MIME-Version: 1.0 References: <1586407908-27139-1-git-send-email-Anson.Huang@nxp.com> In-Reply-To: From: Amit Kucheria Date: Thu, 9 Apr 2020 20:11:50 +0530 Message-ID: Subject: Re: [PATCH] dt-bindings: thermal: Convert i.MX to json-schema To: Anson Huang Cc: Zhang Rui , Daniel Lezcano , Rob Herring , Shawn Guo , Sascha Hauer , "kernel@pengutronix.de" , Fabio Estevam , Linux PM list , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , lakml , LKML , dl-linux-imx 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 Thu, Apr 9, 2020 at 8:04 PM Anson Huang wrote: > > Hi, Amit > > > Subject: Re: [PATCH] dt-bindings: thermal: Convert i.MX to json-schema > > > > Hi Anson, > > > > On Thu, Apr 9, 2020 at 10:29 AM Anson Huang > > wrote: > > > > > > Convert the i.MX thermal binding to DT schema format using json-schema > > > > > > Signed-off-by: Anson Huang > > > --- > > > .../devicetree/bindings/thermal/imx-thermal.txt | 61 -------------- > > > .../devicetree/bindings/thermal/imx-thermal.yaml | 97 > > ++++++++++++++++++++++ > > > 2 files changed, 97 insertions(+), 61 deletions(-) delete mode > > > 100644 Documentation/devicetree/bindings/thermal/imx-thermal.txt > > > create mode 100644 > > > Documentation/devicetree/bindings/thermal/imx-thermal.yaml > > > > > > diff --git a/Documentation/devicetree/bindings/thermal/imx-thermal.txt > > > b/Documentation/devicetree/bindings/thermal/imx-thermal.txt > > > deleted file mode 100644 > > > index 823e417..0000000 > > > --- a/Documentation/devicetree/bindings/thermal/imx-thermal.txt > > > +++ /dev/null > > > @@ -1,61 +0,0 @@ > > > -* Temperature Monitor (TEMPMON) on Freescale i.MX SoCs > > > - > > > -Required properties: > > > -- compatible : must be one of following: > > > - - "fsl,imx6q-tempmon" for i.MX6Q, > > > - - "fsl,imx6sx-tempmon" for i.MX6SX, > > > - - "fsl,imx7d-tempmon" for i.MX7S/D. > > > -- interrupts : the interrupt output of the controller: > > > - i.MX6Q has one IRQ which will be triggered when temperature is > > > higher than high threshold, > > > - i.MX6SX and i.MX7S/D have two more IRQs than i.MX6Q, one is IRQ_LOW > > > and the other is IRQ_PANIC, > > > - when temperature is below than low threshold, IRQ_LOW will be > > > triggered, when temperature > > > - is higher than panic threshold, system will auto reboot by SRC module. > > > -- fsl,tempmon : phandle pointer to system controller that contains > > > TEMPMON > > > - control registers, e.g. ANATOP on imx6q. > > > -- nvmem-cells: A phandle to the calibration cells provided by ocotp. > > > -- nvmem-cell-names: Should be "calib", "temp_grade". > > > - > > > -Deprecated properties: > > > -- fsl,tempmon-data : phandle pointer to fuse controller that contains > > > TEMPMON > > > - calibration data, e.g. OCOTP on imx6q. The details about > > > calibration data > > > - can be found in SoC Reference Manual. > > > - > > > -Direct access to OCOTP via fsl,tempmon-data is incorrect on some > > > newer chips -because it does not handle OCOTP clock requirements. > > > - > > > -Optional properties: > > > -- clocks : thermal sensor's clock source. > > > - > > > -Example: > > > -ocotp: ocotp@21bc000 { > > > - #address-cells = <1>; > > > - #size-cells = <1>; > > > - compatible = "fsl,imx6sx-ocotp", "syscon"; > > > - reg = <0x021bc000 0x4000>; > > > - clocks = <&clks IMX6SX_CLK_OCOTP>; > > > - > > > - tempmon_calib: calib@38 { > > > - reg = <0x38 4>; > > > - }; > > > - > > > - tempmon_temp_grade: temp-grade@20 { > > > - reg = <0x20 4>; > > > - }; > > > -}; > > > - > > > -tempmon: tempmon { > > > - compatible = "fsl,imx6sx-tempmon", "fsl,imx6q-tempmon"; > > > - interrupts = ; > > > - fsl,tempmon = <&anatop>; > > > - nvmem-cells = <&tempmon_calib>, <&tempmon_temp_grade>; > > > - nvmem-cell-names = "calib", "temp_grade"; > > > - clocks = <&clks IMX6SX_CLK_PLL3_USB_OTG>; > > > -}; > > > - > > > -Legacy method (Deprecated): > > > -tempmon { > > > - compatible = "fsl,imx6q-tempmon"; > > > - fsl,tempmon = <&anatop>; > > > - fsl,tempmon-data = <&ocotp>; > > > - clocks = <&clks 172>; > > > -}; > > > diff --git > > > a/Documentation/devicetree/bindings/thermal/imx-thermal.yaml > > > b/Documentation/devicetree/bindings/thermal/imx-thermal.yaml > > > new file mode 100644 > > > index 0000000..ad12622 > > > --- /dev/null > > > +++ b/Documentation/devicetree/bindings/thermal/imx-thermal.yaml > > > @@ -0,0 +1,97 @@ > > > +# SPDX-License-Identifier: GPL-2.0 > > > +%YAML 1.2 > > > +--- > > > +$id: > > > +https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdevi > > > > > +cetree.org%2Fschemas%2Fthermal%2Fimx-thermal.yaml%23&data=02% > > 7C01 > > > > > +%7Canson.huang%40nxp.com%7C408494436dca450abb5d08d7dc8cc727%7 > > C686ea1d > > > > > +3bc2b4c6fa92cd99c5c301635%7C0%7C1%7C637220369539115517&s > > data=e3R5 > > > +q1YhIRLSOVdLYJWVlbOdqdjxYHNJMcXz%2Bxb1kjc%3D&reserved=0 > > > +$schema: > > > +https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdevi > > > > > +cetree.org%2Fmeta-schemas%2Fcore.yaml%23&data=02%7C01%7Cans > > on.hua > > > > > +ng%40nxp.com%7C408494436dca450abb5d08d7dc8cc727%7C686ea1d3bc > > 2b4c6fa92 > > > > > +cd99c5c301635%7C0%7C1%7C637220369539125508&sdata=VjZ%2FPJ > > BVQc9jpc > > > +H3Hvvc2fYy70B%2Fmun0mxdvSHHktEU%3D&reserved=0 > > > + > > > +title: NXP i.MX Thermal Binding > > > + > > > +maintainers: > > > + - Anson Huang > > > + > > > +properties: > > > + compatible: > > > + oneOf: > > > + - items: > > > + - enum: > > > + - fsl,imx6q-tempmon > > > + - fsl,imx6sx-tempmon > > > + - fsl,imx7d-tempmon > > > + > > > > > + interrupts: > > > + description: | > > > + The interrupt output of the controller, the IRQ will be triggered > > > + when temperature is higher than high threshold. > > > + maxItems: 1 > > > + > > > > imx6sx and imx7d have 3 interrupts each. So you need an if clause to change > > the interrupt number based on what compatible is provided. See > > qcom-tsens.yaml for an example. > > I noticed this, yes, i.MX6SX/7D has 3 interrupts, but the driver actually ONLY uses > the high irq, low and panic irq are NOT used. So for such scenario, binding doc should > still mention all of them? No, just describe what the driver implements. If the driver doesn't implement that other two interrupts, leave it out. I was only comparing it to the old binding where those 3 interrupts are mentioned. Regards, Amit > > > > > + nvmem-cells: > > > + description: | > > > + Phandle to the calibration cells provided by ocotp for calibration > > > + data and temperature grade. > > > + maxItems: 2 > > > + > > > + nvmem-cell-names: > > > + maxItems: 2 > > > + items: > > > + - const: calib > > > + - const: temp_grade > > > + > > > + fsl,tempmon: > > > + description: | > > > + Phandle pointer to system controller that contains TEMPMON > > control > > > + registers, e.g. ANATOP on imx6q. > > > + $ref: '/schemas/types.yaml#/definitions/phandle' > > > > Nit: move $ref line above description. IMO it makes the binding easier to read. > > OK. > > > > > > + > > > + fsl,tempmon-data: > > > + description: | > > > + Deprecated property, phandle pointer to fuse controller that > > contains > > > + TEMPMON calibration data, e.g. OCOTP on imx6q. The details about > > > + calibration data can be found in SoC Reference Manual. > > > + $ref: '/schemas/types.yaml#/definitions/phandle' > > > > Nit: move $ref line above description. IMO it makes the binding easier to read. > > OK. > > > > > > + > > > + clocks: > > > + description: | > > > + Thermal sensor's clock source. > > > + maxItems: 1 > > > + > > > +required: > > > + - compatible > > > + - interrupts > > > + - fsl,tempmon > > > + - clocks > > > > Clocks was an optional property before, are you sure? > > I misunderstand the 'optional', the clock is always necessary, ONLY for those SoCs have > no thermal clock available, then it is unnecessary. Now I see, I will make it as optional. > > I will add example for #thermal-sensor-cells property you mentioned in the other mail. > > Thanks, > Anson > > > > > > + - nvmem-cells > > > + - nvmem-cell-names > > > + > > > +additionalProperties: false > > > + > > > +examples: > > > + - | > > > + #include > > > + #include > > > + > > > + ocotp: ocotp@21bc000 { > > > + #address-cells = <1>; > > > + #size-cells = <1>; > > > + compatible = "fsl,imx6sx-ocotp", "syscon"; > > > + reg = <0x021bc000 0x4000>; > > > + clocks = <&clks IMX6SX_CLK_OCOTP>; > > > + > > > + tempmon_calib: calib@38 { > > > + reg = <0x38 4>; > > > + }; > > > + > > > + tempmon_temp_grade: temp-grade@20 { > > > + reg = <0x20 4>; > > > + }; > > > + }; > > > + > > > + tempmon: tempmon { > > > + compatible = "fsl,imx6sx-tempmon"; > > > + interrupts = ; > > > + fsl,tempmon = <&anatop>; > > > + nvmem-cells = <&tempmon_calib>, <&tempmon_temp_grade>; > > > + nvmem-cell-names = "calib", "temp_grade"; > > > + clocks = <&clks IMX6SX_CLK_PLL3_USB_OTG>; > > > + }; > > > + > > > +... > > > -- > > > 2.7.4 > > >