regulator: wm831x-ldo: Set up supply names

Allows hookup via normal consumer mechanisms.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
Mark Brown 2012-03-28 21:40:20 +01:00
parent 9db7f05624
commit f1aba13fbd
1 changed files with 17 additions and 1 deletions

View File

@ -25,7 +25,7 @@
#include <linux/mfd/wm831x/regulator.h> #include <linux/mfd/wm831x/regulator.h>
#include <linux/mfd/wm831x/pdata.h> #include <linux/mfd/wm831x/pdata.h>
#define WM831X_LDO_MAX_NAME 6 #define WM831X_LDO_MAX_NAME 9
#define WM831X_LDO_CONTROL 0 #define WM831X_LDO_CONTROL 0
#define WM831X_LDO_ON_CONTROL 1 #define WM831X_LDO_ON_CONTROL 1
@ -36,6 +36,7 @@
struct wm831x_ldo { struct wm831x_ldo {
char name[WM831X_LDO_MAX_NAME]; char name[WM831X_LDO_MAX_NAME];
char supply_name[WM831X_LDO_MAX_NAME];
struct regulator_desc desc; struct regulator_desc desc;
int base; int base;
struct wm831x *wm831x; struct wm831x *wm831x;
@ -345,6 +346,11 @@ static __devinit int wm831x_gp_ldo_probe(struct platform_device *pdev)
snprintf(ldo->name, sizeof(ldo->name), "LDO%d", id + 1); snprintf(ldo->name, sizeof(ldo->name), "LDO%d", id + 1);
ldo->desc.name = ldo->name; ldo->desc.name = ldo->name;
snprintf(ldo->supply_name, sizeof(ldo->supply_name),
"LDO%dVDD", id + 1);
ldo->desc.supply_name = ldo->supply_name;
ldo->desc.id = id; ldo->desc.id = id;
ldo->desc.type = REGULATOR_VOLTAGE; ldo->desc.type = REGULATOR_VOLTAGE;
ldo->desc.n_voltages = WM831X_GP_LDO_MAX_SELECTOR + 1; ldo->desc.n_voltages = WM831X_GP_LDO_MAX_SELECTOR + 1;
@ -614,6 +620,11 @@ static __devinit int wm831x_aldo_probe(struct platform_device *pdev)
snprintf(ldo->name, sizeof(ldo->name), "LDO%d", id + 1); snprintf(ldo->name, sizeof(ldo->name), "LDO%d", id + 1);
ldo->desc.name = ldo->name; ldo->desc.name = ldo->name;
snprintf(ldo->supply_name, sizeof(ldo->supply_name),
"LDO%dVDD", id + 1);
ldo->desc.supply_name = ldo->supply_name;
ldo->desc.id = id; ldo->desc.id = id;
ldo->desc.type = REGULATOR_VOLTAGE; ldo->desc.type = REGULATOR_VOLTAGE;
ldo->desc.n_voltages = WM831X_ALDO_MAX_SELECTOR + 1; ldo->desc.n_voltages = WM831X_ALDO_MAX_SELECTOR + 1;
@ -813,6 +824,11 @@ static __devinit int wm831x_alive_ldo_probe(struct platform_device *pdev)
snprintf(ldo->name, sizeof(ldo->name), "LDO%d", id + 1); snprintf(ldo->name, sizeof(ldo->name), "LDO%d", id + 1);
ldo->desc.name = ldo->name; ldo->desc.name = ldo->name;
snprintf(ldo->supply_name, sizeof(ldo->supply_name),
"LDO%dVDD", id + 1);
ldo->desc.supply_name = ldo->supply_name;
ldo->desc.id = id; ldo->desc.id = id;
ldo->desc.type = REGULATOR_VOLTAGE; ldo->desc.type = REGULATOR_VOLTAGE;
ldo->desc.n_voltages = WM831X_ALIVE_LDO_MAX_SELECTOR + 1; ldo->desc.n_voltages = WM831X_ALIVE_LDO_MAX_SELECTOR + 1;