]> Pileus Git - ~andy/linux/commitdiff
regulator: wm831x-ldo: Set up supply names
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 28 Mar 2012 20:40:20 +0000 (21:40 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 23 Apr 2012 19:18:56 +0000 (20:18 +0100)
Allows hookup via normal consumer mechanisms.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/regulator/wm831x-ldo.c

index 5f01040e157490d52fd80d97eb3eeae31a23f88e..344beb8413a3eca5346bd393d33e01de812a9eed 100644 (file)
@@ -25,7 +25,7 @@
 #include <linux/mfd/wm831x/regulator.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_ON_CONTROL    1
@@ -36,6 +36,7 @@
 
 struct wm831x_ldo {
        char name[WM831X_LDO_MAX_NAME];
+       char supply_name[WM831X_LDO_MAX_NAME];
        struct regulator_desc desc;
        int base;
        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);
        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.type = REGULATOR_VOLTAGE;
        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);
        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.type = REGULATOR_VOLTAGE;
        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);
        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.type = REGULATOR_VOLTAGE;
        ldo->desc.n_voltages = WM831X_ALIVE_LDO_MAX_SELECTOR + 1;