summaryrefslogtreecommitdiff
path: root/include/adc.h
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2012-10-29 12:56:29 -0700
committerGerrit <chrome-bot@google.com>2012-10-30 10:45:07 -0700
commitfdd3d90bd78fd753356d8aa3373e066141851a35 (patch)
tree357e4c651b98b8907ef19e0ea8429f506bd8904c /include/adc.h
parent1d916d7c6b25de10c870cf7f35a44d3654d9f099 (diff)
downloadchrome-ec-fdd3d90bd78fd753356d8aa3373e066141851a35.tar.gz
Clean up ADC module
ADC config structs are now chip-specific; this saves code size (several hundred bytes on LM4, since no need for 24-entry ADC channel to GPIO mapping table). BUG=chrome-os-partner:15579 BRANCH=none TEST='adc' with system on and off; ChargerCurrent should be bigger when on. Change-Id: Ia88b3f043438bec049f2d2ad39fc42dcf86d9424 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36798
Diffstat (limited to 'include/adc.h')
-rw-r--r--include/adc.h30
1 files changed, 15 insertions, 15 deletions
diff --git a/include/adc.h b/include/adc.h
index fe1296cc3b..646298ca76 100644
--- a/include/adc.h
+++ b/include/adc.h
@@ -9,24 +9,24 @@
#define __CROS_EC_ADC_H
#include "common.h"
-#include "board.h"
-/* Data structure to define ADC channels. */
-struct adc_t
-{
- const char* name;
- int sequencer;
- int factor_mul;
- int factor_div;
- int shift;
- int channel;
- int flag;
-};
-
-/* Read ADC channel. */
+/**
+ * Read an ADC channel.
+ *
+ * @param ch Channel to read
+ *
+ * @return The scaled ADC value, or ADC_READ_ERROR if error.
+ */
int adc_read_channel(enum adc_channel ch);
-/* Read all ADC channels. Return non-zero on error. */
+/**
+ * Read all ADC channels.
+ *
+ * @param data Destination array for channel data; must be
+ * ADC_CH_COUNT elements long.
+ *
+ * @return EC_SUCCESS, or non-zero on error.
+ */
int adc_read_all_channels(int *data);
#endif /* __CROS_EC_ADC_H */