Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] iio: adc: mt6359: fix scale divisor, request bits, and MT6358 VBAT ratio
@ 2026-11-26  3:10 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
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Ilia Snezhkov via B4 Relay @ 2026-11-26  3:10 UTC (permalink / raw)
  To: jic23, dlechner, nuno.sa, andy
  Cc: matthias.bgg, angelogioacchino.delregno, linux-iio,
	linux-mediatek, linux-arm-kernel, linux-kernel

This short series fixes three bugs in drivers/iio/adc/mt6359-auxadc.c
introduced in commit 3587914bf61d ("iio: adc: Add support for MediaTek
MT6357/8/9 Auxiliary ADC"):

1. IIO_CHAN_INFO_SCALE omits dividing by (1 << chan->scan_type.realbits),
   causing processed readings and sysfs scales to be 4096x or 32768x too
   large. Use IIO_VAL_FRACTIONAL with shifted denominator when
   denominator > 1, and IIO_VAL_FRACTIONAL_LOG2 otherwise (avoiding
   division by zero on unpopulated descriptors such as MT6357 VDCXO).
2. MT6357 ISENSE/VCDT and MT6358 VCDT use PMIC_AUXADC_RQST0 bit 0
   (BATADC) instead of their hardware request bits (1 and 2).
3. MT6358 VBAT impedance uses r_ratio 7/2 (MT6359) instead of 3/1
   (MT6358/MT6366, matching MT6358 BATADC).

Changes in v2:
- Move the AI coding assistant note below the --- separator in all three
  patches (per Jonathan Cameron's feedback on v1). No code changes.

Found and drafted with an AI coding assistant.

Ilia Snezhkov (3):
  iio: adc: mt6359: divide scale by ADC resolution
  iio: adc: mt6359: fix MT6357 ISENSE/VCDT and MT6358 VCDT request bits
  iio: adc: mt6359: fix MT6358 VBAT impedance resistance ratio

 drivers/iio/adc/mt6359-auxadc.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

-- 
2.54.0 (Apple Git-157)




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-11-26  7:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH v2 3/3] iio: adc: mt6359: fix MT6358 VBAT impedance resistance ratio Ilia Snezhkov via B4 Relay
2026-11-26  7:35   ` Roman Vivchar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox