Re: [PATCH v3 2/2] thermal: thermal-generic-adc: add temperature sensor channel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 3/6/25 09:49, Svyatoslav Ryhel wrote:
ср, 5 бер. 2025 р. о 16:37 Lukasz Luba <lukasz.luba@xxxxxxx> пише:



On 3/5/25 10:06, Svyatoslav Ryhel wrote:
ср, 5 бер. 2025 р. о 11:52 Lukasz Luba <lukasz.luba@xxxxxxx> пише:



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@xxxxxxxxx>
---
    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?


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




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux