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

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: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

authored by

Tomasz Figa and committed by
Mark Brown
3ec6eb9c 07961ac7

+17 -16
+14 -13
arch/arm/mach-exynos/mach-universal_c210.c
··· 97 97 static struct regulator_consumer_supply max8952_consumer = 98 98 REGULATOR_SUPPLY("vdd_arm", NULL); 99 99 100 + static struct regulator_init_data universal_max8952_reg_data = { 101 + .constraints = { 102 + .name = "VARM_1.2V", 103 + .min_uV = 770000, 104 + .max_uV = 1400000, 105 + .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, 106 + .always_on = 1, 107 + .boot_on = 1, 108 + }, 109 + .num_consumer_supplies = 1, 110 + .consumer_supplies = &max8952_consumer, 111 + }; 112 + 100 113 static struct max8952_platform_data universal_max8952_pdata __initdata = { 101 114 .gpio_vid0 = EXYNOS4_GPX0(3), 102 115 .gpio_vid1 = EXYNOS4_GPX0(4), ··· 118 105 .dvs_mode = { 48, 32, 28, 18 }, /* 1.25, 1.20, 1.05, 0.95V */ 119 106 .sync_freq = 0, /* default: fastest */ 120 107 .ramp_speed = 0, /* default: fastest */ 121 - 122 - .reg_data = { 123 - .constraints = { 124 - .name = "VARM_1.2V", 125 - .min_uV = 770000, 126 - .max_uV = 1400000, 127 - .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, 128 - .always_on = 1, 129 - .boot_on = 1, 130 - }, 131 - .num_consumer_supplies = 1, 132 - .consumer_supplies = &max8952_consumer, 133 - }, 108 + .reg_data = &universal_max8952_reg_data, 134 109 }; 135 110 136 111 static struct regulator_consumer_supply lp3974_buck1_consumer =
+2 -2
drivers/regulator/max8952.c
··· 154 154 max8952->pdata = pdata; 155 155 156 156 config.dev = max8952->dev; 157 - config.init_data = &pdata->reg_data; 157 + config.init_data = pdata->reg_data; 158 158 config.driver_data = max8952; 159 159 160 160 config.ena_gpio = pdata->gpio_en; 161 - if (pdata->reg_data.constraints.boot_on) 161 + if (pdata->reg_data->constraints.boot_on) 162 162 config.ena_gpio_flags |= GPIOF_OUT_INIT_HIGH; 163 163 164 164 max8952->rdev = regulator_register(&regulator, &config);
+1 -1
include/linux/regulator/max8952.h
··· 128 128 u8 sync_freq; 129 129 u8 ramp_speed; 130 130 131 - struct regulator_init_data reg_data; 131 + struct regulator_init_data *reg_data; 132 132 }; 133 133 134 134