Loading Documentation/devicetree/bindings/regulator/max8925-regulator.txt 0 → 100644 +40 −0 Original line number Diff line number Diff line Max8925 Voltage regulators Required nodes: -nodes: - SDV1 for SDV SDV1 - SDV2 for SDV SDV2 - SDV3 for SDV SDV3 - LDO1 for LDO LDO1 - LDO2 for LDO LDO2 - LDO3 for LDO LDO3 - LDO4 for LDO LDO4 - LDO5 for LDO LDO5 - LDO6 for LDO LDO6 - LDO7 for LDO LDO7 - LDO8 for LDO LDO8 - LDO9 for LDO LDO9 - LDO10 for LDO LDO10 - LDO11 for LDO LDO11 - LDO12 for LDO LDO12 - LDO13 for LDO LDO13 - LDO14 for LDO LDO14 - LDO15 for LDO LDO15 - LDO16 for LDO LDO16 - LDO17 for LDO LDO17 - LDO18 for LDO LDO18 - LDO19 for LDO LDO19 - LDO20 for LDO LDO20 Optional properties: - Any optional property defined in bindings/regulator/regulator.txt Example: SDV1 { regulator-min-microvolt = <637500>; regulator-max-microvolt = <1425000>; regulator-boot-on; regulator-always-on; }; Documentation/devicetree/bindings/regulator/vexpress.txt 0 → 100644 +32 −0 Original line number Diff line number Diff line Versatile Express voltage regulators ------------------------------------ Requires node properties: - "compatible" value: "arm,vexpress-volt" - "arm,vexpress-sysreg,func" when controlled via vexpress-sysreg (see Documentation/devicetree/bindings/arm/vexpress-sysreg.txt for more details) Required regulator properties: - "regulator-name" - "regulator-always-on" Optional regulator properties: - "regulator-min-microvolt" - "regulator-max-microvolt" See Documentation/devicetree/bindings/regulator/regulator.txt for more details about the regulator properties. When no "regulator-[min|max]-microvolt" properties are defined, the device is treated as fixed (or rather "read-only") regulator. Example: volt@0 { compatible = "arm,vexpress-volt"; arm,vexpress-sysreg,func = <2 0>; regulator-name = "Cores"; regulator-min-microvolt = <800000>; regulator-max-microvolt = <1050000>; regulator-always-on; }; drivers/mfd/Kconfig +0 −1 Original line number Diff line number Diff line Loading @@ -201,7 +201,6 @@ config MFD_TPS6586X depends on I2C=y && GENERIC_HARDIRQS select MFD_CORE select REGMAP_I2C depends on REGULATOR help If you say yes here you get support for the TPS6586X series of Power Management chips. Loading drivers/mfd/tps6586x.c +8 −68 Original line number Diff line number Diff line Loading @@ -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> Loading Loading @@ -98,6 +96,9 @@ static struct mfd_cell tps6586x_cell[] = { { .name = "tps6586x-gpio", }, { .name = "tps6586x-pmic", }, { .name = "tps6586x-rtc", }, Loading Loading @@ -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"); Loading drivers/regulator/88pm8607.c +3 −3 Original line number Diff line number Diff line Loading @@ -394,7 +394,7 @@ static int pm8607_regulator_dt_init(struct platform_device *pdev, #define pm8607_regulator_dt_init(x, y, z) (-1) #endif static int __devinit pm8607_regulator_probe(struct platform_device *pdev) static int pm8607_regulator_probe(struct platform_device *pdev) { struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent); struct pm8607_regulator_info *info = NULL; Loading Loading @@ -454,7 +454,7 @@ static int __devinit pm8607_regulator_probe(struct platform_device *pdev) return 0; } static int __devexit pm8607_regulator_remove(struct platform_device *pdev) static int pm8607_regulator_remove(struct platform_device *pdev) { struct pm8607_regulator_info *info = platform_get_drvdata(pdev); Loading @@ -481,7 +481,7 @@ static struct platform_driver pm8607_regulator_driver = { .owner = THIS_MODULE, }, .probe = pm8607_regulator_probe, .remove = __devexit_p(pm8607_regulator_remove), .remove = pm8607_regulator_remove, .id_table = pm8607_regulator_driver_ids, }; Loading Loading
Documentation/devicetree/bindings/regulator/max8925-regulator.txt 0 → 100644 +40 −0 Original line number Diff line number Diff line Max8925 Voltage regulators Required nodes: -nodes: - SDV1 for SDV SDV1 - SDV2 for SDV SDV2 - SDV3 for SDV SDV3 - LDO1 for LDO LDO1 - LDO2 for LDO LDO2 - LDO3 for LDO LDO3 - LDO4 for LDO LDO4 - LDO5 for LDO LDO5 - LDO6 for LDO LDO6 - LDO7 for LDO LDO7 - LDO8 for LDO LDO8 - LDO9 for LDO LDO9 - LDO10 for LDO LDO10 - LDO11 for LDO LDO11 - LDO12 for LDO LDO12 - LDO13 for LDO LDO13 - LDO14 for LDO LDO14 - LDO15 for LDO LDO15 - LDO16 for LDO LDO16 - LDO17 for LDO LDO17 - LDO18 for LDO LDO18 - LDO19 for LDO LDO19 - LDO20 for LDO LDO20 Optional properties: - Any optional property defined in bindings/regulator/regulator.txt Example: SDV1 { regulator-min-microvolt = <637500>; regulator-max-microvolt = <1425000>; regulator-boot-on; regulator-always-on; };
Documentation/devicetree/bindings/regulator/vexpress.txt 0 → 100644 +32 −0 Original line number Diff line number Diff line Versatile Express voltage regulators ------------------------------------ Requires node properties: - "compatible" value: "arm,vexpress-volt" - "arm,vexpress-sysreg,func" when controlled via vexpress-sysreg (see Documentation/devicetree/bindings/arm/vexpress-sysreg.txt for more details) Required regulator properties: - "regulator-name" - "regulator-always-on" Optional regulator properties: - "regulator-min-microvolt" - "regulator-max-microvolt" See Documentation/devicetree/bindings/regulator/regulator.txt for more details about the regulator properties. When no "regulator-[min|max]-microvolt" properties are defined, the device is treated as fixed (or rather "read-only") regulator. Example: volt@0 { compatible = "arm,vexpress-volt"; arm,vexpress-sysreg,func = <2 0>; regulator-name = "Cores"; regulator-min-microvolt = <800000>; regulator-max-microvolt = <1050000>; regulator-always-on; };
drivers/mfd/Kconfig +0 −1 Original line number Diff line number Diff line Loading @@ -201,7 +201,6 @@ config MFD_TPS6586X depends on I2C=y && GENERIC_HARDIRQS select MFD_CORE select REGMAP_I2C depends on REGULATOR help If you say yes here you get support for the TPS6586X series of Power Management chips. Loading
drivers/mfd/tps6586x.c +8 −68 Original line number Diff line number Diff line Loading @@ -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> Loading Loading @@ -98,6 +96,9 @@ static struct mfd_cell tps6586x_cell[] = { { .name = "tps6586x-gpio", }, { .name = "tps6586x-pmic", }, { .name = "tps6586x-rtc", }, Loading Loading @@ -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"); Loading
drivers/regulator/88pm8607.c +3 −3 Original line number Diff line number Diff line Loading @@ -394,7 +394,7 @@ static int pm8607_regulator_dt_init(struct platform_device *pdev, #define pm8607_regulator_dt_init(x, y, z) (-1) #endif static int __devinit pm8607_regulator_probe(struct platform_device *pdev) static int pm8607_regulator_probe(struct platform_device *pdev) { struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent); struct pm8607_regulator_info *info = NULL; Loading Loading @@ -454,7 +454,7 @@ static int __devinit pm8607_regulator_probe(struct platform_device *pdev) return 0; } static int __devexit pm8607_regulator_remove(struct platform_device *pdev) static int pm8607_regulator_remove(struct platform_device *pdev) { struct pm8607_regulator_info *info = platform_get_drvdata(pdev); Loading @@ -481,7 +481,7 @@ static struct platform_driver pm8607_regulator_driver = { .owner = THIS_MODULE, }, .probe = pm8607_regulator_probe, .remove = __devexit_p(pm8607_regulator_remove), .remove = pm8607_regulator_remove, .id_table = pm8607_regulator_driver_ids, }; Loading