Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp2475565ybj; Mon, 23 Sep 2019 04:36:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqxnWHarngDnWZGYUzGLo6sC5Mfk+Gy2p9hQ6EGTrmV9NbqnFkH3UiG0ex//1PsAki6BaISf X-Received: by 2002:a17:906:154c:: with SMTP id c12mr16690838ejd.129.1569238572197; Mon, 23 Sep 2019 04:36:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569238572; cv=none; d=google.com; s=arc-20160816; b=T9Fe9M6Lb+L6mgLSZ3zSZSbPb/4s7NdoRrne8jRMFY50f0MCOCJw50EOP/WgO0esqc dyYWySXaiOBfZKsc4+VX5LHxupMuKimGcKOi8pznJnYj4LmdLPpDR2yHDlHl2ZuxLN0y nq7V8WEZG89CIinJtrT25t5uKj3U87B2KvnCJ+ztIOOv7lngMn5VQxun/oD9wKhJFLje ulor87Gp6NACxpHvsA+y6RmeMFXqwuXHpQK4g3opOKZ7VI0DwElO5LLHQkLv75bIlMLc E3LS0nd/jMU1pJcvC2jyoXHvdgU5L1/oUQK1ytrOpEYc7vhDpK7Lly9UTRqmepLASG+c MxWQ== 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=DsLE449MYN0lijunGmoaJH+J0lh52Nq00qDntzefXoo=; b=JwhjR49wIGMtOstdKmbuGgjHmlIGMlNURNcH5DdM1COm/As1nQQKP542BGY33+kgHu rT4EWYah/KT5HwwGMT3cOjN6w1mb+TVmNs/3CBk42CZ7W63zv+7LFOcEbj0bYTCCOYPh iM+/Qsxx4+4ypQ5i7fhbtT+8YN6b7XkbizhQzaMKTRAunqsh1Mx8fTWWIBirXeVt3GqQ tDmqsdMPVyJS5yrUn5L6z5fvkLSGLh/IENlBHnrzE4t95IyS9jX7ddWyLJS8AMsaCf8x 7cA3CiZfncv+BSKXvE0ANcdNKPykN8+EZ1t4BNWul96B/fYw3umQ1/BZY1eGD2z6eBzc BAlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Y41UWNhX; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l23si6350588edr.187.2019.09.23.04.35.48; Mon, 23 Sep 2019 04:36:12 -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=@linaro.org header.s=google header.b=Y41UWNhX; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393368AbfITVnK (ORCPT + 99 others); Fri, 20 Sep 2019 17:43:10 -0400 Received: from mail-vs1-f68.google.com ([209.85.217.68]:33976 "EHLO mail-vs1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392624AbfITVnK (ORCPT ); Fri, 20 Sep 2019 17:43:10 -0400 Received: by mail-vs1-f68.google.com with SMTP id d3so5695947vsr.1 for ; Fri, 20 Sep 2019 14:43:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DsLE449MYN0lijunGmoaJH+J0lh52Nq00qDntzefXoo=; b=Y41UWNhXfoaLvFvHT2mK5PnQUDu2rsLdZVpGTzNyuAkQMu8tbTrR/zLCcF2rY4aTZ6 lfszb21KlSm+f2/ZQ2WXSn4tmBCbqbPo5kf1qEnnT9gmxwoD6WodV6ekHlj96UWiacrp QpugkSZICRkCQLCUiQ8BP6ekjlj0AwYL0agn5KeiOA9Sf0/VH0SEHoZb/21l1Eqt5pub cJ43PMl4W4FFT+vJAJoO17u9IuNKgx6aK1PZW8jBhWEtXMnzyW2Q68TfpS4BW2BmGFrz BJWz3H0Z7zaAtUvsUf7dwPr3Qvjyxlvt+OYmKzb7Qb1aCzpyDMrW66M2LKk4wZAOWMQ4 3Aug== 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=DsLE449MYN0lijunGmoaJH+J0lh52Nq00qDntzefXoo=; b=DTUh3wv7AJXcGqKRTrskuUY0fwoUf/zMtgoliTeMkPWSnTQRtal7pQfuikOGy+xecg GpTioVQ7H6kY/hGJ557ls/wA2jPhauOmioE4OXL6NXYQ89ddadYnLPqkGBcrxG5lP1pr Ji3jsYAdm3hZ+dubOaEhcbFP2Qv1XF0CY3i/ARxfflJWPLAeRxcQpyRvM2dQW4Ddlpsv op/zkITl19Y0wpzcwvP0j42rgNas8N5lsB9rXJgAhcbf+bYOpsQEmrCQ72aD1iWdQGI3 IBl1XjiFuTagDHgu+Cz9Vptd/f/4Jr5UHICnUv5FfI0JvDj3xKlrNbxS5Ql5NTb/41X5 ErIA== X-Gm-Message-State: APjAAAUD7tjLLGV3Wmy/jeXMkwQeYoQyDcIx9f9Wu1mnwdnRecFgxjbw K6EqOPwKArm26oZgPbEi44lS4DLhIA0z2txsJOFttQ== X-Received: by 2002:a67:6044:: with SMTP id u65mr3810616vsb.95.1569015788245; Fri, 20 Sep 2019 14:43:08 -0700 (PDT) MIME-Version: 1.0 References: <933f033298cbd7726a6c0b4b3b6cc7adc81784ba.1568185732.git.amit.kucheria@linaro.org> <20190917190619.GA9311@bogus> In-Reply-To: <20190917190619.GA9311@bogus> From: Amit Kucheria Date: Fri, 20 Sep 2019 14:42:57 -0700 Message-ID: Subject: Re: [PATCH v3 07/15] dt-bindings: thermal: tsens: Convert over to a yaml schema To: Rob Herring Cc: LKML , linux-arm-msm , Bjorn Andersson , Eduardo Valentin , Andy Gross , Brian Masney , Stephen Boyd , Daniel Lezcano , Mark Rutland , Zhang Rui , Linux PM list , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" 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 Tue, Sep 17, 2019 at 12:06 PM Rob Herring wrote: > > On Wed, Sep 11, 2019 at 12:46:24PM +0530, Amit Kucheria wrote: > > Document interrupt support in the tsens driver by converting over to a > > YAML schema. > > > > Suggested-by: Stephen Boyd > > Signed-off-by: Amit Kucheria > > --- > > .../bindings/thermal/qcom-tsens.txt | 55 ------ > > .../bindings/thermal/qcom-tsens.yaml | 174 ++++++++++++++++++ > > MAINTAINERS | 1 + > > 3 files changed, 175 insertions(+), 55 deletions(-) > > delete mode 100644 Documentation/devicetree/bindings/thermal/qcom-tsens.txt > > create mode 100644 Documentation/devicetree/bindings/thermal/qcom-tsens.yaml > > > > diff --git a/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml b/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml > > new file mode 100644 > > index 000000000000..6784766fe58f > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml > > @@ -0,0 +1,174 @@ > > +# SPDX-License-Identifier: (GPL-2.0 OR MIT) > > +# Copyright 2019 Linaro Ltd. > > +%YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/thermal/qcom-tsens.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: QCOM SoC Temperature Sensor (TSENS) > > + > > +maintainers: > > + - Amit Kucheria > > + > > +description: | > > + QCOM SoCs have TSENS IP to allow temperature measurement. There are currently > > + three distinct major versions of the IP that is supported by a single driver. > > + The IP versions are named v0.1, v1 and v2 in the driver, where v0.1 captures > > + everything before v1 when there was no versioning information. > > + > > +properties: > > + compatible: > > + oneOf: > > + - description: v0.1 of TSENS > > + items: > > + - enum: > > + - qcom,msm8916-tsens > > + - qcom,msm8974-tsens > > + - const: qcom,tsens-v0_1 > > + > > + - description: v1 of TSENS > > + items: > > + - enum: > > + - qcom,qcs404-tsens > > + - const: qcom,tsens-v1 > > + > > + - description: v2 of TSENS > > + items: > > + - enum: > > + - qcom,msm8996-tsens > > + - qcom,msm8998-tsens > > + - qcom,sdm845-tsens > > + - const: qcom,tsens-v2 > > + > > + reg: > > + maxItems: 2 > > + items: > > + - description: TM registers > > + - description: SROT registers > > + > > + nvmem-cells: > > + minItems: 1 > > + maxItems: 2 > > + description: > > + Reference to an nvmem node for the calibration data > > + > > + nvmem-cells-names: > > This is going to require 2 items, so you need an explicit minItems and > maxItems. Will fix. > > + items: > > + - enum: > > + - caldata > > + - calsel > > + > > + "#qcom,sensors": > > + allOf: > > + - $ref: /schemas/types.yaml#/definitions/uint32 > > + - minimum: 1 > > + - maximum: 16 > > + description: > > + Number of sensors enabled on this platform > > + > > + "#thermal-sensor-cells": > > + const: 1 > > + description: > > + Number of cells required to uniquely identify the thermal sensors. Since > > + we have multiple sensors this is set to 1 > > + > > +allOf: > > + - if: > > + properties: > > + compatible: > > + contains: > > + enum: > > + - qcom,msm8916-tsens > > + - qcom,msm8974-tsens > > + - qcom,qcs404-tsens > > + - qcom,tsens-v0_1 > > + - qcom,tsens-v1 > > + then: > > + properties: > > + interrupts: > > > + minItems: 1 > > + maxItems: 1 > > These can be implicit. Will remove all of these. > > + items: > > + - description: Combined interrupt if upper or lower threshold crossed > > + interrupt-names: > > + minItems: 1 > > + maxItems: 1 > > ditto. > > > + items: > > + - const: uplow > > + > > + else: > > + properties: > > + interrupts: > > + minItems: 2 > > + maxItems: 2 > > ditto. > > > + items: > > + - description: Combined interrupt if upper or lower threshold crossed > > + - description: Interrupt if critical threshold crossed > > + interrupt-names: > > + minItems: 2 > > + maxItems: 2 > > ditto. > > > + items: > > + - const: uplow > > + - const: critical > > + > > +required: > > + - compatible > > + - reg > > + - "#qcom,sensors" > > + - interrupts > > + - interrupt-names > > + - "#thermal-sensor-cells" > > + > > +examples: > > + - | > > + #include > > + // Example 1 (legacy: for pre v1 IP): > > + tsens1: thermal-sensor@900000 { > > + compatible = "qcom,msm8916-tsens", "qcom,tsens-v0_1"; > > + reg = <0x4a9000 0x1000>, /* TM */ > > + <0x4a8000 0x1000>; /* SROT */ > > + > > + nvmem-cells = <&tsens_caldata>, <&tsens_calsel>; > > + nvmem-cell-names = "caldata", "calsel"; > > + > > + interrupts = ; > > + interrupt-names = "uplow"; > > + > > + #qcom,sensors = <5>; > > + #thermal-sensor-cells = <1>; > > + }; > > + > > + - | > > + #include > > + // Example 2 (for any platform containing v1 of the TSENS IP): > > + tsens2: thermal-sensor@4a9000 { > > + compatible = "qcom,qcs404-tsens", "qcom,tsens-v1"; > > + reg = <0x004a9000 0x1000>, /* TM */ > > + <0x004a8000 0x1000>; /* SROT */ > > + > > + nvmem-cells = <&tsens_caldata>; > > + nvmem-cell-names = "calib"; > > + > > + interrupts = ; > > + interrupt-names = "uplow"; > > + > > + #qcom,sensors = <10>; > > + #thermal-sensor-cells = <1>; > > + }; > > + > > + - | > > + #include > > + // Example 3 (for any platform containing v2 of the TSENS IP): > > + tsens3: thermal-sensor@c263000 { > > + compatible = "qcom,sdm845-tsens", "qcom,tsens-v2"; > > + reg = <0xc263000 0x1ff>, > > + <0xc222000 0x1ff>; > > + > > + interrupts = , > > + ; > > + interrupt-names = "uplow", "critical"; > > + > > + #qcom,sensors = <13>; > > + #thermal-sensor-cells = <1>; > > + }; > > +... > > diff --git a/MAINTAINERS b/MAINTAINERS > > index e7a47b5210fd..ff757a4a060c 100644 > > --- a/MAINTAINERS > > +++ b/MAINTAINERS > > @@ -13360,6 +13360,7 @@ L: linux-pm@vger.kernel.org > > L: linux-arm-msm@vger.kernel.org > > S: Maintained > > F: drivers/thermal/qcom/ > > +F: Documentation/devicetree/bindings/thermal/qcom-tsens.yaml > > > > QUALCOMM VENUS VIDEO ACCELERATOR DRIVER > > M: Stanimir Varbanov > > -- > > 2.17.1 > >