aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Figa <t.figa@samsung.com>2013-04-04 12:17:19 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-04-05 06:20:51 -0400
commit3ec6eb9cc2dbfa5b626f813ab8077eb71da60af2 (patch)
tree42ec316c65ac16f27371cd9300d35ec28bc24cfc
parent07961ac7c0ee8b546658717034fe692fd12eefa9 (diff)
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>
-rw-r--r--arch/arm/mach-exynos/mach-universal_c210.c27
-rw-r--r--drivers/regulator/max8952.c4
-rw-r--r--include/linux/regulator/max8952.h2
3 files changed, 17 insertions, 16 deletions
diff --git a/arch/arm/mach-exynos/mach-universal_c210.c b/arch/arm/mach-exynos/mach-universal_c210.c
index 497fcb793dc1..d28c7fbaba2d 100644
--- a/arch/arm/mach-exynos/mach-universal_c210.c
+++ b/arch/arm/mach-exynos/mach-universal_c210.c
@@ -97,6 +97,19 @@ static struct s3c2410_uartcfg universal_uartcfgs[] __initdata = {
97static struct regulator_consumer_supply max8952_consumer = 97static struct regulator_consumer_supply max8952_consumer =
98 REGULATOR_SUPPLY("vdd_arm", NULL); 98 REGULATOR_SUPPLY("vdd_arm", NULL);
99 99
100static 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
100static struct max8952_platform_data universal_max8952_pdata __initdata = { 113static struct max8952_platform_data universal_max8952_pdata __initdata = {
101 .gpio_vid0 = EXYNOS4_GPX0(3), 114 .gpio_vid0 = EXYNOS4_GPX0(3),
102 .gpio_vid1 = EXYNOS4_GPX0(4), 115 .gpio_vid1 = EXYNOS4_GPX0(4),
@@ -105,19 +118,7 @@ static struct max8952_platform_data universal_max8952_pdata __initdata = {
105 .dvs_mode = { 48, 32, 28, 18 }, /* 1.25, 1.20, 1.05, 0.95V */ 118 .dvs_mode = { 48, 32, 28, 18 }, /* 1.25, 1.20, 1.05, 0.95V */
106 .sync_freq = 0, /* default: fastest */ 119 .sync_freq = 0, /* default: fastest */
107 .ramp_speed = 0, /* default: fastest */ 120 .ramp_speed = 0, /* default: fastest */
108 121 .reg_data = &universal_max8952_reg_data,
109 .reg_data = {
110 .constraints = {
111 .name = "VARM_1.2V",
112 .min_uV = 770000,
113 .max_uV = 1400000,
114 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
115 .always_on = 1,
116 .boot_on = 1,
117 },
118 .num_consumer_supplies = 1,
119 .consumer_supplies = &max8952_consumer,
120 },
121}; 122};
122 123
123static struct regulator_consumer_supply lp3974_buck1_consumer = 124static struct regulator_consumer_supply lp3974_buck1_consumer =
diff --git a/drivers/regulator/max8952.c b/drivers/regulator/max8952.c
index fc7935a19e3a..100b9177dba1 100644
--- a/drivers/regulator/max8952.c
+++ b/drivers/regulator/max8952.c
@@ -154,11 +154,11 @@ static int max8952_pmic_probe(struct i2c_client *client,
154 max8952->pdata = pdata; 154 max8952->pdata = pdata;
155 155
156 config.dev = max8952->dev; 156 config.dev = max8952->dev;
157 config.init_data = &pdata->reg_data; 157 config.init_data = pdata->reg_data;
158 config.driver_data = max8952; 158 config.driver_data = max8952;
159 159
160 config.ena_gpio = pdata->gpio_en; 160 config.ena_gpio = pdata->gpio_en;
161 if (pdata->reg_data.constraints.boot_on) 161 if (pdata->reg_data->constraints.boot_on)
162 config.ena_gpio_flags |= GPIOF_OUT_INIT_HIGH; 162 config.ena_gpio_flags |= GPIOF_OUT_INIT_HIGH;
163 163
164 max8952->rdev = regulator_register(&regulator, &config); 164 max8952->rdev = regulator_register(&regulator, &config);
diff --git a/include/linux/regulator/max8952.h b/include/linux/regulator/max8952.h
index 45e42855ad05..c13aa34d9019 100644
--- a/include/linux/regulator/max8952.h
+++ b/include/linux/regulator/max8952.h
@@ -128,7 +128,7 @@ struct max8952_platform_data {
128 u8 sync_freq; 128 u8 sync_freq;
129 u8 ramp_speed; 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