mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
Merge remote-tracking branches 'regulator/topic/core', 'regulator/topic/bypass', 'regulator/topic/tol', 'regulator/topic/drivers' and 'regulator/topic/tps6586x' into regulator-next
This commit is contained in:
commit
6a2027abd2
43 changed files with 1417 additions and 563 deletions
|
|
@ -25,6 +25,7 @@
|
|||
#include <linux/i2c.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/regulator/of_regulator.h>
|
||||
#include <linux/regulator/machine.h>
|
||||
|
||||
#include <linux/mfd/core.h>
|
||||
#include <linux/mfd/tps6586x.h>
|
||||
|
|
@ -346,6 +347,7 @@ failed:
|
|||
|
||||
#ifdef CONFIG_OF
|
||||
static struct of_regulator_match tps6586x_matches[] = {
|
||||
{ .name = "sys", .driver_data = (void *)TPS6586X_ID_SYS },
|
||||
{ .name = "sm0", .driver_data = (void *)TPS6586X_ID_SM_0 },
|
||||
{ .name = "sm1", .driver_data = (void *)TPS6586X_ID_SM_1 },
|
||||
{ .name = "sm2", .driver_data = (void *)TPS6586X_ID_SM_2 },
|
||||
|
|
@ -369,6 +371,7 @@ static struct tps6586x_platform_data *tps6586x_parse_dt(struct i2c_client *clien
|
|||
struct tps6586x_platform_data *pdata;
|
||||
struct tps6586x_subdev_info *devs;
|
||||
struct device_node *regs;
|
||||
const char *sys_rail_name = NULL;
|
||||
unsigned int count;
|
||||
unsigned int i, j;
|
||||
int err;
|
||||
|
|
@ -391,12 +394,22 @@ static struct tps6586x_platform_data *tps6586x_parse_dt(struct i2c_client *clien
|
|||
return NULL;
|
||||
|
||||
for (i = 0, j = 0; i < num && j < count; i++) {
|
||||
struct regulator_init_data *reg_idata;
|
||||
|
||||
if (!tps6586x_matches[i].init_data)
|
||||
continue;
|
||||
|
||||
reg_idata = tps6586x_matches[i].init_data;
|
||||
devs[j].name = "tps6586x-regulator";
|
||||
devs[j].platform_data = tps6586x_matches[i].init_data;
|
||||
devs[j].id = (int)tps6586x_matches[i].driver_data;
|
||||
if (devs[j].id == TPS6586X_ID_SYS)
|
||||
sys_rail_name = reg_idata->constraints.name;
|
||||
|
||||
if ((devs[j].id == TPS6586X_ID_LDO_5) ||
|
||||
(devs[j].id == TPS6586X_ID_LDO_RTC))
|
||||
reg_idata->supply_regulator = sys_rail_name;
|
||||
|
||||
devs[j].of_node = tps6586x_matches[i].of_node;
|
||||
j++;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue