Re: [PATCH v3 1/5] iio: adc: qcom-spmi-adc5: Add battery thermal channels

From: Andy Shevchenko

Date: Fri Nov 13 2026 - 17:03:01 EST


On Fri, Nov 13, 2026 at 04:56:42PM +0100, Luca Weiss wrote:
> Add the BAT_THERM channels with millivolt as output, which can then be
> used along with information regarding the NTC in the battery, to get the
> actual battery temperature.
>
> A static lookup table in the ADC driver won't work since different
> devices have different Ohm and Beta values in their battery NTCs, for
> example a NTC can be 10kOhm & B=3435K.

...

> +static int qcom_vadc_scale_hw_calib_therm_volt(

This is broken indentation. Was `clang-format` being used to achieve that?

> + const struct u32_fract *prescale,
> + const struct adc5_data *data,
> + u16 adc_code, int *result_uv)

result_uV

> +{
> + *result_uv = qcom_vadc_scale_code_voltage_factor(adc_code,
> + prescale, data, 1000);

1000 is odd, can you use something from units.h or combination of those
to show what this multiplier is for?

> + return 0;
> +}

--
With Best Regards,
Andy Shevchenko