Re: [PATCH v3 1/5] iio: adc: qcom-spmi-adc5: Add battery thermal channels
From: Andy Shevchenko
Date: Mon Nov 16 2026 - 11:51:11 EST
On Mon, Nov 16, 2026 at 04:43:49PM +0100, Luca Weiss wrote:
> On Fri Nov 13, 2026 at 5:24 PM CET, Andy Shevchenko wrote:
> > On Fri, Nov 13, 2026 at 04:56:42PM +0100, Luca Weiss wrote:
...
> >> +static int qcom_vadc_scale_hw_calib_therm_volt(
> >
> > This is broken indentation. Was `clang-format` being used to achieve that?
>
> This is how the rest of the file is formatted, I didn't deviate from
> that.
Oh, I see, that's unfortunate.
> >> + const struct u32_fract *prescale,
> >> + const struct adc5_data *data,
> >> + u16 adc_code, int *result_uv)
> >
> > result_uV
>
> As Sashiko pointed out, this is labelled wrong, the result is millivolt.
>
> The rest of the driver consistently uses "mv" for that, should I deviate
> and use result_mV?
In that case _mV, yes.
> >
> >> +{
> >> + *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?
>
> This is converting microvolt to millivolt.
>
> Shall I use "(MICRO / MILLI)" as used in plenty other drivers?
Yes.
> Two drivers in the tree also have "#define MILLI_TO_MICRO 1000"
They should rather name it explicit with VOLTS inside. So, not a good
example.
> >> + return 0;
> >> +}
--
With Best Regards,
Andy Shevchenko