aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/wm831x-ldo.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-03-28 16:40:20 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-04-23 15:18:56 -0400
commitf1aba13fbdcccd36c4ed4b0c1aa910bb05a0fd01 (patch)
treed0181d2e4e6cc23b6ed9d65c9051cf1794b576fb /drivers/regulator/wm831x-ldo.c
parent9db7f05624ffa845400d2bd2bfe5b9793985ce34 (diff)
regulator: wm831x-ldo: Set up supply names
Allows hookup via normal consumer mechanisms. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator/wm831x-ldo.c')
-rw-r--r--drivers/regulator/wm831x-ldo.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/regulator/wm831x-ldo.c b/drivers/regulator/wm831x-ldo.c
index 5f01040e1574..344beb8413a3 100644
--- a/drivers/regulator/wm831x-ldo.c
+++ b/drivers/regulator/wm831x-ldo.c
@@ -25,7 +25,7 @@
25#include <linux/mfd/wm831x/regulator.h> 25#include <linux/mfd/wm831x/regulator.h>
26#include <linux/mfd/wm831x/pdata.h> 26#include <linux/mfd/wm831x/pdata.h>
27 27
28#define WM831X_LDO_MAX_NAME 6 28#define WM831X_LDO_MAX_NAME 9
29 29
30#define WM831X_LDO_CONTROL 0 30#define WM831X_LDO_CONTROL 0
31#define WM831X_LDO_ON_CONTROL 1 31#define WM831X_LDO_ON_CONTROL 1
@@ -36,6 +36,7 @@
36 36
37struct wm831x_ldo { 37struct wm831x_ldo {
38 char name[WM831X_LDO_MAX_NAME]; 38 char name[WM831X_LDO_MAX_NAME];
39 char supply_name[WM831X_LDO_MAX_NAME];
39 struct regulator_desc desc; 40 struct regulator_desc desc;
40 int base; 41 int base;
41 struct wm831x *wm831x; 42 struct wm831x *wm831x;
@@ -345,6 +346,11 @@ static __devinit int wm831x_gp_ldo_probe(struct platform_device *pdev)
345 346
346 snprintf(ldo->name, sizeof(ldo->name), "LDO%d", id + 1); 347 snprintf(ldo->name, sizeof(ldo->name), "LDO%d", id + 1);
347 ldo->desc.name = ldo->name; 348 ldo->desc.name = ldo->name;
349
350 snprintf(ldo->supply_name, sizeof(ldo->supply_name),
351 "LDO%dVDD", id + 1);
352 ldo->desc.supply_name = ldo->supply_name;
353
348 ldo->desc.id = id; 354 ldo->desc.id = id;
349 ldo->desc.type = REGULATOR_VOLTAGE; 355 ldo->desc.type = REGULATOR_VOLTAGE;
350 ldo->desc.n_voltages = WM831X_GP_LDO_MAX_SELECTOR + 1; 356 ldo->desc.n_voltages = WM831X_GP_LDO_MAX_SELECTOR + 1;
@@ -614,6 +620,11 @@ static __devinit int wm831x_aldo_probe(struct platform_device *pdev)
614 620
615 snprintf(ldo->name, sizeof(ldo->name), "LDO%d", id + 1); 621 snprintf(ldo->name, sizeof(ldo->name), "LDO%d", id + 1);
616 ldo->desc.name = ldo->name; 622 ldo->desc.name = ldo->name;
623
624 snprintf(ldo->supply_name, sizeof(ldo->supply_name),
625 "LDO%dVDD", id + 1);
626 ldo->desc.supply_name = ldo->supply_name;
627
617 ldo->desc.id = id; 628 ldo->desc.id = id;
618 ldo->desc.type = REGULATOR_VOLTAGE; 629 ldo->desc.type = REGULATOR_VOLTAGE;
619 ldo->desc.n_voltages = WM831X_ALDO_MAX_SELECTOR + 1; 630 ldo->desc.n_voltages = WM831X_ALDO_MAX_SELECTOR + 1;
@@ -813,6 +824,11 @@ static __devinit int wm831x_alive_ldo_probe(struct platform_device *pdev)
813 824
814 snprintf(ldo->name, sizeof(ldo->name), "LDO%d", id + 1); 825 snprintf(ldo->name, sizeof(ldo->name), "LDO%d", id + 1);
815 ldo->desc.name = ldo->name; 826 ldo->desc.name = ldo->name;
827
828 snprintf(ldo->supply_name, sizeof(ldo->supply_name),
829 "LDO%dVDD", id + 1);
830 ldo->desc.supply_name = ldo->supply_name;
831
816 ldo->desc.id = id; 832 ldo->desc.id = id;
817 ldo->desc.type = REGULATOR_VOLTAGE; 833 ldo->desc.type = REGULATOR_VOLTAGE;
818 ldo->desc.n_voltages = WM831X_ALIVE_LDO_MAX_SELECTOR + 1; 834 ldo->desc.n_voltages = WM831X_ALIVE_LDO_MAX_SELECTOR + 1;