Commit f1aba13f authored by Mark Brown's avatar Mark Brown

regulator: wm831x-ldo: Set up supply names

Allows hookup via normal consumer mechanisms.
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 9db7f056
...@@ -25,7 +25,7 @@ ...@@ -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 @@ ...@@ -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) ...@@ -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) ...@@ -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) ...@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment