diff options
author | Bengt Jonsson <bengt.g.jonsson@stericsson.com> | 2010-12-10 05:08:43 -0500 |
---|---|---|
committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2011-01-12 09:33:02 -0500 |
commit | 2b75151a1041f200ee3f36475ba389da43664bb4 (patch) | |
tree | 9ef495b5ce23ebe19a45c2b1a19461958c59f655 /drivers/regulator | |
parent | deaca1ee8250e204cab6ca9390e43ac63b46959c (diff) |
regulators: Added ab8500 v2 support
The AUX3 regulator voltage setting is changed in ab8500 v2 compared
to ab8500 v1. This patch adds v2 support while keeping support for
v1.
Signed-off-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/ab8500.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c index 51ff569384df..9a3dc7973ae1 100644 --- a/drivers/regulator/ab8500.c +++ b/drivers/regulator/ab8500.c | |||
@@ -81,6 +81,17 @@ static const int ldo_vauxn_voltages[] = { | |||
81 | 3300000, | 81 | 3300000, |
82 | }; | 82 | }; |
83 | 83 | ||
84 | static const int ldo_vaux3_voltages[] = { | ||
85 | 1200000, | ||
86 | 1500000, | ||
87 | 1800000, | ||
88 | 2100000, | ||
89 | 2500000, | ||
90 | 2750000, | ||
91 | 2790000, | ||
92 | 2910000, | ||
93 | }; | ||
94 | |||
84 | static const int ldo_vintcore_voltages[] = { | 95 | static const int ldo_vintcore_voltages[] = { |
85 | 1200000, | 96 | 1200000, |
86 | 1225000, | 97 | 1225000, |
@@ -326,8 +337,8 @@ static struct ab8500_regulator_info ab8500_regulator_info[] = { | |||
326 | ldo_vauxn_voltages, ARRAY_SIZE(ldo_vauxn_voltages)), | 337 | ldo_vauxn_voltages, ARRAY_SIZE(ldo_vauxn_voltages)), |
327 | AB8500_LDO(AUX2, 1100, 3300, 0x04, 0x09, 0xc, 0x4, 0x04, 0x20, 0xf, | 338 | AB8500_LDO(AUX2, 1100, 3300, 0x04, 0x09, 0xc, 0x4, 0x04, 0x20, 0xf, |
328 | ldo_vauxn_voltages, ARRAY_SIZE(ldo_vauxn_voltages)), | 339 | ldo_vauxn_voltages, ARRAY_SIZE(ldo_vauxn_voltages)), |
329 | AB8500_LDO(AUX3, 1100, 3300, 0x04, 0x0a, 0x3, 0x1, 0x04, 0x21, 0xf, | 340 | AB8500_LDO(AUX3, 1100, 3300, 0x04, 0x0a, 0x3, 0x1, 0x04, 0x21, 0x7, |
330 | ldo_vauxn_voltages, ARRAY_SIZE(ldo_vauxn_voltages)), | 341 | ldo_vaux3_voltages, ARRAY_SIZE(ldo_vaux3_voltages)), |
331 | AB8500_LDO(INTCORE, 1100, 3300, 0x03, 0x80, 0x44, 0x4, 0x03, 0x80, 0x38, | 342 | AB8500_LDO(INTCORE, 1100, 3300, 0x03, 0x80, 0x44, 0x4, 0x03, 0x80, 0x38, |
332 | ldo_vintcore_voltages, ARRAY_SIZE(ldo_vintcore_voltages)), | 343 | ldo_vintcore_voltages, ARRAY_SIZE(ldo_vintcore_voltages)), |
333 | 344 | ||
@@ -369,6 +380,19 @@ static __devinit int ab8500_regulator_probe(struct platform_device *pdev) | |||
369 | info = &ab8500_regulator_info[i]; | 380 | info = &ab8500_regulator_info[i]; |
370 | info->dev = &pdev->dev; | 381 | info->dev = &pdev->dev; |
371 | 382 | ||
383 | /* fix for hardware before ab8500v2.0 */ | ||
384 | if (abx500_get_chip_id(info->dev) < 0x20) { | ||
385 | if (info->desc.id == AB8500_LDO_AUX3) { | ||
386 | info->desc.n_voltages = | ||
387 | ARRAY_SIZE(ldo_vauxn_voltages); | ||
388 | info->supported_voltages = ldo_vauxn_voltages; | ||
389 | info->voltages_len = | ||
390 | ARRAY_SIZE(ldo_vauxn_voltages); | ||
391 | info->voltage_mask = 0xf; | ||
392 | } | ||
393 | } | ||
394 | |||
395 | /* register regulator with framework */ | ||
372 | info->regulator = regulator_register(&info->desc, &pdev->dev, | 396 | info->regulator = regulator_register(&info->desc, &pdev->dev, |
373 | &pdata->regulator[i], info); | 397 | &pdata->regulator[i], info); |
374 | if (IS_ERR(info->regulator)) { | 398 | if (IS_ERR(info->regulator)) { |