aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/tps62360-regulator.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-12-08 20:42:41 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-08 20:42:41 -0800
commitf94784bdb114439eb3a5e62343826887bbf3f37c (patch)
tree70abbdfed3d3f6c5de6ae320292c51c9eb777b3a /drivers/regulator/tps62360-regulator.c
parentMerge tag 'regmap-v3.19' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap (diff)
parentMerge remote-tracking branches 'regulator/topic/sky81452' and 'regulator/topic/stub' into regulator-next (diff)
downloadlinux-dev-f94784bdb114439eb3a5e62343826887bbf3f37c.tar.xz
linux-dev-f94784bdb114439eb3a5e62343826887bbf3f37c.zip
Merge tag 'regulator-v3.19' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
Pull regulator updates from Mark Brown: "The main thing this time around is support for suspend mode configuration from DT which will enable some very useful power savings on systems where we can't rely on the bootloader configuration. We still don't really support dynamic configuration of this at runtime, that may come later if there is any demand. Summary: - Support for specifying the target regulation mode and voltage during system suspend via DT, enabling power savings in that mode. - Reduce the default verbosity of the logging on boot, improving boot times especially for systems with very large numbers of regulators. - Lots of cleanups and fixes for Maxim PMIC drivers. - New driver for Richtek RT5033" * tag 'regulator-v3.19' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (62 commits) regulator: core: Fix regualtor_ena_gpio_free not to access pin after freeing regulator: sky81452: Modify Device Tree structure regulator: sky81452: Modify Device Tree structure dt-bindings: Update documentation for "system-power-controller" and fix misspellings of: Rename "poweroff-source" property to "system-power-controller" regulator: max77686: Remove support for board files regulator: max77802: Remove support for board files regulator: max77802: Fill regulator modes translation callback regulator: max77802: Document binding for regulator operating modes regulator: of: Add support for parsing initial and suspend modes regulator: of: Pass the regulator description in the match table regulator: of: Add regulator desc param to of_get_regulator_init_data() regulator: Add mode mapping function to struct regulator_desc regulator: Document binding for initial and suspend modes regulator: core: Add PRE_DISABLE notification regulator: gpio: fix parsing of gpio list regulator: rpm: add support for RPM-controller SMB208 regulator: da9063: Do not transform local IRQ to virtual regulator: sky81452: Modify dependent Kconfig symbol regulator: rt5033: Add RT5033 Regulator device driver ...
Diffstat (limited to 'drivers/regulator/tps62360-regulator.c')
-rw-r--r--drivers/regulator/tps62360-regulator.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/drivers/regulator/tps62360-regulator.c b/drivers/regulator/tps62360-regulator.c
index a1672044e519..a1fd626c6c96 100644
--- a/drivers/regulator/tps62360-regulator.c
+++ b/drivers/regulator/tps62360-regulator.c
@@ -293,7 +293,8 @@ static const struct regmap_config tps62360_regmap_config = {
};
static struct tps62360_regulator_platform_data *
- of_get_tps62360_platform_data(struct device *dev)
+ of_get_tps62360_platform_data(struct device *dev,
+ const struct regulator_desc *desc)
{
struct tps62360_regulator_platform_data *pdata;
struct device_node *np = dev->of_node;
@@ -302,7 +303,8 @@ static struct tps62360_regulator_platform_data *
if (!pdata)
return NULL;
- pdata->reg_init_data = of_get_regulator_init_data(dev, dev->of_node);
+ pdata->reg_init_data = of_get_regulator_init_data(dev, dev->of_node,
+ desc);
if (!pdata->reg_init_data) {
dev_err(dev, "Not able to get OF regulator init data\n");
return NULL;
@@ -350,6 +352,17 @@ static int tps62360_probe(struct i2c_client *client,
pdata = dev_get_platdata(&client->dev);
+ tps = devm_kzalloc(&client->dev, sizeof(*tps), GFP_KERNEL);
+ if (!tps)
+ return -ENOMEM;
+
+ tps->desc.name = client->name;
+ tps->desc.id = 0;
+ tps->desc.ops = &tps62360_dcdc_ops;
+ tps->desc.type = REGULATOR_VOLTAGE;
+ tps->desc.owner = THIS_MODULE;
+ tps->desc.uV_step = 10000;
+
if (client->dev.of_node) {
const struct of_device_id *match;
match = of_match_device(of_match_ptr(tps62360_of_match),
@@ -360,7 +373,8 @@ static int tps62360_probe(struct i2c_client *client,
}
chip_id = (int)(long)match->data;
if (!pdata)
- pdata = of_get_tps62360_platform_data(&client->dev);
+ pdata = of_get_tps62360_platform_data(&client->dev,
+ &tps->desc);
} else if (id) {
chip_id = id->driver_data;
} else {
@@ -374,10 +388,6 @@ static int tps62360_probe(struct i2c_client *client,
return -EIO;
}
- tps = devm_kzalloc(&client->dev, sizeof(*tps), GFP_KERNEL);
- if (!tps)
- return -ENOMEM;
-
tps->en_discharge = pdata->en_discharge;
tps->en_internal_pulldn = pdata->en_internal_pulldn;
tps->vsel0_gpio = pdata->vsel0_gpio;
@@ -401,13 +411,6 @@ static int tps62360_probe(struct i2c_client *client,
return -ENODEV;
}
- tps->desc.name = client->name;
- tps->desc.id = 0;
- tps->desc.ops = &tps62360_dcdc_ops;
- tps->desc.type = REGULATOR_VOLTAGE;
- tps->desc.owner = THIS_MODULE;
- tps->desc.uV_step = 10000;
-
tps->regmap = devm_regmap_init_i2c(client, &tps62360_regmap_config);
if (IS_ERR(tps->regmap)) {
ret = PTR_ERR(tps->regmap);