The ADC stabilization delays in compensation mode and battery sensing
mode do not require atomic context. Using mdelay() here results in
unnecessary busy waiting.
Replace mdelay(1) with fsleep(1000) to allow the scheduler to run other
tasks while waiting for the ADC to stabilize.
Also fix a minor typo in the comment ("adc" -> "ADC").
Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* After enable compensating sensing mode need to wait some time for ADC stable
* Experiment result is 1ms.
*/
- mdelay(1);
+ fsleep(1000);
for (index = 0; index < 16; index++) {
/*
ASPEED_ADC_BAT_SENSING_ENABLE,
data->base + ASPEED_REG_ENGINE_CONTROL);
/*
- * After enable battery sensing mode need to wait some time for adc stable
+ * After enable battery sensing mode need to wait some time for ADC stable
* Experiment result is 1ms.
*/
- mdelay(1);
+ fsleep(1000);
*val = readw(data->base + chan->address);
*val = (*val * data->battery_mode_gain.mult) /
data->battery_mode_gain.div;