mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Luca Weiss <luca.weiss@fairphone.com>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	"Zhang Rui" <rui.zhang@intel.com>,
	"Lukasz Luba" <lukasz.luba@arm.com>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Laxman Dewangan" <ldewangan@nvidia.com>,
	"Bjorn Andersson" <andersson@kernel.org>,
	"Konrad Dybcio" <konradybcio@kernel.org>,
	"Hans de Goede" <hansg@kernel.org>,
	"Jens Reidel" <adrian@mainlining.org>,
	"Casey Connolly" <casey.connolly@linaro.org>,
	"Val Packett" <val@packett.cool>,
	"Daniel Lezcano" <daniel.lezcano@kernel.org>,
	~postmarketos/upstreaming@lists.sr.ht,
	phone-devel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-pm@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v3 1/5] iio: adc: qcom-spmi-adc5: Add battery thermal channels
Date: Mon, 16 Nov 2026 18:50:57 +0200	[thread overview]
Message-ID: <avs0cThxYLWyXE-X@ashevche-desk.local> (raw)
In-Reply-To: <DMWR1CJJRHMF.33YRRRDXPMBDW@fairphone.com>

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



  reply	other threads:[~2026-11-16 16:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13 15:56 [PATCH v3 0/5] Battery temperature ADC plumbing on Qualcomm platforms Luca Weiss
2026-11-13 15:56 ` [PATCH v3 1/5] iio: adc: qcom-spmi-adc5: Add battery thermal channels Luca Weiss
2026-11-13 16:24   ` Andy Shevchenko
2026-11-16 15:43     ` Luca Weiss
2026-11-16 16:50       ` Andy Shevchenko [this message]
2026-11-13 15:56 ` [PATCH v3 2/5] dt-bindings: thermal: generic-adc: Document #io-channel-cells Luca Weiss
2026-11-13 15:56 ` [PATCH v3 3/5] thermal/drivers/generic-adc: Allow probe without TZ registration Luca Weiss
2026-11-13 16:28   ` Andy Shevchenko
2026-11-14  0:15   ` Jonathan Cameron
2026-11-16  8:02     ` Luca Weiss
2026-11-13 15:56 ` [PATCH v3 4/5] arm64: dts: qcom: pm7250b: Define battery temperature ADC channels Luca Weiss
2026-11-13 15:56 ` [PATCH v3 5/5] arm64: dts: qcom: sm7225-fairphone-fp4: Add battery temperature node Luca Weiss

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=avs0cThxYLWyXE-X@ashevche-desk.local \
    --to=andriy.shevchenko@intel.com \
    --cc=adrian@mainlining.org \
    --cc=andersson@kernel.org \
    --cc=andy@kernel.org \
    --cc=casey.connolly@linaro.org \
    --cc=conor+dt@kernel.org \
    --cc=daniel.lezcano@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=hansg@kernel.org \
    --cc=jic23@kernel.org \
    --cc=konradybcio@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=ldewangan@nvidia.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=luca.weiss@fairphone.com \
    --cc=lukasz.luba@arm.com \
    --cc=nuno.sa@analog.com \
    --cc=phone-devel@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=robh@kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=val@packett.cool \
    --cc=~postmarketos/upstreaming@lists.sr.ht \
    /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®