mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
regulator updates for 3.5
The major thing here is the addition of some helpers to factor code out
of drivers, making a fair proportion of regulators much more just data
rather than code which is nice.
- Helpers in the core for regulators using regmap, providing generic
implementations of the enable and voltage selection operations which
just need data to describe them in the drivers.
- Split out voltage mapping and voltage setting, allowing many more
drivers to take advantage of the infrastructure for selectors.
- Loads and loads of cleanups from Axel Lin once again, including many
changes to take advantage of the above new framework features
- New drivers for Ricoh RC5T583, TI TPS62362, TI TPS62363, TI TPS65913,
TI TWL6035 and TI TWL6037.
Some of the registration changes to support the core refactoring caused
so many conflicts that eventually topic branches were abandoned for this
release.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iQIcBAABAgAGBQJPuhn4AAoJEBus8iNuMP3d6m4P/0gNiGbTwDlOgU/mPDyW2jJc
xqvABzlOIQbI28/dgFYO/nA9YWW7VxpEaAPlkg4auk4wQ9tEyEjEqlOCfzymMetY
0k6L4n8LqFsbMAeNQbFPbW7PpWp59oI97J9afJI4kEJmHmOlmlL9U82/TzUFfGrA
yiPlzue+DotKB7FjsymLMbLyeFoiMSOIjVDk8OTs0u1EqeOo4nJG2ODLa+yGo+QW
0yqQExEdIp28WXbkZQtmsOmj2V/uhkKAv2i2PDT2TmlduhNdCGxJsgZIiZCl1R4c
vwirbfb+v93HAxvADdgj8eVdLJXQ0oItxr2ohKt8AgXIBrUJBsMkCQGvulZjRb+a
/A/7Ea3o7HI+PQx4aIP0yGA/eBwbzo/cmBxU+KGzTA9Mov0fnK1kkUs6gfrYBdli
U/TcMizDa1539BrKBIF2gmlRCKx8YD9ic27Zl1x4i5cgAP1gdYgdBYBybKHMpo2+
9Xp1R9C8FvvgytIqJ3QQ34tRomZyQ5iUaIuIuAosoQ6iuF33EQ6I0FvHcIe74iOi
zcu62ZPiuSwg1di9PrTERLcbrS81lvXpOWt5+EorzqoGXWzVIGoTh1F2kWEEMhaD
Q6V5iE03VC0k3tj/MmtTiVkyhNkRElQDtekE9sfm15pdVnpu/+b+iicWJa7QFbZQ
MybS0BBFQKhJXUDttKtS
=UR7s
-----END PGP SIGNATURE-----
Merge tag 'regulator-3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
Pull regulator updates from Mark Brown:
"The major thing here is the addition of some helpers to factor code
out of drivers, making a fair proportion of regulators much more just
data rather than code which is nice.
- Helpers in the core for regulators using regmap, providing generic
implementations of the enable and voltage selection operations which
just need data to describe them in the drivers.
- Split out voltage mapping and voltage setting, allowing many more
drivers to take advantage of the infrastructure for selectors.
- Loads and loads of cleanups from Axel Lin once again, including many
changes to take advantage of the above new framework features
- New drivers for Ricoh RC5T583, TI TPS62362, TI TPS62363, TI
TPS65913, TI TWL6035 and TI TWL6037.
Some of the registration changes to support the core refactoring
caused so many conflicts that eventually topic branches were abandoned
for this release."
* tag 'regulator-3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (227 commits)
regulator: tps65910: use of_node of matched regulator being register
regulator: tps65910: dt: support when "regulators" node found
regulator: tps65910: add error message in case of failure
regulator: tps62360: dt: initialize of_node param for regulator register.
regulator: tps65910: use devm_* for memory allocation
regulator: tps65910: use small letter for regulator names
mfd: tpx6586x: Depend on regulator
regulator: regulator for Palmas Kconfig
regulator: regulator driver for Palmas series chips
regulator: Enable Device Tree for the db8500-prcmu regulator driver
regulator: db8500-prcmu: Separate regulator registration from probe
regulator: ab3100: Use regulator_map_voltage_iterate()
regulator: tps65217: Convert to set_voltage_sel and map_voltage
regulator: Enable the ab8500 for Device Tree
regulator: ab8500: Split up probe() into manageable pieces
regulator: max8925: Remove check_range function and max_uV from struct rc5t583_regulator_info
regulator: max8649: Remove unused check_range() function
regulator: rc5t583: Remove max_uV from struct rc5t583_regulator_info
regulator: da9052: Convert to set_voltage_sel and map_voltage
regulator: max8952: Use devm_kzalloc
...
This commit is contained in:
commit
ac1806572d
74 changed files with 4348 additions and 3274 deletions
|
|
@ -162,6 +162,7 @@ config MFD_TPS6586X
|
|||
bool "TPS6586x Power Management chips"
|
||||
depends on I2C=y && GPIOLIB && GENERIC_HARDIRQS
|
||||
select MFD_CORE
|
||||
depends on REGULATOR
|
||||
help
|
||||
If you say yes here you get support for the TPS6586X series of
|
||||
Power Management chips.
|
||||
|
|
|
|||
|
|
@ -78,17 +78,6 @@ static struct mfd_cell tps65090s[] = {
|
|||
},
|
||||
};
|
||||
|
||||
struct tps65090 {
|
||||
struct mutex lock;
|
||||
struct device *dev;
|
||||
struct i2c_client *client;
|
||||
struct regmap *rmap;
|
||||
struct irq_chip irq_chip;
|
||||
struct mutex irq_lock;
|
||||
int irq_base;
|
||||
unsigned int id;
|
||||
};
|
||||
|
||||
int tps65090_write(struct device *dev, int reg, uint8_t val)
|
||||
{
|
||||
struct tps65090 *tps = dev_get_drvdata(dev);
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
#include <linux/slab.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/regulator/of_regulator.h>
|
||||
|
||||
#include <linux/mfd/core.h>
|
||||
#include <linux/mfd/tps6586x.h>
|
||||
|
|
@ -460,6 +461,7 @@ static int __devinit tps6586x_add_subdevs(struct tps6586x *tps6586x,
|
|||
|
||||
pdev->dev.parent = tps6586x->dev;
|
||||
pdev->dev.platform_data = subdev->platform_data;
|
||||
pdev->dev.of_node = subdev->of_node;
|
||||
|
||||
ret = platform_device_add(pdev);
|
||||
if (ret) {
|
||||
|
|
@ -474,6 +476,86 @@ failed:
|
|||
return ret;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_OF
|
||||
static struct of_regulator_match tps6586x_matches[] = {
|
||||
{ .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;
|
||||
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++) {
|
||||
if (!tps6586x_matches[i].init_data)
|
||||
continue;
|
||||
|
||||
devs[j].name = "tps6586x-regulator";
|
||||
devs[j].platform_data = tps6586x_matches[i].init_data;
|
||||
devs[j].id = (int)tps6586x_matches[i].driver_data;
|
||||
devs[j].of_node = tps6586x_matches[i].of_node;
|
||||
j++;
|
||||
}
|
||||
|
||||
pdata = devm_kzalloc(&client->dev, sizeof(*pdata), GFP_KERNEL);
|
||||
if (!pdata)
|
||||
return NULL;
|
||||
|
||||
pdata->num_subdevs = count;
|
||||
pdata->subdevs = devs;
|
||||
pdata->gpio_base = -1;
|
||||
pdata->irq_base = -1;
|
||||
|
||||
return pdata;
|
||||
}
|
||||
|
||||
static struct of_device_id tps6586x_of_match[] = {
|
||||
{ .compatible = "ti,tps6586x", },
|
||||
{ },
|
||||
};
|
||||
#else
|
||||
static struct tps6586x_platform_data *tps6586x_parse_dt(struct i2c_client *client)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int __devinit tps6586x_i2c_probe(struct i2c_client *client,
|
||||
const struct i2c_device_id *id)
|
||||
{
|
||||
|
|
@ -481,6 +563,9 @@ static int __devinit tps6586x_i2c_probe(struct i2c_client *client,
|
|||
struct tps6586x *tps6586x;
|
||||
int ret;
|
||||
|
||||
if (!pdata && client->dev.of_node)
|
||||
pdata = tps6586x_parse_dt(client);
|
||||
|
||||
if (!pdata) {
|
||||
dev_err(&client->dev, "tps6586x requires platform data\n");
|
||||
return -ENOTSUPP;
|
||||
|
|
@ -573,6 +658,7 @@ static struct i2c_driver tps6586x_driver = {
|
|||
.driver = {
|
||||
.name = "tps6586x",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = of_match_ptr(tps6586x_of_match),
|
||||
},
|
||||
.probe = tps6586x_i2c_probe,
|
||||
.remove = __devexit_p(tps6586x_i2c_remove),
|
||||
|
|
|
|||
|
|
@ -224,13 +224,6 @@
|
|||
#define HIGH_PERF_SQ (1 << 3)
|
||||
#define CK32K_LOWPWR_EN (1 << 7)
|
||||
|
||||
|
||||
/* chip-specific feature flags, for i2c_device_id.driver_data */
|
||||
#define TWL4030_VAUX2 BIT(0) /* pre-5030 voltage ranges */
|
||||
#define TPS_SUBSET BIT(1) /* tps659[23]0 have fewer LDOs */
|
||||
#define TWL5031 BIT(2) /* twl5031 has different registers */
|
||||
#define TWL6030_CLASS BIT(3) /* TWL6030 class */
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
/* is driver active, bound to a chip? */
|
||||
|
|
|
|||
Loading…
Reference in a new issue