public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] iio: adc: aspeed: Reserve battery sensing channel for on-demand use
@ 2026-03-16  3:00 Billy Tsai
  2026-03-16  3:00 ` [PATCH v2 1/3] iio: adc: Add battery channel definition for ADC Billy Tsai
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Billy Tsai @ 2026-03-16  3:00 UTC (permalink / raw)
  To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
	Joel Stanley, Andrew Jeffery
  Cc: linux-iio, linux-arm-kernel, linux-aspeed, linux-kernel,
	morris_mao, Billy Tsai

For controllers with battery sensing capability (AST2600/AST2700), the last
channel uses a different circuit design optimized for battery voltage
measurement. This channel should not be enabled by default along with other
channels to avoid potential interference and power efficiency issues.

Changes made:
- Introduce aspeed_adc_get_active_channels() to return the number of
  channels that should be enabled by default
- For battery sensing capable controllers, exclude the last channel
  from the default channel enable mask
- Enable the battery sensing channel only when explicitly accessed
  via read_raw()
- Replace hardcoded channel numbers with ASPEED_ADC_BATTERY_CHANNEL macro
- Add helper functions for cleaner channel management

This ensures optimal power efficiency for normal ADC operations while
maintaining full functionality when battery sensing is needed.

Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
---
Changes in v2:
- Split the changes into a series of patches for better clarity and
review
- Link to v1: https://lore.kernel.org/r/20260313-adc-v1-1-7a2edb4e5664@aspeedtech.com

---
Billy Tsai (3):
      iio: adc: Add battery channel definition for ADC
      iio: adc: Enable multiple consecutive channels based on model data
      iio: adc: aspeed: Reserve battery sensing channel for on-demand use

 drivers/iio/adc/aspeed_adc.c | 75 ++++++++++++++++++++++++++++++++++++++------
 1 file changed, 65 insertions(+), 10 deletions(-)
---
base-commit: 6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f
change-id: 20260313-adc-479b0ab09bae

Best regards,
-- 
Billy Tsai <billy_tsai@aspeedtech.com>



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

end of thread, other threads:[~2026-03-20  3:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-16  3:00 [PATCH v2 0/3] iio: adc: aspeed: Reserve battery sensing channel for on-demand use Billy Tsai
2026-03-16  3:00 ` [PATCH v2 1/3] iio: adc: Add battery channel definition for ADC Billy Tsai
2026-03-16  3:00 ` [PATCH v2 2/3] iio: adc: Enable multiple consecutive channels based on model data Billy Tsai
2026-03-16 14:25   ` Andy Shevchenko
2026-03-20  3:33     ` Billy Tsai
2026-03-16  3:00 ` [PATCH v2 3/3] iio: adc: aspeed: Reserve battery sensing channel for on-demand use Billy Tsai
2026-03-16 14:26   ` Andy Shevchenko
2026-03-20  3:41     ` Billy Tsai

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