summaryrefslogtreecommitdiffstats
path: root/include/linux/s3c_adc_battery.h
diff options
context:
space:
mode:
authorHeiko Stübner <heiko@sntech.de>2011-12-29 12:52:07 +0100
committerAnton Vorontsov <cbouatmailru@gmail.com>2012-01-06 06:13:35 +0400
commit34aed73df3a9e75e313a7510b201f6755ae3e6bc (patch)
tree3ded8d8b8019eb5b7eff82ab1e4267ad5df789ab /include/linux/s3c_adc_battery.h
parentded7fc7b055055427d0d04958482dbe3d23e087d (diff)
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 <heiko@sntech.de> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
Diffstat (limited to 'include/linux/s3c_adc_battery.h')
-rw-r--r--include/linux/s3c_adc_battery.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/s3c_adc_battery.h b/include/linux/s3c_adc_battery.h
index fbe58b7e63e..99dadbffdd4 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;