Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1821488ybb; Thu, 9 Apr 2020 09:37:16 -0700 (PDT) X-Google-Smtp-Source: APiQypL7seUI41dVHDEXDnH910aiILZRtXhweG2BsXqnilahJuaRJF7UVRBJJjCvAPAwYMIZZ5Sy X-Received: by 2002:ac8:6043:: with SMTP id k3mr159141qtm.99.1586450235994; Thu, 09 Apr 2020 09:37:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586450235; cv=none; d=google.com; s=arc-20160816; b=wtU7nEPxcVFwDWHD84zll8//vClq2vSYQokpfg9OHCODryB/Vlvv7O//5uPsQZrDwt naNjim20mfb9FLe+3Bn/0XF6ZjCqkIBAyoCu31WJ+e63dXwPz2/BhjMAHKOOIxFnET+P D5HfGT1+eAqMcCO3EKGo4N0KzRHRwpPvNbmHf0PvVdMjtNbQ+QBlo4bm0/LpWod0AT8C qAy2KhXbqa2+MB1E94ogjNotkJ1sKLF3QEGDClvmiyLu0TW8Z3KNwP4T4Jk0TT6VPn3K vcpV0/VFT04dXbzyu2uH7PmwUkJbVzfLKmdnrmUq7rBodzGkRZypuAW8r6T6UvuR/d7L nHKg== 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=5dJ2iz6mYeufR/3a819TAwvmat0FG6WlCPrzsZs/LR0=; b=SdD4Ap5vNKkk1rO9jvtZn3Gz7VxVLCfJLw9ryN/eulbsaCqYd7U0d4+7ZJ3h9QEYr1 7E40qL8oR16p8pqzeXF5RwHW3CO7H/XNO6E/gdcOHw4vo+RkE5ZLxZyINKjYWyo0AyXS AypmhP8Tti0fR/RUsU53J+nXMyoL/sWWufvnR5JYR7hujE6vGrdco49zMBUuvD2uBoQF 6Qg9UPKspclfoYI8RuR1/6GiHsEgwWcuXchRPQHZR2N3MF/EddZtO58wU5Z1PKOtTUGo 5ihTAxeWm7vcy8G34JuYyh8KEzwdogdztyD1DjVsdXYcKBo9ZuyYV5WwdeWBtnXMu+7Q 5ZBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@verdurent-com.20150623.gappssmtp.com header.s=20150623 header.b=amKfqnd8; 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 y18si5573032qtn.299.2020.04.09.09.37.00; Thu, 09 Apr 2020 09:37:15 -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=amKfqnd8; 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 S1726909AbgDINtJ (ORCPT + 99 others); Thu, 9 Apr 2020 09:49:09 -0400 Received: from mail-ua1-f68.google.com ([209.85.222.68]:36649 "EHLO mail-ua1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726582AbgDINtI (ORCPT ); Thu, 9 Apr 2020 09:49:08 -0400 Received: by mail-ua1-f68.google.com with SMTP id m15so3943067uao.3 for ; Thu, 09 Apr 2020 06:49:07 -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=5dJ2iz6mYeufR/3a819TAwvmat0FG6WlCPrzsZs/LR0=; b=amKfqnd8WQyQUAwi4cZoNrTICQeFaNVJPH28XmKBDQXacysYodktIyiN2ndQx+TQcv bE1YQidGEZu1EqGjm0MH4mmpq5nA+42ldSSrTL99PS28PvRiy5Hu36Cw1+BHd0Q73auH i7MxRDbVc1bfVrS2iATOcjNUHRMwaGOf7ARFElgadRaI+Se1QV8mAOs2BNZiqLtpCn8c oTRo6ATdFF9BsWVB81GBQe4ny1no9JSpdhqD2Z9AjhLDI+EVj/kkJjI4KioULc4bTIrU 53JZXLEI3Y9kZK43il6Z+a7GkDur/yKP+teUqIU/+86Cx0fcoAj2NCUItb1asfK4YGnz WjZw== 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=5dJ2iz6mYeufR/3a819TAwvmat0FG6WlCPrzsZs/LR0=; b=QHCiCO2/cRTIyUAj+XoI2GaGc776BUnoV8ay94PgO8LXanbA3tzE6wsS1AYhRiIXhx +wueHzEvd39iF2vjylfg+G/ITTGO/k5Uel+6+tGRPGLfjfgN1G099bzLGBtbhLAlfQED ytcf5+VZmdfczrwJ1EQ+jbe51rC2c/jQJqvAaANZj52RZGIQi7FWrBOrNXM6dZuFMgUh 0UcxyF+NANOnFdKa3vsORqSy3LsIHQ4971LyYjRcXW0CfMtpUKbUmJB7dFfj1H7NELKd p1VPiJ3xEIUutPiKZqdMa0oqb5KLBsXE11woTNG312lu93+swg3JxW9j9DN/8hGNT9Dt GyGw== X-Gm-Message-State: AGi0Pua72HpfLZR5eZjXUkemXMAjz1mn2LmS4Z5z3vWO9v5k2yDUFlQe CT0suW2TQZx12NNBho4bmLX5zayMF1FTvJ0Jhr/7WQ== X-Received: by 2002:ab0:654c:: with SMTP id x12mr9506156uap.48.1586440147159; Thu, 09 Apr 2020 06:49:07 -0700 (PDT) MIME-Version: 1.0 References: <1586407908-27139-1-git-send-email-Anson.Huang@nxp.com> In-Reply-To: <1586407908-27139-1-git-send-email-Anson.Huang@nxp.com> From: Amit Kucheria Date: Thu, 9 Apr 2020 19:18:56 +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 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: http://devicetree.org/schemas/thermal/imx-thermal.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +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. > + 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. > + > + 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. > + > + clocks: > + description: | > + Thermal sensor's clock source. > + maxItems: 1 > + > +required: > + - compatible > + - interrupts > + - fsl,tempmon > + - clocks Clocks was an optional property before, are you sure? > + - 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 >