aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@stericsson.com>2009-09-09 05:31:00 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2009-09-17 03:47:25 -0400
commitd619bc143e311a738113dbbe7792bd032403939f (patch)
treef5a7bebf4058761a223dba7ffc7057d70d17245b /include
parentbd207cfb0011389d55827b3f3181c60e8c3c7148 (diff)
regulator: AB3100 support
This adds support for the regulators found in the AB3100 Mixed-Signal IC. It further also defines platform data for the ST-Ericsson U300 platform and extends the AB3100 MFD driver so that platform/board data with regulation constraints and an init function can be passed down all the way from the board to the regulators. Signed-off-by: Linus Walleij <linus.walleij@stericsson.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mfd/ab3100.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/include/linux/mfd/ab3100.h b/include/linux/mfd/ab3100.h
index 3ead5cfb638c..e9aa4c9d749d 100644
--- a/include/linux/mfd/ab3100.h
+++ b/include/linux/mfd/ab3100.h
@@ -7,6 +7,7 @@
7 7
8#include <linux/device.h> 8#include <linux/device.h>
9#include <linux/workqueue.h> 9#include <linux/workqueue.h>
10#include <linux/regulator/machine.h>
10 11
11#ifndef MFD_AB3100_H 12#ifndef MFD_AB3100_H
12#define MFD_AB3100_H 13#define MFD_AB3100_H
@@ -57,6 +58,14 @@
57#define AB3100_STR_BATT_REMOVAL (0x40) 58#define AB3100_STR_BATT_REMOVAL (0x40)
58#define AB3100_STR_VBUS (0x80) 59#define AB3100_STR_VBUS (0x80)
59 60
61/*
62 * AB3100 contains 8 regulators, one external regulator controller
63 * and a buck converter, further the LDO E and buck converter can
64 * have separate settings if they are in sleep mode, this is
65 * modeled as a separate regulator.
66 */
67#define AB3100_NUM_REGULATORS 10
68
60/** 69/**
61 * struct ab3100 70 * struct ab3100
62 * @access_mutex: lock out concurrent accesses to the AB3100 registers 71 * @access_mutex: lock out concurrent accesses to the AB3100 registers
@@ -87,6 +96,25 @@ struct ab3100 {
87 bool startup_events_read; 96 bool startup_events_read;
88}; 97};
89 98
99/**
100 * struct ab3100_platform_data
101 * Data supplied to initialize board connections to the AB3100
102 * @reg_constraints: regulator constraints for target board
103 * the order of these constraints are: LDO A, C, D, E,
104 * F, G, H, K, EXT and BUCK.
105 * @reg_initvals: initial values for the regulator registers
106 * plus two sleep settings for LDO E and the BUCK converter.
107 * exactly AB3100_NUM_REGULATORS+2 values must be sent in.
108 * Order: LDO A, C, E, E sleep, F, G, H, K, EXT, BUCK,
109 * BUCK sleep, LDO D. (LDO D need to be initialized last.)
110 * @external_voltage: voltage level of the external regulator.
111 */
112struct ab3100_platform_data {
113 struct regulator_init_data reg_constraints[AB3100_NUM_REGULATORS];
114 u8 reg_initvals[AB3100_NUM_REGULATORS+2];
115 int external_voltage;
116};
117
90int ab3100_set_register_interruptible(struct ab3100 *ab3100, u8 reg, u8 regval); 118int ab3100_set_register_interruptible(struct ab3100 *ab3100, u8 reg, u8 regval);
91int ab3100_get_register_interruptible(struct ab3100 *ab3100, u8 reg, u8 *regval); 119int ab3100_get_register_interruptible(struct ab3100 *ab3100, u8 reg, u8 *regval);
92int ab3100_get_register_page_interruptible(struct ab3100 *ab3100, 120int ab3100_get_register_page_interruptible(struct ab3100 *ab3100,