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=-11.4 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 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 9F03DC47420 for ; Wed, 23 Sep 2020 09:07:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 487F32376F for ; Wed, 23 Sep 2020 09:07:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="kAJE3GOD" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726424AbgIWJH2 (ORCPT ); Wed, 23 Sep 2020 05:07:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726178AbgIWJH1 (ORCPT ); Wed, 23 Sep 2020 05:07:27 -0400 Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93925C0613D3 for ; Wed, 23 Sep 2020 02:07:27 -0700 (PDT) Received: by mail-lj1-x242.google.com with SMTP id u4so16568690ljd.10 for ; Wed, 23 Sep 2020 02:07:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=oxfqN+/oFq6f8zrQC/M5ig8ijRiZLXyefj4fwEV8+DY=; b=kAJE3GOD2vJpQ7aXFpD7xZpacWnJ+tWlt4k6eb4f5ao88/RQvx9wqvk/ebR6ZqhTTn 5Py6T+kevtOj+S8vA4PTA5eygM0sOHC1/FP9KdZVwlu0Oq3/44qodvghr+43QoHnh8x8 5CeWVD2IjSUHbIHbrAQ7kGd2QIrb8U079ygRjFkfN/Ywk/8Jrge8p9BXYzrluAY8UJ2n nvM7Hpy0u4TFvdCA452stR9Ka/o059qUfVnVUvuyJ/7rNkwXW6Yvm09W9hWHlSib5sse 6fm/Y3mqsAQ/qtmkhTdlqildrALk8/aejkg8NeldoKzmgWO0UY41ZxhVXRjCrwHJdb12 YIRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=oxfqN+/oFq6f8zrQC/M5ig8ijRiZLXyefj4fwEV8+DY=; b=k3i8YaQ0HkwzrIQLpM4R0vvlHxchcjrh+0sfEQufpADao/A39D6bQNwsGzy66YieqT C/JXHkS1MfPpivNiS2vtBxPfeVwFaPt3snuMZsPfqmg5LYgMc9ywxSTVH5tErn4OmELN uYLOO14vafXJz+C5o1OQ5FS+Muq0GI7g8m6ZLkycMp1rIwRIZ2UhDhlRCix3sjNQbvjf yY4LbMy8Q8u18Z1jf9YALJC6bYMoVDRVa14+J6Z82bBLR4Q2k3NikSBtbuotmll7T11R 62xHbWCvm+BL8D/3eAiXryJMoRVkUgR+SoFiQJx4I14SmDnXZ+jJ0heRmvJqxxZav1i9 zE1A== X-Gm-Message-State: AOAM532BQeSFUnE6p5lvsTjp3Hy/+w+XW9y8Bwir+MgUIiLPghIgaKZV Veln8Pgq3DjHgAqUVkEARelRRg== X-Google-Smtp-Source: ABdhPJyoCA3uPuZCxSHL6yFBRN8e+6DemT9CbJsGA4nrCdkQQLUMdOxpTNjah6CWsGURB+sl+Zwn0g== X-Received: by 2002:a2e:8850:: with SMTP id z16mr2761724ljj.184.1600852045836; Wed, 23 Sep 2020 02:07:25 -0700 (PDT) Received: from [192.168.1.211] ([188.162.64.186]) by smtp.gmail.com with ESMTPSA id o8sm4572927lfa.44.2020.09.23.02.07.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 23 Sep 2020 02:07:25 -0700 (PDT) Subject: Re: [PATCH v5 1/9] dt-bindings: thermal: qcom: add adc-thermal monitor bindings To: Rob Herring Cc: Andy Gross , Bjorn Andersson , Zhang Rui , Daniel Lezcano , Amit Kucheria , Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-iio@vger.kernel.org, Manivannan Sadhasivam , Jonathan Cameron References: <20200914154809.192174-1-dmitry.baryshkov@linaro.org> <20200914154809.192174-2-dmitry.baryshkov@linaro.org> <20200922234025.GA3476652@bogus> From: Dmitry Baryshkov Message-ID: <55d3f181-b9e6-4963-9d0c-cefee875058c@linaro.org> Date: Wed, 23 Sep 2020 12:07:22 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.2.2 MIME-Version: 1.0 In-Reply-To: <20200922234025.GA3476652@bogus> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org On 23/09/2020 02:40, Rob Herring wrote: > On Mon, Sep 14, 2020 at 06:48:01PM +0300, Dmitry Baryshkov wrote: >> Add bindings for thermal monitor, part of Qualcomm PMIC5 chips. It is a >> close counterpart of VADC part of those PMICs. >> >> Signed-off-by: Dmitry Baryshkov >> Reviewed-by: Jonathan Cameron >> --- >> .../bindings/thermal/qcom-spmi-adc-tm5.yaml | 151 ++++++++++++++++++ >> 1 file changed, 151 insertions(+) >> create mode 100644 Documentation/devicetree/bindings/thermal/qcom-spmi-adc-tm5.yaml >> >> diff --git a/Documentation/devicetree/bindings/thermal/qcom-spmi-adc-tm5.yaml b/Documentation/devicetree/bindings/thermal/qcom-spmi-adc-tm5.yaml >> new file mode 100644 >> index 000000000000..432a65839b89 >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/thermal/qcom-spmi-adc-tm5.yaml >> @@ -0,0 +1,151 @@ >> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) >> +%YAML 1.2 >> +--- >> +$id: http://devicetree.org/schemas/thermal/qcom-spmi-adc-tm5.yaml# >> +$schema: http://devicetree.org/meta-schemas/core.yaml# >> + >> +title: Qualcomm's SPMI PMIC ADC Thermal Monitoring >> +maintainers: >> + - Dmitry Baryshkov >> + >> +properties: >> + compatible: >> + const: qcom,spmi-adc-tm5 >> + >> + reg: >> + maxItems: 1 >> + >> + interrupts: >> + maxItems: 1 >> + >> + "#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 >> + >> + "#address-cells": >> + const: 1 >> + >> + "#size-cells": >> + const: 0 >> + >> + qcom,avg-samples: >> + $ref: /schemas/types.yaml#/definitions/uint32 >> + description: Number of samples to be used for measurement. >> + enum: >> + - 1 >> + - 2 >> + - 4 >> + - 8 >> + - 16 >> + default: 1 >> + >> + qcom,decimation: >> + $ref: /schemas/types.yaml#/definitions/uint32 >> + description: This parameter is used to decrease ADC sampling rate. >> + Quicker measurements can be made by reducing decimation ratio. >> + enum: >> + - 250 >> + - 420 >> + - 840 >> + default: 840 >> + >> +patternProperties: >> + "^([-a-z0-9]*)@[0-9]+$": > > Less than 10 as unit-addresses are hex? 8 channels at max currently. I'll fix to use hex though. > >> + type: object >> + description: >> + Represent one thermal sensor. >> + >> + properties: >> + reg: >> + description: Specify the sensor channel. >> + maxItems: 1 > > You need a range of values here. ok. > >> + >> + io-channels: >> + description: >> + From common IIO binding. Used to pipe PMIC ADC channel to thermal monitor >> + >> + qcom,adc-channel: >> + $ref: /schemas/types.yaml#/definitions/uint32 >> + description: Corresponding ADC channel ID. > > Why is this not a cell in io-channels? Do you mean parsing a cell from io-channels rather than specifying it again? Sounds like a good idea. > >> + >> + qcom,ratiometric: >> + $ref: /schemas/types.yaml#/definitions/flag >> + description: >> + Channel calibration type. >> + If this property is specified VADC will use the VDD reference >> + (1.875V) and GND for channel calibration. If property is not found, >> + channel will be calibrated with 0V and 1.25V reference channels, >> + also known as absolute calibration. >> + >> + qcom,hw-settle-time: >> + $ref: /schemas/types.yaml#/definitions/uint32 >> + description: Time between AMUX getting configured and the ADC starting conversion. > > Time values should have a unit suffix. Seems like a commmon ADC > property... Could you please be more specific here? Would you like for me to just specify the unit in the description? > >> + >> + qcom,pre-scaling: >> + $ref: /schemas/types.yaml#/definitions/uint32-array >> + description: Used for scaling the channel input signal before the >> + signal is fed to VADC. See qcom,spi-vadc specification for the list >> + of possible values. > > I'd rather not. Need the values here to validate a DT. OK > >> + minItems: 2 >> + maxItems: 2 >> + >> + required: >> + - reg >> + - qcom,adc-channel >> + >> + additionalProperties: >> + false >> + >> +required: >> + - compatible >> + - reg >> + - interrupts >> + - "#address-cells" >> + - "#size-cells" >> + - "#thermal-sensor-cells" >> + >> +additionalProperties: false >> + >> +examples: >> + - | >> + #include >> + #include >> + spmi_bus { >> + #address-cells = <1>; >> + #size-cells = <0>; >> + pm8150b_adc: adc@3100 { >> + reg = <0x3100>; >> + compatible = "qcom,spmi-adc5"; >> + #address-cells = <1>; >> + #size-cells = <0>; >> + #io-channel-cells = <1>; >> + io-channel-ranges; >> + >> + /* Other propreties are omitted */ >> + conn-therm@4f { >> + reg = ; >> + qcom,ratiometric; >> + qcom,hw-settle-time = <200>; >> + }; >> + }; >> + >> + pm8150b_adc_tm: adc-tm@3500 { >> + compatible = "qcom,spmi-adc-tm5"; >> + reg = <0x3500>; >> + interrupts = <0x2 0x35 0x0 IRQ_TYPE_EDGE_RISING>; >> + #thermal-sensor-cells = <1>; >> + #address-cells = <1>; >> + #size-cells = <0>; >> + >> + conn-therm@0 { >> + reg = <0>; >> + io-channels = <&pm8150b_adc ADC5_AMUX_THM3_100K_PU>; >> + qcom,adc-channel = ; >> + qcom,ratiometric; >> + qcom,hw-settle-time = <200>; >> + }; >> + }; >> + }; >> +... >> -- >> 2.28.0 >> -- With best wishes Dmitry