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

Commit 3ec6eb9c authored by Tomasz Figa's avatar Tomasz Figa Committed by Mark Brown
Browse files

regulator: max8952: Separate constraints from platform data struct



This patch modifies platform data structure of max8952 driver to
use pointer to regulator_init_data struct instead of embedding it.

This is a prerequisite for adding Device Tree support for the driver.

Signed-off-by: default avatarTomasz Figa <t.figa@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 07961ac7
Loading
Loading
Loading
Loading
+14 −13
Original line number Diff line number Diff line
@@ -97,16 +97,7 @@ static struct s3c2410_uartcfg universal_uartcfgs[] __initdata = {
static struct regulator_consumer_supply max8952_consumer =
	REGULATOR_SUPPLY("vdd_arm", NULL);

static struct max8952_platform_data universal_max8952_pdata __initdata = {
	.gpio_vid0	= EXYNOS4_GPX0(3),
	.gpio_vid1	= EXYNOS4_GPX0(4),
	.gpio_en	= -1, /* Not controllable, set "Always High" */
	.default_mode	= 0, /* vid0 = 0, vid1 = 0 */
	.dvs_mode	= { 48, 32, 28, 18 }, /* 1.25, 1.20, 1.05, 0.95V */
	.sync_freq	= 0, /* default: fastest */
	.ramp_speed	= 0, /* default: fastest */

	.reg_data	= {
static struct regulator_init_data universal_max8952_reg_data = {
	.constraints	= {
		.name		= "VARM_1.2V",
		.min_uV		= 770000,
@@ -117,7 +108,17 @@ static struct max8952_platform_data universal_max8952_pdata __initdata = {
	},
	.num_consumer_supplies	= 1,
	.consumer_supplies	= &max8952_consumer,
	},
};

static struct max8952_platform_data universal_max8952_pdata __initdata = {
	.gpio_vid0	= EXYNOS4_GPX0(3),
	.gpio_vid1	= EXYNOS4_GPX0(4),
	.gpio_en	= -1, /* Not controllable, set "Always High" */
	.default_mode	= 0, /* vid0 = 0, vid1 = 0 */
	.dvs_mode	= { 48, 32, 28, 18 }, /* 1.25, 1.20, 1.05, 0.95V */
	.sync_freq	= 0, /* default: fastest */
	.ramp_speed	= 0, /* default: fastest */
	.reg_data	= &universal_max8952_reg_data,
};

static struct regulator_consumer_supply lp3974_buck1_consumer =
+2 −2
Original line number Diff line number Diff line
@@ -154,11 +154,11 @@ static int max8952_pmic_probe(struct i2c_client *client,
	max8952->pdata = pdata;

	config.dev = max8952->dev;
	config.init_data = &pdata->reg_data;
	config.init_data = pdata->reg_data;
	config.driver_data = max8952;

	config.ena_gpio = pdata->gpio_en;
	if (pdata->reg_data.constraints.boot_on)
	if (pdata->reg_data->constraints.boot_on)
		config.ena_gpio_flags |= GPIOF_OUT_INIT_HIGH;

	max8952->rdev = regulator_register(&regulator, &config);
+1 −1
Original line number Diff line number Diff line
@@ -128,7 +128,7 @@ struct max8952_platform_data {
	u8 sync_freq;
	u8 ramp_speed;

	struct regulator_init_data reg_data;
	struct regulator_init_data *reg_data;
};