public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Lukasz Luba <lukasz.luba@arm.com>
Cc: Svyatoslav Ryhel <clamor95@gmail.com>,
	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>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Zhang Rui <rui.zhang@intel.com>,
	linux-kernel@vger.kernel.org,
	"Rafael J. Wysocki" <rafael@kernel.org>
Subject: Re: [PATCH v3 2/2] thermal: thermal-generic-adc: add temperature sensor channel
Date: Sat, 5 Apr 2025 16:15:04 +0100	[thread overview]
Message-ID: <20250405161504.6d2cc27d@jic23-huawei> (raw)
In-Reply-To: <67659d9d-f228-42ac-b096-01020bf66b7f@arm.com>

On Thu, 6 Mar 2025 10:04:01 +0000
Lukasz Luba <lukasz.luba@arm.com> wrote:

> On 3/6/25 09:49, Svyatoslav Ryhel wrote:
> > ср, 5 бер. 2025 р. о 16:37 Lukasz Luba <lukasz.luba@arm.com> пише:  
> >>
> >>
> >>
> >> On 3/5/25 10:06, Svyatoslav Ryhel wrote:  
> >>> ср, 5 бер. 2025 р. о 11:52 Lukasz Luba <lukasz.luba@arm.com> пише:  
> >>>>
> >>>>
> >>>>
> >>>> On 3/3/25 12:21, Svyatoslav Ryhel wrote:  
> >>>>> To avoid duplicating sensor functionality and conversion tables, this design
> >>>>> allows converting an ADC IIO channel's output directly into a temperature IIO
> >>>>> channel. This is particularly useful for devices where hwmon isn't suitable
> >>>>> or where temperature data must be accessible through IIO.
> >>>>>
> >>>>> One such device is, for example, the MAX17040 fuel gauge.
> >>>>>
> >>>>> Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
> >>>>> ---
> >>>>>     drivers/thermal/thermal-generic-adc.c | 54 ++++++++++++++++++++++++++-
> >>>>>     1 file changed, 53 insertions(+), 1 deletion(-)
> >>>>>
> >>>>> diff --git a/drivers/thermal/thermal-generic-adc.c b/drivers/thermal/thermal-generic-adc.c  
> >>> ...  
> >>>>>
> >>>>> +static const struct iio_chan_spec gadc_thermal_iio_channel[] = {
> >>>>> +     {
> >>>>> +             .type = IIO_TEMP,
> >>>>> +             .info_mask_separate = BIT(IIO_CHAN_INFO_PROCESSED),  
> >>>>
> >>>> I would add the IIO_CHAN_INFO_SCALE and say it's in milli-degrees.
> >>>>  
> >>>
> >>> I have hit this issue already with als sensor. This should definitely
> >>> be a IIO_CHAN_INFO_PROCESSED since there is no raw temp data we have,
> >>> it gets processed into temp data via conversion table. I will add
> >>> Jonathan Cameron to list if you don't mind, he might give some good
> >>> advice.  
> >>
> >> I'm not talking about 'PROCESSED' vs 'RAW'...
> >> I'm asking if you can add the 'SCALE' case to handle and report
> >> that this device will report 'processed' temp value in milli-degrees
> >> of Celsius.
> >>  
> > 
> > It seems that SCALE is not applied to PROCESSED channel. I can use RAW
> > which would work as intended and I will add a note in commit
> > description why I used RAW. Would that be acceptable?

Indeed. SCALE is only about RAW channels because if they are processed
you have already applied the scale (typically because it wasn't linear)

> >   
> 
> In that case, yes that would be the preferred solution.

I nearly missed this entirely as it was buried in my unfiltered email.
Thanks for the +CC.

Given this is a IIO driver (be it in thermal)
please +CC linux-iio@vger.kernel.org to get review of that part of it.

Note, in general if you do a driver out of subsystem (and there
are good reasons to do that!) please +CC the other subsystem and
maintainers as well. We do that for IIO drivers that have a gpio
chip for instance. I specifically check they are +CC and wait for
an Ack before merging such drivers.

Thanks,

Jonathan


      reply	other threads:[~2025-04-05 15:15 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
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 [this message]

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=20250405161504.6d2cc27d@jic23-huawei \
    --to=jic23@kernel.org \
    --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=lukasz.luba@arm.com \
    --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