summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2012-08-01 14:21:19 +0530
committerSimone Willett <swillett@nvidia.com>2012-08-01 20:00:05 -0700
commitd9b961a08ca88964276824fba2916154b0e7a0ca (patch)
tree9f97765c9437326e47adb4cdd2caacdaeadba8f5
parent1b94c725d9572f8d7713c8a84d59ca3c7996e8b7 (diff)
regulator: tps80031: make regualtor_init_data as pointer type
The platform data of tps80031 have the regualtor_init_data as non-pointer type. Converting this as pointer type for aligning to regulator driver policy and easy support for DT. Change-Id: I07f574953b09e0ed9ec3735d0ee7999ca35bee61 Reviewed-on: http://git-master/r/119974 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
-rw-r--r--arch/arm/mach-tegra/board-enterprise-power.c38
-rw-r--r--drivers/regulator/tps80031-regulator.c2
-rw-r--r--include/linux/regulator/tps80031-regulator.h4
3 files changed, 22 insertions, 22 deletions
diff --git a/arch/arm/mach-tegra/board-enterprise-power.c b/arch/arm/mach-tegra/board-enterprise-power.c
index 1c836d64c74a..b457cda6ace0 100644
--- a/arch/arm/mach-tegra/board-enterprise-power.c
+++ b/arch/arm/mach-tegra/board-enterprise-power.c
@@ -236,26 +236,26 @@ static struct regulator_consumer_supply tps80031_battery_charge_supply[] = {
#define TPS_PDATA_INIT(_id, _sname, _minmv, _maxmv, _supply_reg, _always_on, \
_boot_on, _apply_uv, _init_uV, _init_enable, _init_apply, \
_flags, _ectrl, _delay) \
- static struct tps80031_regulator_platform_data pdata_##_id##_##_sname = { \
- .regulator = { \
- .constraints = { \
- .name = tps80031_rails(_id), \
- .min_uV = (_minmv)*1000, \
- .max_uV = (_maxmv)*1000, \
- .valid_modes_mask = (REGULATOR_MODE_NORMAL | \
- REGULATOR_MODE_STANDBY), \
- .valid_ops_mask = (REGULATOR_CHANGE_MODE | \
- REGULATOR_CHANGE_STATUS | \
- REGULATOR_CHANGE_VOLTAGE), \
- .always_on = _always_on, \
- .boot_on = _boot_on, \
- .apply_uV = _apply_uv, \
- }, \
- .num_consumer_supplies = \
- ARRAY_SIZE(tps80031_##_id##_supply_##_sname), \
- .consumer_supplies = tps80031_##_id##_supply_##_sname, \
- .supply_regulator = _supply_reg, \
+ static struct regulator_init_data reg_idata_##_id##_##_sname = { \
+ .constraints = { \
+ .name = tps80031_rails(_id), \
+ .min_uV = (_minmv)*1000, \
+ .max_uV = (_maxmv)*1000, \
+ .valid_modes_mask = (REGULATOR_MODE_NORMAL | \
+ REGULATOR_MODE_STANDBY), \
+ .valid_ops_mask = (REGULATOR_CHANGE_MODE | \
+ REGULATOR_CHANGE_STATUS | \
+ REGULATOR_CHANGE_VOLTAGE), \
+ .always_on = _always_on, \
+ .boot_on = _boot_on, \
+ .apply_uV = _apply_uv, \
}, \
+ .num_consumer_supplies = \
+ ARRAY_SIZE(tps80031_##_id##_supply_##_sname), \
+ .consumer_supplies = tps80031_##_id##_supply_##_sname, \
+ }; \
+ static struct tps80031_regulator_platform_data pdata_##_id##_##_sname = { \
+ .reg_init_data = &reg_idata_##_id##_##_sname, \
.init_uV = _init_uV * 1000, \
.init_enable = _init_enable, \
.init_apply = _init_apply, \
diff --git a/drivers/regulator/tps80031-regulator.c b/drivers/regulator/tps80031-regulator.c
index b2391c96340d..cb063ae32763 100644
--- a/drivers/regulator/tps80031-regulator.c
+++ b/drivers/regulator/tps80031-regulator.c
@@ -1055,7 +1055,7 @@ static int __devinit tps80031_regulator_probe(struct platform_device *pdev)
return err;
rdev = regulator_register(&ri->desc, &pdev->dev,
- &tps_pdata->regulator, ri);
+ tps_pdata->reg_init_data, ri);
if (IS_ERR_OR_NULL(rdev)) {
dev_err(&pdev->dev, "failed to register regulator %s\n",
ri->desc.name);
diff --git a/include/linux/regulator/tps80031-regulator.h b/include/linux/regulator/tps80031-regulator.h
index 1609eeee6763..4058f7cfa27a 100644
--- a/include/linux/regulator/tps80031-regulator.h
+++ b/include/linux/regulator/tps80031-regulator.h
@@ -66,7 +66,7 @@ enum {
/*
* struct tps80031_regulator_platform_data - tps80031 regulator platform data.
*
- * @regulator: The regulator init data.
+ * @reg_init_data: The regulator init data.
* @init_uV: initial micro volts which need to be set.
* @init_enable: Enable or do not enable the rails during initialization.
* @init_apply: Init parameter applied or not.
@@ -80,7 +80,7 @@ enum {
*/
struct tps80031_regulator_platform_data {
- struct regulator_init_data regulator;
+ struct regulator_init_data *reg_init_data;
int init_uV;
unsigned init_enable:1;
unsigned init_apply:1;