From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC1DDC2BBC7 for ; Thu, 9 Apr 2020 13:49:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8A6E42083E for ; Thu, 9 Apr 2020 13:49:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=verdurent-com.20150623.gappssmtp.com header.i=@verdurent-com.20150623.gappssmtp.com header.b="amKfqnd8" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726926AbgDINtJ (ORCPT ); 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-Google-Smtp-Source: APiQypJeghsuGIyn0WvqoYX5wxkTIWjxtH/G1Qe+Ftm6KAYOlTTo2AJGBIWDmRQ2iRf8Hp4GTBdezU70qfNWPExhJhA= 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 >