summaryrefslogtreecommitdiff
path: root/include/linux/mfd
diff options
context:
space:
mode:
authorDaniel Willerud <daniel.willerud@stericsson.com>2011-03-05 13:46:13 +0300
committerSamuel Ortiz <sameo@linux.intel.com>2011-03-23 12:42:04 +0300
commit6321992cd3c56bab6cc52e3384951e12616805a1 (patch)
tree9a5d028aeb44c0f061c1e5a49735b82a7c609f56 /include/linux/mfd
parentcf16943947cef089c564d2be0ae9d96a285f495e (diff)
downloadlinux-6321992cd3c56bab6cc52e3384951e12616805a1.tar.xz
mfd: Reentrance and revamp ab8500 gpadc fetching interface
This revamps the interface so that AB8500 GPADCs are fetched by name. Probed GPADCs are added to a list and this list is searched for a matching GPADC. This makes it possible to have multiple AB8500 GPADC instances instead of it being a singleton, and rids the need to keep a GPADC pointer around in the core AB8500 MFD struct. Currently the match is made to the device name which is by default numbered from the device instance such as "ab8500-gpadc.0" but by using the .init_name field of the device a more intiutive naming for the GPADC blocks can be achieved if desired. Signed-off-by: Daniel Willerud <daniel.willerud@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'include/linux/mfd')
-rw-r--r--include/linux/mfd/ab8500/ab8500-gpadc.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/linux/mfd/ab8500/ab8500-gpadc.h b/include/linux/mfd/ab8500/ab8500-gpadc.h
index 74b87dde9cd0..46b954011f16 100644
--- a/include/linux/mfd/ab8500/ab8500-gpadc.h
+++ b/include/linux/mfd/ab8500/ab8500-gpadc.h
@@ -3,6 +3,7 @@
* Licensed under GPLv2.
*
* Author: Arun R Murthy <arun.murthy@stericsson.com>
+ * Author: Daniel Willerud <daniel.willerud@stericsson.com>
*/
#ifndef _AB8500_GPADC_H
@@ -23,6 +24,9 @@
#define BK_BAT_V 0x0C
#define DIE_TEMP 0x0D
-int ab8500_gpadc_convert(u8 input);
+struct ab8500_gpadc;
+
+struct ab8500_gpadc *ab8500_gpadc_get(char *name);
+int ab8500_gpadc_convert(struct ab8500_gpadc *gpadc, u8 input);
#endif /* _AB8500_GPADC_H */