Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f1aba13f authored by Mark Brown's avatar Mark Brown
Browse files

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
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -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;