aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorHeiko Stuebner <heiko@sntech.de>2015-03-07 10:33:53 -0500
committerMark Brown <broonie@kernel.org>2015-03-07 11:32:28 -0500
commitc8b263cc03eaaa324c9222474191e6d849cb6dda (patch)
treefda2b142d6ea62184192022c27f6c7bab016c2da /drivers/regulator
parentdf3a950e4e7386027fc174566aa5c24781297be8 (diff)
regulator: act8865: add input supply handling
The act88600/act8846/act8865 regulators have a number of input supplies supplying the individual regulators. This may even be recursively like on most Rockchip boards using the act8846 where REG4 is most of the time connected to the inl1-supply. Therefore add the ability to specify the input supplies for the individual inputs. The input-names are taken from the datasheets of act8600, act8846 and act8865. On the act8600 some regulators do not have separate input supplies. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/act8865-regulator.c55
1 files changed, 28 insertions, 27 deletions
diff --git a/drivers/regulator/act8865-regulator.c b/drivers/regulator/act8865-regulator.c
index 3781f6e289d8..2ff73d72ca34 100644
--- a/drivers/regulator/act8865-regulator.c
+++ b/drivers/regulator/act8865-regulator.c
@@ -173,9 +173,10 @@ static struct regulator_ops act8865_ldo_ops = {
173 .is_enabled = regulator_is_enabled_regmap, 173 .is_enabled = regulator_is_enabled_regmap,
174}; 174};
175 175
176#define ACT88xx_REG(_name, _family, _id, _vsel_reg) \ 176#define ACT88xx_REG(_name, _family, _id, _vsel_reg, _supply) \
177 [_family##_ID_##_id] = { \ 177 [_family##_ID_##_id] = { \
178 .name = _name, \ 178 .name = _name, \
179 .supply_name = _supply, \
179 .id = _family##_ID_##_id, \ 180 .id = _family##_ID_##_id, \
180 .type = REGULATOR_VOLTAGE, \ 181 .type = REGULATOR_VOLTAGE, \
181 .ops = &act8865_ops, \ 182 .ops = &act8865_ops, \
@@ -190,9 +191,9 @@ static struct regulator_ops act8865_ldo_ops = {
190 } 191 }
191 192
192static const struct regulator_desc act8600_regulators[] = { 193static const struct regulator_desc act8600_regulators[] = {
193 ACT88xx_REG("DCDC1", ACT8600, DCDC1, VSET), 194 ACT88xx_REG("DCDC1", ACT8600, DCDC1, VSET, "vp1"),
194 ACT88xx_REG("DCDC2", ACT8600, DCDC2, VSET), 195 ACT88xx_REG("DCDC2", ACT8600, DCDC2, VSET, "vp2"),
195 ACT88xx_REG("DCDC3", ACT8600, DCDC3, VSET), 196 ACT88xx_REG("DCDC3", ACT8600, DCDC3, VSET, "vp3"),
196 { 197 {
197 .name = "SUDCDC_REG4", 198 .name = "SUDCDC_REG4",
198 .id = ACT8600_ID_SUDCDC4, 199 .id = ACT8600_ID_SUDCDC4,
@@ -207,10 +208,10 @@ static const struct regulator_desc act8600_regulators[] = {
207 .enable_mask = ACT8865_ENA, 208 .enable_mask = ACT8865_ENA,
208 .owner = THIS_MODULE, 209 .owner = THIS_MODULE,
209 }, 210 },
210 ACT88xx_REG("LDO5", ACT8600, LDO5, VSET), 211 ACT88xx_REG("LDO5", ACT8600, LDO5, VSET, "inl"),
211 ACT88xx_REG("LDO6", ACT8600, LDO6, VSET), 212 ACT88xx_REG("LDO6", ACT8600, LDO6, VSET, "inl"),
212 ACT88xx_REG("LDO7", ACT8600, LDO7, VSET), 213 ACT88xx_REG("LDO7", ACT8600, LDO7, VSET, "inl"),
213 ACT88xx_REG("LDO8", ACT8600, LDO8, VSET), 214 ACT88xx_REG("LDO8", ACT8600, LDO8, VSET, "inl"),
214 { 215 {
215 .name = "LDO_REG9", 216 .name = "LDO_REG9",
216 .id = ACT8600_ID_LDO9, 217 .id = ACT8600_ID_LDO9,
@@ -236,28 +237,28 @@ static const struct regulator_desc act8600_regulators[] = {
236}; 237};
237 238
238static const struct regulator_desc act8846_regulators[] = { 239static const struct regulator_desc act8846_regulators[] = {
239 ACT88xx_REG("REG1", ACT8846, REG1, VSET), 240 ACT88xx_REG("REG1", ACT8846, REG1, VSET, "vp1"),
240 ACT88xx_REG("REG2", ACT8846, REG2, VSET0), 241 ACT88xx_REG("REG2", ACT8846, REG2, VSET0, "vp2"),
241 ACT88xx_REG("REG3", ACT8846, REG3, VSET0), 242 ACT88xx_REG("REG3", ACT8846, REG3, VSET0, "vp3"),
242 ACT88xx_REG("REG4", ACT8846, REG4, VSET0), 243 ACT88xx_REG("REG4", ACT8846, REG4, VSET0, "vp4"),
243 ACT88xx_REG("REG5", ACT8846, REG5, VSET), 244 ACT88xx_REG("REG5", ACT8846, REG5, VSET, "inl1"),
244 ACT88xx_REG("REG6", ACT8846, REG6, VSET), 245 ACT88xx_REG("REG6", ACT8846, REG6, VSET, "inl1"),
245 ACT88xx_REG("REG7", ACT8846, REG7, VSET), 246 ACT88xx_REG("REG7", ACT8846, REG7, VSET, "inl1"),
246 ACT88xx_REG("REG8", ACT8846, REG8, VSET), 247 ACT88xx_REG("REG8", ACT8846, REG8, VSET, "inl2"),
247 ACT88xx_REG("REG9", ACT8846, REG9, VSET), 248 ACT88xx_REG("REG9", ACT8846, REG9, VSET, "inl2"),
248 ACT88xx_REG("REG10", ACT8846, REG10, VSET), 249 ACT88xx_REG("REG10", ACT8846, REG10, VSET, "inl3"),
249 ACT88xx_REG("REG11", ACT8846, REG11, VSET), 250 ACT88xx_REG("REG11", ACT8846, REG11, VSET, "inl3"),
250 ACT88xx_REG("REG12", ACT8846, REG12, VSET), 251 ACT88xx_REG("REG12", ACT8846, REG12, VSET, "inl3"),
251}; 252};
252 253
253static const struct regulator_desc act8865_regulators[] = { 254static const struct regulator_desc act8865_regulators[] = {
254 ACT88xx_REG("DCDC_REG1", ACT8865, DCDC1, VSET1), 255 ACT88xx_REG("DCDC_REG1", ACT8865, DCDC1, VSET1, "vp1"),
255 ACT88xx_REG("DCDC_REG2", ACT8865, DCDC2, VSET1), 256 ACT88xx_REG("DCDC_REG2", ACT8865, DCDC2, VSET1, "vp2"),
256 ACT88xx_REG("DCDC_REG3", ACT8865, DCDC3, VSET1), 257 ACT88xx_REG("DCDC_REG3", ACT8865, DCDC3, VSET1, "vp3"),
257 ACT88xx_REG("LDO_REG1", ACT8865, LDO1, VSET), 258 ACT88xx_REG("LDO_REG1", ACT8865, LDO1, VSET, "inl45"),
258 ACT88xx_REG("LDO_REG2", ACT8865, LDO2, VSET), 259 ACT88xx_REG("LDO_REG2", ACT8865, LDO2, VSET, "inl45"),
259 ACT88xx_REG("LDO_REG3", ACT8865, LDO3, VSET), 260 ACT88xx_REG("LDO_REG3", ACT8865, LDO3, VSET, "inl67"),
260 ACT88xx_REG("LDO_REG4", ACT8865, LDO4, VSET), 261 ACT88xx_REG("LDO_REG4", ACT8865, LDO4, VSET, "inl67"),
261}; 262};
262 263
263#ifdef CONFIG_OF 264#ifdef CONFIG_OF