summaryrefslogtreecommitdiff
path: root/drivers/mfd/tps6586x.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-12-13 12:04:35 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-13 12:04:35 -0800
commit8b0cab14951fbf8126795ab301835a8f8126a988 (patch)
tree2bf23662944ac9bfcd34d13ef81a6e331266ebf9 /drivers/mfd/tps6586x.c
parentfd62c5450324af7f6cc12897b09b77285cd48a92 (diff)
parent4ffc45c3604dd8e283884ce006faf0e955cbd9e6 (diff)
Merge tag 'regulator-3.8' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
Pull regulator updates from Mark Brown: "A fairly quiet release again, a couple of relatively small new features and a bunch of driver specific work including yet more code elimination and fixes from Axel Lin. - Addidion of linear_min_sel for offsetting linear selectors in the helpers. - Support for continuous voltage ranges for regulators with extremely high resolution. - Drivers for AS3711, DA9055, MAX9873, TPS51632, TPS80031 and ARM vexpress." Fix up trivial conflict (due to typo fix) in palmas-regulator.c * tag 'regulator-3.8' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (80 commits) regulator: core: Fix logic to determinate if regulator can change voltage regulator: s5m8767: Fix to work even if no DVS gpio present regulator: s5m8767: Fix to read the first DVS register. regulator: s5m8767: Fix to work when platform registers less regulators regulator: gpio-regulator: gpio_set_value should use cansleep regulator: gpio-regulator: Fix logical error in for() loop regulator: anatop: Use regulator_[get|set]_voltage_sel_regmap regulator: anatop: Use linear_min_sel with linear mapping regulator: max1586: Implement get_voltage_sel callback regulator: lp8788-buck: Kill _gpio_request function regulator: tps80031: Convert tps80031_ldo_ops to linear_min_sel and list_voltage_linear regulator: lp8788-ldo: Remove val array in lp8788_config_ldo_enable_mode regulator: gpio-regulator: Add ifdef CONFIG_OF guard for regulator_gpio_of_match regulator: palmas: Convert palmas_ops_smps to regulator_[get|set]_voltage_sel_regmap regulator: palmas: Return raw register values as the selectors in [get|set]_voltage_sel regulators: add regulator_can_change_voltage() function regulator: tps51632: Ensure [base|max]_voltage_uV pdata settings are valid regulator: wm831x-dcdc: Add MODULE_ALIAS for wm831x-boostp regulator: wm831x-dcdc: Ensure selected voltage falls within requested range regulator: tps51632: Use linear_min_sel and regulator_[map|list]_voltage_linear ...
Diffstat (limited to 'drivers/mfd/tps6586x.c')
-rw-r--r--drivers/mfd/tps6586x.c76
1 files changed, 8 insertions, 68 deletions
diff --git a/drivers/mfd/tps6586x.c b/drivers/mfd/tps6586x.c
index 9f92c3b22093..87ba7ada3bbc 100644
--- a/drivers/mfd/tps6586x.c
+++ b/drivers/mfd/tps6586x.c
@@ -24,8 +24,6 @@
#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/regmap.h>
-#include <linux/regulator/of_regulator.h>
-#include <linux/regulator/machine.h>
#include <linux/mfd/core.h>
#include <linux/mfd/tps6586x.h>
@@ -99,6 +97,9 @@ static struct mfd_cell tps6586x_cell[] = {
.name = "tps6586x-gpio",
},
{
+ .name = "tps6586x-pmic",
+ },
+ {
.name = "tps6586x-rtc",
},
{
@@ -350,80 +351,19 @@ failed:
}
#ifdef CONFIG_OF
-static struct of_regulator_match tps6586x_matches[] = {
- { .name = "sys", .driver_data = (void *)TPS6586X_ID_SYS },
- { .name = "sm0", .driver_data = (void *)TPS6586X_ID_SM_0 },
- { .name = "sm1", .driver_data = (void *)TPS6586X_ID_SM_1 },
- { .name = "sm2", .driver_data = (void *)TPS6586X_ID_SM_2 },
- { .name = "ldo0", .driver_data = (void *)TPS6586X_ID_LDO_0 },
- { .name = "ldo1", .driver_data = (void *)TPS6586X_ID_LDO_1 },
- { .name = "ldo2", .driver_data = (void *)TPS6586X_ID_LDO_2 },
- { .name = "ldo3", .driver_data = (void *)TPS6586X_ID_LDO_3 },
- { .name = "ldo4", .driver_data = (void *)TPS6586X_ID_LDO_4 },
- { .name = "ldo5", .driver_data = (void *)TPS6586X_ID_LDO_5 },
- { .name = "ldo6", .driver_data = (void *)TPS6586X_ID_LDO_6 },
- { .name = "ldo7", .driver_data = (void *)TPS6586X_ID_LDO_7 },
- { .name = "ldo8", .driver_data = (void *)TPS6586X_ID_LDO_8 },
- { .name = "ldo9", .driver_data = (void *)TPS6586X_ID_LDO_9 },
- { .name = "ldo_rtc", .driver_data = (void *)TPS6586X_ID_LDO_RTC },
-};
-
static struct tps6586x_platform_data *tps6586x_parse_dt(struct i2c_client *client)
{
- const unsigned int num = ARRAY_SIZE(tps6586x_matches);
struct device_node *np = client->dev.of_node;
struct tps6586x_platform_data *pdata;
- struct tps6586x_subdev_info *devs;
- struct device_node *regs;
- const char *sys_rail_name = NULL;
- unsigned int count;
- unsigned int i, j;
- int err;
-
- regs = of_find_node_by_name(np, "regulators");
- if (!regs)
- return NULL;
-
- err = of_regulator_match(&client->dev, regs, tps6586x_matches, num);
- if (err < 0) {
- of_node_put(regs);
- return NULL;
- }
-
- of_node_put(regs);
- count = err;
-
- devs = devm_kzalloc(&client->dev, count * sizeof(*devs), GFP_KERNEL);
- if (!devs)
- return NULL;
-
- for (i = 0, j = 0; i < num && j < count; i++) {
- struct regulator_init_data *reg_idata;
-
- if (!tps6586x_matches[i].init_data)
- continue;
-
- reg_idata = tps6586x_matches[i].init_data;
- devs[j].name = "tps6586x-regulator";
- devs[j].platform_data = tps6586x_matches[i].init_data;
- devs[j].id = (int)tps6586x_matches[i].driver_data;
- if (devs[j].id == TPS6586X_ID_SYS)
- sys_rail_name = reg_idata->constraints.name;
-
- if ((devs[j].id == TPS6586X_ID_LDO_5) ||
- (devs[j].id == TPS6586X_ID_LDO_RTC))
- reg_idata->supply_regulator = sys_rail_name;
-
- devs[j].of_node = tps6586x_matches[i].of_node;
- j++;
- }
pdata = devm_kzalloc(&client->dev, sizeof(*pdata), GFP_KERNEL);
- if (!pdata)
+ if (!pdata) {
+ dev_err(&client->dev, "Memory allocation failed\n");
return NULL;
+ }
- pdata->num_subdevs = count;
- pdata->subdevs = devs;
+ pdata->num_subdevs = 0;
+ pdata->subdevs = NULL;
pdata->gpio_base = -1;
pdata->irq_base = -1;
pdata->pm_off = of_property_read_bool(np, "ti,system-power-controller");