[PATCH v2 3/3] iio: adc: aspeed: Reserve battery sensing channel for on-demand use
Billy Tsai
billy_tsai at aspeedtech.com
Fri Mar 20 14:41:17 AEDT 2026
On Mon, Mar 16, 2026 at 11:00:48AM +0800, Billy Tsai wrote:
> > 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.
> > This ensures optimal power efficiency for normal ADC operations while
> > maintaining full functionality when battery sensing is needed.
>...
> > + /*
> > + * After enable a new channel need to wait some time for adc stable
> ADC
Got it.
> > + * Experiment result is 1ms.
> > + */
> > + mdelay(1);
> Why atomic? If not required, use fsleep(). Otherwise explain.
Good point.
This path is sleepable, so mdelay() is not required. I’ll switch it to
fsleep(1000) in v2.
I’ll also take a look at other mdelay() users in the driver and clean them
up in a separate patch if appropriate.
> > + }
Thanks
Billy Tsai
More information about the Linux-aspeed
mailing list