diff options
author | Vijaya Kumar Kilari <vijay.kilari@stericsson.com> | 2011-04-27 16:56:26 +0530 |
---|---|---|
committer | Philippe Langlais <philippe.langlais@linaro.org> | 2011-07-22 15:48:20 +0200 |
commit | 59d9656fa306adf56d12a5b278de011b89cfc8a7 (patch) | |
tree | e1d755b55ce0def0605563d8c7193725b042c7cf /include | |
parent | cca36e9a983e310277a321f78f3c70285938a808 (diff) |
AB5500: AB5500 Analog to Digital conversion driver
AB5500 GPADC driver for battery/usb voltage, current
and temperature measurement
ST-Ericsson ID: WP332221
ST-Ericsson FOSS-OUT ID: Trivial
Change-Id: Ia841694711cbba168e7e705a5a2bc78c6e3db8dc
Signed-off-by: Vijaya Kumar Kilari <vijay.kilari@stericsson.com>
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/21775
Reviewed-by: Arun MURTHY <arun.murthy@stericsson.com>
Tested-by: Arun MURTHY <arun.murthy@stericsson.com>
Reviewed-by: Johan PALSSON <johan.palsson@stericsson.com>
Reviewed-by: QATEST
Reviewed-by: Linus WALLEIJ <linus.walleij@stericsson.com>
Fix to merge with 4e75305 "AB5500: AB5500 Analog to Digital conversion driver"
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mfd/abx500/ab5500-gpadc.h | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/include/linux/mfd/abx500/ab5500-gpadc.h b/include/linux/mfd/abx500/ab5500-gpadc.h new file mode 100644 index 00000000000..3282b44114e --- /dev/null +++ b/include/linux/mfd/abx500/ab5500-gpadc.h @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2010 ST-Ericsson SA + * Licensed under GPLv2. + * + * Author: Vijaya Kumar K <vijay.kilari@stericsson.com> + */ + +#ifndef _AB5500_GPADC_H +#define _AB5500_GPADC_H + +/* + * GPADC source: + * The BTEMP_BALL and PCB_TEMP are same. They differ if the + * battery supports internal NTC resistor connected to BDATA + * line. In this case, the BTEMP_BALL correspondss to BDATA + * of GPADC as per AB5500 product spec. + */ + +#define BTEMP_BALL 0 +#define ACC_DETECT2 1 +#define ACC_DETECT3 2 +#define MAIN_BAT_V 3 +#define MAIN_BAT_V_TXON 4 +#define VBUS_V 5 +#define USB_CHARGER_C 6 +#define BK_BAT_V 7 +#define DIE_TEMP 8 +#define PCB_TEMP 9 +#define XTAL_TEMP 10 +#define USB_ID 11 +#define BAT_CTRL 12 +/* VBAT with TXON only min trigger */ +#define MAIN_BAT_V_TXON_TRIG_MIN 13 +/* VBAT with TX off only min trigger */ +#define MAIN_BAT_V_TRIG_MIN 14 + +/* + * Frequency of auto adc conversion + */ +#define MS1000 0x0 +#define MS500 0x1 +#define MS200 0x2 +#define MS100 0x3 +#define MS10 0x4 + +struct ab5500_gpadc; + +/* + * struct adc_auto_input - AB5500 GPADC auto trigger + * @adc_mux Mux input + * @freq freq of conversion + * @min min value for trigger + * @max max value for trigger + * @auto_adc_callback notification callback + */ +struct adc_auto_input { + u8 mux; + u8 freq; + int min; + int max; + int (*auto_adc_callback)(int mux); +}; + +struct ab5500_gpadc *ab5500_gpadc_get(const char *name); +int ab5500_gpadc_convert(struct ab5500_gpadc *gpadc, u8 input); +int ab5500_gpadc_convert_auto(struct ab5500_gpadc *gpadc, + struct adc_auto_input *auto_input); + +#endif /* _AB5500_GPADC_H */ |