Commit 4992fa1f authored by Mark Brown's avatar Mark Brown

Merge tag 'topic/twl' into regulator-next

TWL specific changes, cross-merged with OMAP due to arch/arm wanting to
use the new ability to override the voltage set and get operations to
support the in-CPU voltage management.  The other changes are minor
fixes, the addition of a few new regulators and device tree support.
parents 115e4bfd 46eda3e9
TWL family of regulators
Required properties:
For twl6030 regulators/LDOs
- compatible:
- "ti,twl6030-vaux1" for VAUX1 LDO
- "ti,twl6030-vaux2" for VAUX2 LDO
- "ti,twl6030-vaux3" for VAUX3 LDO
- "ti,twl6030-vmmc" for VMMC LDO
- "ti,twl6030-vpp" for VPP LDO
- "ti,twl6030-vusim" for VUSIM LDO
- "ti,twl6030-vana" for VANA LDO
- "ti,twl6030-vcxio" for VCXIO LDO
- "ti,twl6030-vdac" for VDAC LDO
- "ti,twl6030-vusb" for VUSB LDO
- "ti,twl6030-v1v8" for V1V8 LDO
- "ti,twl6030-v2v1" for V2V1 LDO
- "ti,twl6030-clk32kg" for CLK32KG RESOURCE
- "ti,twl6030-vdd1" for VDD1 SMPS
- "ti,twl6030-vdd2" for VDD2 SMPS
- "ti,twl6030-vdd3" for VDD3 SMPS
For twl6025 regulators/LDOs
- compatible:
- "ti,twl6025-ldo1" for LDO1 LDO
- "ti,twl6025-ldo2" for LDO2 LDO
- "ti,twl6025-ldo3" for LDO3 LDO
- "ti,twl6025-ldo4" for LDO4 LDO
- "ti,twl6025-ldo5" for LDO5 LDO
- "ti,twl6025-ldo6" for LDO6 LDO
- "ti,twl6025-ldo7" for LDO7 LDO
- "ti,twl6025-ldoln" for LDOLN LDO
- "ti,twl6025-ldousb" for LDOUSB LDO
- "ti,twl6025-smps3" for SMPS3 SMPS
- "ti,twl6025-smps4" for SMPS4 SMPS
- "ti,twl6025-vio" for VIO SMPS
For twl4030 regulators/LDOs
- compatible:
- "ti,twl4030-vaux1" for VAUX1 LDO
- "ti,twl4030-vaux2" for VAUX2 LDO
- "ti,twl5030-vaux2" for VAUX2 LDO
- "ti,twl4030-vaux3" for VAUX3 LDO
- "ti,twl4030-vaux4" for VAUX4 LDO
- "ti,twl4030-vmmc1" for VMMC1 LDO
- "ti,twl4030-vmmc2" for VMMC2 LDO
- "ti,twl4030-vpll1" for VPLL1 LDO
- "ti,twl4030-vpll2" for VPLL2 LDO
- "ti,twl4030-vsim" for VSIM LDO
- "ti,twl4030-vdac" for VDAC LDO
- "ti,twl4030-vintana2" for VINTANA2 LDO
- "ti,twl4030-vio" for VIO LDO
- "ti,twl4030-vdd1" for VDD1 SMPS
- "ti,twl4030-vdd2" for VDD2 SMPS
- "ti,twl4030-vintana1" for VINTANA1 LDO
- "ti,twl4030-vintdig" for VINTDIG LDO
- "ti,twl4030-vusb1v5" for VUSB1V5 LDO
- "ti,twl4030-vusb1v8" for VUSB1V8 LDO
- "ti,twl4030-vusb3v1" for VUSB3V1 LDO
Optional properties:
- Any optional property defined in bindings/regulator/regulator.txt
Example:
xyz: regulator@0 {
compatible = "ti,twl6030-vaux1";
regulator-min-microvolt = <1000000>;
regulator-max-microvolt = <3000000>;
};
......@@ -621,6 +621,8 @@ add_regulator_linked(int num, struct regulator_init_data *pdata,
unsigned num_consumers, unsigned long features)
{
unsigned sub_chip_id;
struct twl_regulator_driver_data drv_data;
/* regulator framework demands init_data ... */
if (!pdata)
return NULL;
......@@ -630,7 +632,19 @@ add_regulator_linked(int num, struct regulator_init_data *pdata,
pdata->num_consumer_supplies = num_consumers;
}
pdata->driver_data = (void *)features;
if (pdata->driver_data) {
/* If we have existing drv_data, just add the flags */
struct twl_regulator_driver_data *tmp;
tmp = pdata->driver_data;
tmp->features |= features;
} else {
/* add new driver data struct, used only during init */
drv_data.features = features;
drv_data.set_voltage = NULL;
drv_data.get_voltage = NULL;
drv_data.data = NULL;
pdata->driver_data = &drv_data;
}
/* NOTE: we currently ignore regulator IRQs, e.g. for short circuits */
sub_chip_id = twl_map[TWL_MODULE_PM_MASTER].sid;
......@@ -937,6 +951,31 @@ add_children(struct twl4030_platform_data *pdata, unsigned long features)
/* twl6030 regulators */
if (twl_has_regulator() && twl_class_is_6030() &&
!(features & TWL6025_SUBCLASS)) {
child = add_regulator(TWL6030_REG_VDD1, pdata->vdd1,
features);
if (IS_ERR(child))
return PTR_ERR(child);
child = add_regulator(TWL6030_REG_VDD2, pdata->vdd2,
features);
if (IS_ERR(child))
return PTR_ERR(child);
child = add_regulator(TWL6030_REG_VDD3, pdata->vdd3,
features);
if (IS_ERR(child))
return PTR_ERR(child);
child = add_regulator(TWL6030_REG_V1V8, pdata->v1v8,
features);
if (IS_ERR(child))
return PTR_ERR(child);
child = add_regulator(TWL6030_REG_V2V1, pdata->v2v1,
features);
if (IS_ERR(child))
return PTR_ERR(child);
child = add_regulator(TWL6030_REG_VMMC, pdata->vmmc,
features);
if (IS_ERR(child))
......
This diff is collapsed.
......@@ -712,6 +712,9 @@ struct twl4030_platform_data {
struct regulator_init_data *vaux1;
struct regulator_init_data *vaux2;
struct regulator_init_data *vaux3;
struct regulator_init_data *vdd1;
struct regulator_init_data *vdd2;
struct regulator_init_data *vdd3;
/* TWL4030 LDO regulators */
struct regulator_init_data *vpll1;
struct regulator_init_data *vpll2;
......@@ -720,8 +723,6 @@ struct twl4030_platform_data {
struct regulator_init_data *vsim;
struct regulator_init_data *vaux4;
struct regulator_init_data *vio;
struct regulator_init_data *vdd1;
struct regulator_init_data *vdd2;
struct regulator_init_data *vintana1;
struct regulator_init_data *vintana2;
struct regulator_init_data *vintdig;
......@@ -733,6 +734,8 @@ struct twl4030_platform_data {
struct regulator_init_data *vcxio;
struct regulator_init_data *vusb;
struct regulator_init_data *clk32kg;
struct regulator_init_data *v1v8;
struct regulator_init_data *v2v1;
/* TWL6025 LDO regulators */
struct regulator_init_data *ldo1;
struct regulator_init_data *ldo2;
......@@ -749,6 +752,13 @@ struct twl4030_platform_data {
struct regulator_init_data *vio6025;
};
struct twl_regulator_driver_data {
int (*set_voltage)(void *data, int target_uV);
int (*get_voltage)(void *data);
void *data;
unsigned long features;
};
/*----------------------------------------------------------------------*/
int twl4030_sih_setup(int module);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment