Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

regulator: wm831x-ldo: Set up supply names

Allows hookup via normal consumer mechanisms.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

+17 -1
+17 -1
drivers/regulator/wm831x-ldo.c
··· 25 25 #include <linux/mfd/wm831x/regulator.h> 26 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 30 #define WM831X_LDO_CONTROL 0 31 31 #define WM831X_LDO_ON_CONTROL 1 ··· 36 36 37 37 struct wm831x_ldo { 38 38 char name[WM831X_LDO_MAX_NAME]; 39 + char supply_name[WM831X_LDO_MAX_NAME]; 39 40 struct regulator_desc desc; 40 41 int base; 41 42 struct wm831x *wm831x; ··· 346 345 347 346 snprintf(ldo->name, sizeof(ldo->name), "LDO%d", id + 1); 348 347 ldo->desc.name = ldo->name; 348 + 349 + snprintf(ldo->supply_name, sizeof(ldo->supply_name), 350 + "LDO%dVDD", id + 1); 351 + ldo->desc.supply_name = ldo->supply_name; 352 + 349 353 ldo->desc.id = id; 350 354 ldo->desc.type = REGULATOR_VOLTAGE; 351 355 ldo->desc.n_voltages = WM831X_GP_LDO_MAX_SELECTOR + 1; ··· 620 614 621 615 snprintf(ldo->name, sizeof(ldo->name), "LDO%d", id + 1); 622 616 ldo->desc.name = ldo->name; 617 + 618 + snprintf(ldo->supply_name, sizeof(ldo->supply_name), 619 + "LDO%dVDD", id + 1); 620 + ldo->desc.supply_name = ldo->supply_name; 621 + 623 622 ldo->desc.id = id; 624 623 ldo->desc.type = REGULATOR_VOLTAGE; 625 624 ldo->desc.n_voltages = WM831X_ALDO_MAX_SELECTOR + 1; ··· 824 813 825 814 snprintf(ldo->name, sizeof(ldo->name), "LDO%d", id + 1); 826 815 ldo->desc.name = ldo->name; 816 + 817 + snprintf(ldo->supply_name, sizeof(ldo->supply_name), 818 + "LDO%dVDD", id + 1); 819 + ldo->desc.supply_name = ldo->supply_name; 820 + 827 821 ldo->desc.id = id; 828 822 ldo->desc.type = REGULATOR_VOLTAGE; 829 823 ldo->desc.n_voltages = WM831X_ALIVE_LDO_MAX_SELECTOR + 1;