mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lukasz Luba <lukasz.luba@arm.com>
To: Svyatoslav Ryhel <clamor95@gmail.com>
Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org,
	Laxman Dewangan <ldewangan@nvidia.com>,
	Conor Dooley <conor+dt@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Rob Herring <robh@kernel.org>, Zhang Rui <rui.zhang@intel.com>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	linux-kernel@vger.kernel.org,
	"Rafael J. Wysocki" <rafael@kernel.org>
Subject: Re: [PATCH v3 1/2] dt-bindings: thermal: generic-adc: Add optional io-channel-cells property
Date: Wed, 5 Mar 2025 14:51:57 +0000	[thread overview]
Message-ID: <1796a9c5-4eb4-4120-a1fb-be773aace202@arm.com> (raw)
In-Reply-To: <CAPVz0n0G+0_f3MONV0Y-tYAb1KOwkUNiY2Pms8CZ6ZGtxRmFFA@mail.gmail.com>



On 3/5/25 10:03, Svyatoslav Ryhel wrote:
> ср, 5 бер. 2025 р. о 12:00 Lukasz Luba <lukasz.luba@arm.com> пише:
>>
>>
>>
>> On 3/3/25 12:21, Svyatoslav Ryhel wrote:
>>> This implements a mechanism to derive temperature values from an existing ADC IIO
>>> channel, effectively creating a temperature IIO channel. This approach avoids adding
>>> a new sensor and its associated conversion table, while providing IIO-based temperature
>>> data for devices that may not utilize hwmon.
>>>
>>> Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
>>> ---
>>>    .../devicetree/bindings/thermal/generic-adc-thermal.yaml      | 4 ++++
>>>    1 file changed, 4 insertions(+)
>>>
>>> diff --git a/Documentation/devicetree/bindings/thermal/generic-adc-thermal.yaml b/Documentation/devicetree/bindings/thermal/generic-adc-thermal.yaml
>>> index 12e6418dc24d..4bc2cff0593c 100644
>>> --- a/Documentation/devicetree/bindings/thermal/generic-adc-thermal.yaml
>>> +++ b/Documentation/devicetree/bindings/thermal/generic-adc-thermal.yaml
>>> @@ -30,6 +30,9 @@ properties:
>>>      io-channel-names:
>>>        const: sensor-channel
>>>
>>> +  '#io-channel-cells':
>>> +    const: 1
>>> +
>>>      temperature-lookup-table:
>>>        description: |
>>>          Lookup table to map the relation between ADC value and temperature.
>>> @@ -60,6 +63,7 @@ examples:
>>>            #thermal-sensor-cells = <0>;
>>>            io-channels = <&ads1015 1>;
>>>            io-channel-names = "sensor-channel";
>>> +        #io-channel-cells = <1>;
>>>            temperature-lookup-table = <
>>>                  (-40000) 2578
>>>                  (-39000) 2577
>>
>> Do we really need this change in the DT?
>> Won't the code in the thermal driver that registers a new iio device
>> would just be enough?
>>
>> I agree with Rob that it looks odd.
> 
> Building tree will complain on missing cells property if you try to
> bind it. It is not in required category anyway.

Fair enough, then I will leave it to DT folks.

For me it's looks OK-ish, assuming you add this property with the
comment describing it like Rob asked.

UUIC it will always be only 1 channel - with that temperature,
so shouldn't harm much the design in DT.

  reply	other threads:[~2025-03-05 14:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-03 12:21 [PATCH v3 0/2] thermal: thermal-generic-adc: add temp sensor function Svyatoslav Ryhel
2025-03-03 12:21 ` [PATCH v3 1/2] dt-bindings: thermal: generic-adc: Add optional io-channel-cells property Svyatoslav Ryhel
2025-03-05 10:00   ` Lukasz Luba
2025-03-05 10:03     ` Svyatoslav Ryhel
2025-03-05 14:51       ` Lukasz Luba [this message]
2025-03-05 16:10       ` Rob Herring
2025-03-03 12:21 ` [PATCH v3 2/2] thermal: thermal-generic-adc: add temperature sensor channel Svyatoslav Ryhel
2025-03-05  9:52   ` Lukasz Luba
2025-03-05 10:06     ` Svyatoslav Ryhel
2025-03-05 14:37       ` Lukasz Luba
2025-03-05 14:43         ` Svyatoslav Ryhel
2025-03-06  9:49         ` Svyatoslav Ryhel
2025-03-06 10:04           ` Lukasz Luba
2025-04-05 15:15             ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1796a9c5-4eb4-4120-a1fb-be773aace202@arm.com \
    --to=lukasz.luba@arm.com \
    --cc=clamor95@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=ldewangan@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=robh@kernel.org \
    --cc=rui.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®