From 34aed73df3a9e75e313a7510b201f6755ae3e6bc Mon Sep 17 00:00:00 2001 From: Heiko Stübner Date: Thu, 29 Dec 2011 12:52:07 +0100 Subject: s3c_adc_battery: Average over more than one adc sample Some sources for adc battery information provide only inaccurate results where the read value differs from the real value with positive and negative offsets. For such sources it can be more accurate to collect two or more value sample and use the average of all collected values. This patch adds pdata options volt_samples, current_samples and backup_volt_samples to specifiy the number of samples to collect, reads the specified number of samples and calculates the average of those. For unset sample-number-values a default of 1 is assumed. Signed-off-by: Heiko Stuebner Signed-off-by: Anton Vorontsov --- include/linux/s3c_adc_battery.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/linux/s3c_adc_battery.h') diff --git a/include/linux/s3c_adc_battery.h b/include/linux/s3c_adc_battery.h index fbe58b7e63eb..99dadbffdd4f 100644 --- a/include/linux/s3c_adc_battery.h +++ b/include/linux/s3c_adc_battery.h @@ -25,6 +25,10 @@ struct s3c_adc_bat_pdata { const unsigned int current_channel; const unsigned int backup_volt_channel; + const unsigned int volt_samples; + const unsigned int current_samples; + const unsigned int backup_volt_samples; + const unsigned int volt_mult; const unsigned int current_mult; const unsigned int backup_volt_mult; -- cgit v1.2.3