Linux-mediatek Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ilia Snezhkov via B4 Relay <devnull+iasnezhkov.gmail.com@kernel.org>
To: jic23@kernel.org, dlechner@baylibre.com, nuno.sa@analog.com,
	 andy@kernel.org
Cc: matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com,
	 linux-iio@vger.kernel.org, linux-mediatek@lists.infradead.org,
	 linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH v2 3/3] iio: adc: mt6359: fix MT6358 VBAT impedance resistance ratio
Date: Thu, 26 Nov 2026 03:10:16 +0000	[thread overview]
Message-ID: <20261126031013.27701-4-iasnezhkov@gmail.com> (raw)
In-Reply-To: <20261126031013.27701-1-iasnezhkov@gmail.com>

From: Ilia Snezhkov <iasnezhkov@gmail.com>

On MT6358 (and MT6366), both BATADC and the battery impedance VBAT
channel use a 3/1 voltage divider (5400 mV full scale with 1800 mV
VREF). mt6358_auxadc_ch_desc[PMIC_AUXADC_CHAN_VBAT] erroneously uses
7/2 (copied from MT6359), over-reporting VBAT impedance readings by
16.7%.

Change MT6358 VBAT r_ratio from 7/2 to 3/1 to match MT6358 BATADC and
hardware.

Fixes: 3587914bf61d ("iio: adc: Add support for MediaTek MT6357/8/9 Auxiliary ADC")
Signed-off-by: Ilia Snezhkov <iasnezhkov@gmail.com>
---
Changes in v2:
- Move AI coding assistant note below ---. No code changes.

Found and drafted with an AI coding assistant.

 drivers/iio/adc/mt6359-auxadc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/adc/mt6359-auxadc.c b/drivers/iio/adc/mt6359-auxadc.c
index 4a66253..915378c 100644
--- a/drivers/iio/adc/mt6359-auxadc.c
+++ b/drivers/iio/adc/mt6359-auxadc.c
@@ -285,7 +285,7 @@ static const struct mtk_pmic_auxadc_chan mt6358_auxadc_ch_desc[] = {
 	MTK_PMIC_ADC_CHAN(VGPU_TEMP, PMIC_AUXADC_RQST1, 10, PMIC_AUXADC_IMP0, 8, 8, 1, 1),
 
 	/* Battery impedance channels */
-	MTK_PMIC_ADC_CHAN(VBAT, 0, 0, PMIC_AUXADC_IMP0, 8, 128, 7, 2),
+	MTK_PMIC_ADC_CHAN(VBAT, 0, 0, PMIC_AUXADC_IMP0, 8, 128, 3, 1),
 };
 
 static const u16 mt6358_auxadc_regs[] = {
-- 
2.54.0 (Apple Git-157)




  parent reply	other threads:[~2026-11-26  3:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26  3:10 [PATCH v2 0/3] iio: adc: mt6359: fix scale divisor, request bits, and MT6358 VBAT ratio Ilia Snezhkov via B4 Relay
2026-11-26  3:10 ` [PATCH v2 1/3] iio: adc: mt6359: divide scale by ADC resolution Ilia Snezhkov via B4 Relay
2026-11-26  7:18   ` Roman Vivchar
2026-11-26  3:10 ` [PATCH v2 2/3] iio: adc: mt6359: fix MT6357 ISENSE/VCDT and MT6358 VCDT request bits Ilia Snezhkov via B4 Relay
2026-11-26  7:32   ` Roman Vivchar
2026-11-26  3:10 ` Ilia Snezhkov via B4 Relay [this message]
2026-11-26  7:35   ` [PATCH v2 3/3] iio: adc: mt6359: fix MT6358 VBAT impedance resistance ratio Roman Vivchar

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=20261126031013.27701-4-iasnezhkov@gmail.com \
    --to=devnull+iasnezhkov.gmail.com@kernel.org \
    --cc=andy@kernel.org \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=dlechner@baylibre.com \
    --cc=iasnezhkov@gmail.com \
    --cc=jic23@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=nuno.sa@analog.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