mfd: ab8500-gpadc add new GPADC driver
Subsystems (2)
PATCH v2 1/1 mfd: ab8500-gpadc add new GPADC driver
AB8500 GPADC driver used to convert Acc and battery/ac/usb voltage
Signed-off-by Arun Murthy <[email protected]>
Acked-by Linus Walleij <[email protected]>
Acked-by Mattias Wallin <[email protected]>
--- drivers/mfd/Kconfig | 7 + drivers/mfd/Makefile | 1 + drivers/mfd/ab8500-gpadc.c | 296 ++++++++++++++++++++++++++++++++++++++ include/linux/mfd/ab8500-gpadc.h | 28 ++++ 4 files changed, 332 insertions(+), 0 deletions(-) create mode 100644 drivers/mfd/ab8500-gpadc.c create mode 100644 include/linux/mfd/ab8500-gpadc.h
drivers/mfd/Kconfig +7 -0
@@ -523,6 +523,13 @@ config AB8500_DEBUG Select this option if you want debug information using the debug filesystem, debugfs. +config AB8500_GPADC + bool "AB8500 GPADC driver" + depends on AB8500_CORE && REGULATOR_AB8500 + default y + help + AB8500 GPADC driver used to convert Acc and battery/ac/usb voltage + config AB3550_CORE bool "ST-Ericsson AB3550 Mixed Signal Circuit core functions" select MFD_CORE
drivers/mfd/Makefile +1 -0
@@ -73,6 +73,7 @@ obj-$(CONFIG_AB3550_CORE) += ab3550-core.o obj-$(CONFIG_AB8500_CORE) += ab8500-core.o obj-$(CONFIG_AB8500_I2C_CORE) += ab8500-i2c.o obj-$(CONFIG_AB8500_DEBUG) += ab8500-debugfs.o +obj-$(CONFIG_AB8500_GPADC) += ab8500-gpadc.o obj-$(CONFIG_MFD_TIMBERDALE) += timberdale.o obj-$(CONFIG_PMIC_ADP5520) += adp5520.o obj-$(CONFIG_LPC_SCH) += lpc_sch.o
drivers/mfd/ab8500-gpadc.c new file +296 -0
296 lines not on this page · raw message
include/linux/mfd/ab8500-gpadc.h new file +28 -0
@@ -0,0 +1,28 @@ +/* +* Copyright (C) 2010 ST-Ericsson SA +* Licensed under GPLv2. +* +* Author: Arun R Murthy <[email protected]> +*/ + +#ifndef _AB8500_GPADC_H +#define _AB8500_GPADC_H + +/* GPADC source: From datasheet(ADCSwSel[4:0] in GPADCCtrl2) */ +#define BAT_CTRL 0x01 +#define BTEMP_BALL 0x02 +#define MAIN_CHARGER_V 0x03 +#define ACC_DETECT1 0x04 +#define ACC_DETECT2 0x05 +#define ADC_AUX1 0x06 +#define ADC_AUX2 0x07 +#define MAIN_BAT_V 0x08 +#define VBUS_V 0x09 +#define MAIN_CHARGER_C 0x0A +#define USB_CHARGER_C 0x0B +#define BK_BAT_V 0x0C +#define DIE_TEMP 0x0D + +int ab8500_gpadc_convert (u8 input); + +#endif /* _AB8500_GPADC_H */
Signature · 1 line
1.7.2.dirty