Loading drivers/regulator/core.c +13 −0 Original line number Diff line number Diff line Loading @@ -5053,6 +5053,19 @@ regulator_register(const struct regulator_desc *regulator_desc, init_data = regulator_of_get_init_data(dev, regulator_desc, config, &rdev->dev.of_node); /* * Sometimes not all resources are probed already so we need to take * that into account. This happens most the time if the ena_gpiod comes * from a gpio extender or something else. */ if (PTR_ERR(init_data) == -EPROBE_DEFER) { kfree(config); kfree(rdev); ret = -EPROBE_DEFER; goto rinse; } /* * We need to keep track of any GPIO descriptor coming from the * device tree until we have handled it over to the core. If the Loading drivers/regulator/da9062-regulator.c +47 −71 Original line number Diff line number Diff line Loading @@ -136,7 +136,6 @@ static int da9062_buck_set_mode(struct regulator_dev *rdev, unsigned mode) static unsigned da9062_buck_get_mode(struct regulator_dev *rdev) { struct da9062_regulator *regl = rdev_get_drvdata(rdev); struct regmap_field *field; unsigned int val, mode = 0; int ret; Loading @@ -158,18 +157,7 @@ static unsigned da9062_buck_get_mode(struct regulator_dev *rdev) return REGULATOR_MODE_NORMAL; } /* Detect current regulator state */ ret = regmap_field_read(regl->suspend, &val); if (ret < 0) return 0; /* Read regulator mode from proper register, depending on state */ if (val) field = regl->suspend_sleep; else field = regl->sleep; ret = regmap_field_read(field, &val); ret = regmap_field_read(regl->sleep, &val); if (ret < 0) return 0; Loading Loading @@ -208,21 +196,9 @@ static int da9062_ldo_set_mode(struct regulator_dev *rdev, unsigned mode) static unsigned da9062_ldo_get_mode(struct regulator_dev *rdev) { struct da9062_regulator *regl = rdev_get_drvdata(rdev); struct regmap_field *field; int ret, val; /* Detect current regulator state */ ret = regmap_field_read(regl->suspend, &val); if (ret < 0) return 0; /* Read regulator mode from proper register, depending on state */ if (val) field = regl->suspend_sleep; else field = regl->sleep; ret = regmap_field_read(field, &val); ret = regmap_field_read(regl->sleep, &val); if (ret < 0) return 0; Loading Loading @@ -408,10 +384,10 @@ static const struct da9062_regulator_info local_da9061_regulator_info[] = { __builtin_ffs((int)DA9062AA_BUCK1_MODE_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_BUCK1_MODE_MASK)) - 1), .suspend = REG_FIELD(DA9062AA_DVC_1, __builtin_ffs((int)DA9062AA_VBUCK1_SEL_MASK) - 1, .suspend = REG_FIELD(DA9062AA_BUCK1_CONT, __builtin_ffs((int)DA9062AA_BUCK1_CONF_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_VBUCK1_SEL_MASK)) - 1), __builtin_clz(DA9062AA_BUCK1_CONF_MASK) - 1), }, { .desc.id = DA9061_ID_BUCK2, Loading Loading @@ -444,10 +420,10 @@ static const struct da9062_regulator_info local_da9061_regulator_info[] = { __builtin_ffs((int)DA9062AA_BUCK3_MODE_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_BUCK3_MODE_MASK)) - 1), .suspend = REG_FIELD(DA9062AA_DVC_1, __builtin_ffs((int)DA9062AA_VBUCK3_SEL_MASK) - 1, .suspend = REG_FIELD(DA9062AA_BUCK3_CONT, __builtin_ffs((int)DA9062AA_BUCK3_CONF_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_VBUCK3_SEL_MASK)) - 1), __builtin_clz(DA9062AA_BUCK3_CONF_MASK) - 1), }, { .desc.id = DA9061_ID_BUCK3, Loading Loading @@ -480,10 +456,10 @@ static const struct da9062_regulator_info local_da9061_regulator_info[] = { __builtin_ffs((int)DA9062AA_BUCK4_MODE_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_BUCK4_MODE_MASK)) - 1), .suspend = REG_FIELD(DA9062AA_DVC_1, __builtin_ffs((int)DA9062AA_VBUCK4_SEL_MASK) - 1, .suspend = REG_FIELD(DA9062AA_BUCK4_CONT, __builtin_ffs((int)DA9062AA_BUCK4_CONF_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_VBUCK4_SEL_MASK)) - 1), __builtin_clz(DA9062AA_BUCK4_CONF_MASK) - 1), }, { .desc.id = DA9061_ID_LDO1, Loading @@ -509,10 +485,10 @@ static const struct da9062_regulator_info local_da9061_regulator_info[] = { sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_LDO1_SL_B_MASK)) - 1), .suspend_vsel_reg = DA9062AA_VLDO1_B, .suspend = REG_FIELD(DA9062AA_DVC_1, __builtin_ffs((int)DA9062AA_VLDO1_SEL_MASK) - 1, .suspend = REG_FIELD(DA9062AA_LDO1_CONT, __builtin_ffs((int)DA9062AA_LDO1_CONF_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_VLDO1_SEL_MASK)) - 1), __builtin_clz(DA9062AA_LDO1_CONF_MASK) - 1), .oc_event = REG_FIELD(DA9062AA_STATUS_D, __builtin_ffs((int)DA9062AA_LDO1_ILIM_MASK) - 1, sizeof(unsigned int) * 8 - Loading Loading @@ -542,10 +518,10 @@ static const struct da9062_regulator_info local_da9061_regulator_info[] = { sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_LDO2_SL_B_MASK)) - 1), .suspend_vsel_reg = DA9062AA_VLDO2_B, .suspend = REG_FIELD(DA9062AA_DVC_1, __builtin_ffs((int)DA9062AA_VLDO2_SEL_MASK) - 1, .suspend = REG_FIELD(DA9062AA_LDO2_CONT, __builtin_ffs((int)DA9062AA_LDO2_CONF_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_VLDO2_SEL_MASK)) - 1), __builtin_clz(DA9062AA_LDO2_CONF_MASK) - 1), .oc_event = REG_FIELD(DA9062AA_STATUS_D, __builtin_ffs((int)DA9062AA_LDO2_ILIM_MASK) - 1, sizeof(unsigned int) * 8 - Loading Loading @@ -575,10 +551,10 @@ static const struct da9062_regulator_info local_da9061_regulator_info[] = { sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_LDO3_SL_B_MASK)) - 1), .suspend_vsel_reg = DA9062AA_VLDO3_B, .suspend = REG_FIELD(DA9062AA_DVC_1, __builtin_ffs((int)DA9062AA_VLDO3_SEL_MASK) - 1, .suspend = REG_FIELD(DA9062AA_LDO3_CONT, __builtin_ffs((int)DA9062AA_LDO3_CONF_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_VLDO3_SEL_MASK)) - 1), __builtin_clz(DA9062AA_LDO3_CONF_MASK) - 1), .oc_event = REG_FIELD(DA9062AA_STATUS_D, __builtin_ffs((int)DA9062AA_LDO3_ILIM_MASK) - 1, sizeof(unsigned int) * 8 - Loading Loading @@ -608,10 +584,10 @@ static const struct da9062_regulator_info local_da9061_regulator_info[] = { sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_LDO4_SL_B_MASK)) - 1), .suspend_vsel_reg = DA9062AA_VLDO4_B, .suspend = REG_FIELD(DA9062AA_DVC_1, __builtin_ffs((int)DA9062AA_VLDO4_SEL_MASK) - 1, .suspend = REG_FIELD(DA9062AA_LDO4_CONT, __builtin_ffs((int)DA9062AA_LDO4_CONF_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_VLDO4_SEL_MASK)) - 1), __builtin_clz(DA9062AA_LDO4_CONF_MASK) - 1), .oc_event = REG_FIELD(DA9062AA_STATUS_D, __builtin_ffs((int)DA9062AA_LDO4_ILIM_MASK) - 1, sizeof(unsigned int) * 8 - Loading Loading @@ -652,10 +628,10 @@ static const struct da9062_regulator_info local_da9062_regulator_info[] = { __builtin_ffs((int)DA9062AA_BUCK1_MODE_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_BUCK1_MODE_MASK)) - 1), .suspend = REG_FIELD(DA9062AA_DVC_1, __builtin_ffs((int)DA9062AA_VBUCK1_SEL_MASK) - 1, .suspend = REG_FIELD(DA9062AA_BUCK1_CONT, __builtin_ffs((int)DA9062AA_BUCK1_CONF_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_VBUCK1_SEL_MASK)) - 1), __builtin_clz(DA9062AA_BUCK1_CONF_MASK) - 1), }, { .desc.id = DA9062_ID_BUCK2, Loading Loading @@ -688,10 +664,10 @@ static const struct da9062_regulator_info local_da9062_regulator_info[] = { __builtin_ffs((int)DA9062AA_BUCK2_MODE_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_BUCK2_MODE_MASK)) - 1), .suspend = REG_FIELD(DA9062AA_DVC_1, __builtin_ffs((int)DA9062AA_VBUCK2_SEL_MASK) - 1, .suspend = REG_FIELD(DA9062AA_BUCK2_CONT, __builtin_ffs((int)DA9062AA_BUCK2_CONF_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_VBUCK2_SEL_MASK)) - 1), __builtin_clz(DA9062AA_BUCK2_CONF_MASK) - 1), }, { .desc.id = DA9062_ID_BUCK3, Loading Loading @@ -724,10 +700,10 @@ static const struct da9062_regulator_info local_da9062_regulator_info[] = { __builtin_ffs((int)DA9062AA_BUCK3_MODE_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_BUCK3_MODE_MASK)) - 1), .suspend = REG_FIELD(DA9062AA_DVC_1, __builtin_ffs((int)DA9062AA_VBUCK3_SEL_MASK) - 1, .suspend = REG_FIELD(DA9062AA_BUCK3_CONT, __builtin_ffs((int)DA9062AA_BUCK3_CONF_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_VBUCK3_SEL_MASK)) - 1), __builtin_clz(DA9062AA_BUCK3_CONF_MASK) - 1), }, { .desc.id = DA9062_ID_BUCK4, Loading Loading @@ -760,10 +736,10 @@ static const struct da9062_regulator_info local_da9062_regulator_info[] = { __builtin_ffs((int)DA9062AA_BUCK4_MODE_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_BUCK4_MODE_MASK)) - 1), .suspend = REG_FIELD(DA9062AA_DVC_1, __builtin_ffs((int)DA9062AA_VBUCK4_SEL_MASK) - 1, .suspend = REG_FIELD(DA9062AA_BUCK4_CONT, __builtin_ffs((int)DA9062AA_BUCK4_CONF_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_VBUCK4_SEL_MASK)) - 1), __builtin_clz(DA9062AA_BUCK4_CONF_MASK) - 1), }, { .desc.id = DA9062_ID_LDO1, Loading @@ -789,10 +765,10 @@ static const struct da9062_regulator_info local_da9062_regulator_info[] = { sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_LDO1_SL_B_MASK)) - 1), .suspend_vsel_reg = DA9062AA_VLDO1_B, .suspend = REG_FIELD(DA9062AA_DVC_1, __builtin_ffs((int)DA9062AA_VLDO1_SEL_MASK) - 1, .suspend = REG_FIELD(DA9062AA_LDO1_CONT, __builtin_ffs((int)DA9062AA_LDO1_CONF_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_VLDO1_SEL_MASK)) - 1), __builtin_clz(DA9062AA_LDO1_CONF_MASK) - 1), .oc_event = REG_FIELD(DA9062AA_STATUS_D, __builtin_ffs((int)DA9062AA_LDO1_ILIM_MASK) - 1, sizeof(unsigned int) * 8 - Loading Loading @@ -822,10 +798,10 @@ static const struct da9062_regulator_info local_da9062_regulator_info[] = { sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_LDO2_SL_B_MASK)) - 1), .suspend_vsel_reg = DA9062AA_VLDO2_B, .suspend = REG_FIELD(DA9062AA_DVC_1, __builtin_ffs((int)DA9062AA_VLDO2_SEL_MASK) - 1, .suspend = REG_FIELD(DA9062AA_LDO2_CONT, __builtin_ffs((int)DA9062AA_LDO2_CONF_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_VLDO2_SEL_MASK)) - 1), __builtin_clz(DA9062AA_LDO2_CONF_MASK) - 1), .oc_event = REG_FIELD(DA9062AA_STATUS_D, __builtin_ffs((int)DA9062AA_LDO2_ILIM_MASK) - 1, sizeof(unsigned int) * 8 - Loading Loading @@ -855,10 +831,10 @@ static const struct da9062_regulator_info local_da9062_regulator_info[] = { sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_LDO3_SL_B_MASK)) - 1), .suspend_vsel_reg = DA9062AA_VLDO3_B, .suspend = REG_FIELD(DA9062AA_DVC_1, __builtin_ffs((int)DA9062AA_VLDO3_SEL_MASK) - 1, .suspend = REG_FIELD(DA9062AA_LDO3_CONT, __builtin_ffs((int)DA9062AA_LDO3_CONF_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_VLDO3_SEL_MASK)) - 1), __builtin_clz(DA9062AA_LDO3_CONF_MASK) - 1), .oc_event = REG_FIELD(DA9062AA_STATUS_D, __builtin_ffs((int)DA9062AA_LDO3_ILIM_MASK) - 1, sizeof(unsigned int) * 8 - Loading Loading @@ -888,10 +864,10 @@ static const struct da9062_regulator_info local_da9062_regulator_info[] = { sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_LDO4_SL_B_MASK)) - 1), .suspend_vsel_reg = DA9062AA_VLDO4_B, .suspend = REG_FIELD(DA9062AA_DVC_1, __builtin_ffs((int)DA9062AA_VLDO4_SEL_MASK) - 1, .suspend = REG_FIELD(DA9062AA_LDO4_CONT, __builtin_ffs((int)DA9062AA_LDO4_CONF_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_VLDO4_SEL_MASK)) - 1), __builtin_clz(DA9062AA_LDO4_CONF_MASK) - 1), .oc_event = REG_FIELD(DA9062AA_STATUS_D, __builtin_ffs((int)DA9062AA_LDO4_ILIM_MASK) - 1, sizeof(unsigned int) * 8 - Loading drivers/regulator/fixed.c +2 −3 Original line number Diff line number Diff line Loading @@ -144,8 +144,7 @@ static int reg_fixed_voltage_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct fixed_voltage_config *config; struct fixed_voltage_data *drvdata; const struct fixed_dev_type *drvtype = of_match_device(dev->driver->of_match_table, dev)->data; const struct fixed_dev_type *drvtype = of_device_get_match_data(dev); struct regulator_config cfg = { }; enum gpiod_flags gflags; int ret; Loading Loading @@ -177,7 +176,7 @@ static int reg_fixed_voltage_probe(struct platform_device *pdev) drvdata->desc.type = REGULATOR_VOLTAGE; drvdata->desc.owner = THIS_MODULE; if (drvtype->has_enable_clock) { if (drvtype && drvtype->has_enable_clock) { drvdata->desc.ops = &fixed_voltage_clkenabled_ops; drvdata->enable_clock = devm_clk_get(dev, NULL); Loading drivers/regulator/lochnagar-regulator.c +1 −0 Original line number Diff line number Diff line Loading @@ -210,6 +210,7 @@ static const struct regulator_desc lochnagar_regulators[] = { .enable_time = 3000, .ramp_delay = 1000, .off_on_delay = 15000, .owner = THIS_MODULE, }, Loading drivers/regulator/of_regulator.c +18 −9 Original line number Diff line number Diff line Loading @@ -231,12 +231,12 @@ static int of_get_regulation_constraints(struct device *dev, "regulator-off-in-suspend")) suspend_state->enabled = DISABLE_IN_SUSPEND; if (!of_property_read_u32(np, "regulator-suspend-min-microvolt", &pval)) if (!of_property_read_u32(suspend_np, "regulator-suspend-min-microvolt", &pval)) suspend_state->min_uV = pval; if (!of_property_read_u32(np, "regulator-suspend-max-microvolt", &pval)) if (!of_property_read_u32(suspend_np, "regulator-suspend-max-microvolt", &pval)) suspend_state->max_uV = pval; if (!of_property_read_u32(suspend_np, Loading Loading @@ -445,12 +445,21 @@ struct regulator_init_data *regulator_of_get_init_data(struct device *dev, goto error; } if (desc->of_parse_cb && desc->of_parse_cb(child, desc, config)) { if (desc->of_parse_cb) { int ret; ret = desc->of_parse_cb(child, desc, config); if (ret) { if (ret == -EPROBE_DEFER) { of_node_put(child); return ERR_PTR(-EPROBE_DEFER); } dev_err(dev, "driver callback failed to parse DT for regulator %pOFn\n", child); goto error; } } *node = child; Loading Loading
drivers/regulator/core.c +13 −0 Original line number Diff line number Diff line Loading @@ -5053,6 +5053,19 @@ regulator_register(const struct regulator_desc *regulator_desc, init_data = regulator_of_get_init_data(dev, regulator_desc, config, &rdev->dev.of_node); /* * Sometimes not all resources are probed already so we need to take * that into account. This happens most the time if the ena_gpiod comes * from a gpio extender or something else. */ if (PTR_ERR(init_data) == -EPROBE_DEFER) { kfree(config); kfree(rdev); ret = -EPROBE_DEFER; goto rinse; } /* * We need to keep track of any GPIO descriptor coming from the * device tree until we have handled it over to the core. If the Loading
drivers/regulator/da9062-regulator.c +47 −71 Original line number Diff line number Diff line Loading @@ -136,7 +136,6 @@ static int da9062_buck_set_mode(struct regulator_dev *rdev, unsigned mode) static unsigned da9062_buck_get_mode(struct regulator_dev *rdev) { struct da9062_regulator *regl = rdev_get_drvdata(rdev); struct regmap_field *field; unsigned int val, mode = 0; int ret; Loading @@ -158,18 +157,7 @@ static unsigned da9062_buck_get_mode(struct regulator_dev *rdev) return REGULATOR_MODE_NORMAL; } /* Detect current regulator state */ ret = regmap_field_read(regl->suspend, &val); if (ret < 0) return 0; /* Read regulator mode from proper register, depending on state */ if (val) field = regl->suspend_sleep; else field = regl->sleep; ret = regmap_field_read(field, &val); ret = regmap_field_read(regl->sleep, &val); if (ret < 0) return 0; Loading Loading @@ -208,21 +196,9 @@ static int da9062_ldo_set_mode(struct regulator_dev *rdev, unsigned mode) static unsigned da9062_ldo_get_mode(struct regulator_dev *rdev) { struct da9062_regulator *regl = rdev_get_drvdata(rdev); struct regmap_field *field; int ret, val; /* Detect current regulator state */ ret = regmap_field_read(regl->suspend, &val); if (ret < 0) return 0; /* Read regulator mode from proper register, depending on state */ if (val) field = regl->suspend_sleep; else field = regl->sleep; ret = regmap_field_read(field, &val); ret = regmap_field_read(regl->sleep, &val); if (ret < 0) return 0; Loading Loading @@ -408,10 +384,10 @@ static const struct da9062_regulator_info local_da9061_regulator_info[] = { __builtin_ffs((int)DA9062AA_BUCK1_MODE_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_BUCK1_MODE_MASK)) - 1), .suspend = REG_FIELD(DA9062AA_DVC_1, __builtin_ffs((int)DA9062AA_VBUCK1_SEL_MASK) - 1, .suspend = REG_FIELD(DA9062AA_BUCK1_CONT, __builtin_ffs((int)DA9062AA_BUCK1_CONF_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_VBUCK1_SEL_MASK)) - 1), __builtin_clz(DA9062AA_BUCK1_CONF_MASK) - 1), }, { .desc.id = DA9061_ID_BUCK2, Loading Loading @@ -444,10 +420,10 @@ static const struct da9062_regulator_info local_da9061_regulator_info[] = { __builtin_ffs((int)DA9062AA_BUCK3_MODE_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_BUCK3_MODE_MASK)) - 1), .suspend = REG_FIELD(DA9062AA_DVC_1, __builtin_ffs((int)DA9062AA_VBUCK3_SEL_MASK) - 1, .suspend = REG_FIELD(DA9062AA_BUCK3_CONT, __builtin_ffs((int)DA9062AA_BUCK3_CONF_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_VBUCK3_SEL_MASK)) - 1), __builtin_clz(DA9062AA_BUCK3_CONF_MASK) - 1), }, { .desc.id = DA9061_ID_BUCK3, Loading Loading @@ -480,10 +456,10 @@ static const struct da9062_regulator_info local_da9061_regulator_info[] = { __builtin_ffs((int)DA9062AA_BUCK4_MODE_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_BUCK4_MODE_MASK)) - 1), .suspend = REG_FIELD(DA9062AA_DVC_1, __builtin_ffs((int)DA9062AA_VBUCK4_SEL_MASK) - 1, .suspend = REG_FIELD(DA9062AA_BUCK4_CONT, __builtin_ffs((int)DA9062AA_BUCK4_CONF_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_VBUCK4_SEL_MASK)) - 1), __builtin_clz(DA9062AA_BUCK4_CONF_MASK) - 1), }, { .desc.id = DA9061_ID_LDO1, Loading @@ -509,10 +485,10 @@ static const struct da9062_regulator_info local_da9061_regulator_info[] = { sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_LDO1_SL_B_MASK)) - 1), .suspend_vsel_reg = DA9062AA_VLDO1_B, .suspend = REG_FIELD(DA9062AA_DVC_1, __builtin_ffs((int)DA9062AA_VLDO1_SEL_MASK) - 1, .suspend = REG_FIELD(DA9062AA_LDO1_CONT, __builtin_ffs((int)DA9062AA_LDO1_CONF_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_VLDO1_SEL_MASK)) - 1), __builtin_clz(DA9062AA_LDO1_CONF_MASK) - 1), .oc_event = REG_FIELD(DA9062AA_STATUS_D, __builtin_ffs((int)DA9062AA_LDO1_ILIM_MASK) - 1, sizeof(unsigned int) * 8 - Loading Loading @@ -542,10 +518,10 @@ static const struct da9062_regulator_info local_da9061_regulator_info[] = { sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_LDO2_SL_B_MASK)) - 1), .suspend_vsel_reg = DA9062AA_VLDO2_B, .suspend = REG_FIELD(DA9062AA_DVC_1, __builtin_ffs((int)DA9062AA_VLDO2_SEL_MASK) - 1, .suspend = REG_FIELD(DA9062AA_LDO2_CONT, __builtin_ffs((int)DA9062AA_LDO2_CONF_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_VLDO2_SEL_MASK)) - 1), __builtin_clz(DA9062AA_LDO2_CONF_MASK) - 1), .oc_event = REG_FIELD(DA9062AA_STATUS_D, __builtin_ffs((int)DA9062AA_LDO2_ILIM_MASK) - 1, sizeof(unsigned int) * 8 - Loading Loading @@ -575,10 +551,10 @@ static const struct da9062_regulator_info local_da9061_regulator_info[] = { sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_LDO3_SL_B_MASK)) - 1), .suspend_vsel_reg = DA9062AA_VLDO3_B, .suspend = REG_FIELD(DA9062AA_DVC_1, __builtin_ffs((int)DA9062AA_VLDO3_SEL_MASK) - 1, .suspend = REG_FIELD(DA9062AA_LDO3_CONT, __builtin_ffs((int)DA9062AA_LDO3_CONF_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_VLDO3_SEL_MASK)) - 1), __builtin_clz(DA9062AA_LDO3_CONF_MASK) - 1), .oc_event = REG_FIELD(DA9062AA_STATUS_D, __builtin_ffs((int)DA9062AA_LDO3_ILIM_MASK) - 1, sizeof(unsigned int) * 8 - Loading Loading @@ -608,10 +584,10 @@ static const struct da9062_regulator_info local_da9061_regulator_info[] = { sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_LDO4_SL_B_MASK)) - 1), .suspend_vsel_reg = DA9062AA_VLDO4_B, .suspend = REG_FIELD(DA9062AA_DVC_1, __builtin_ffs((int)DA9062AA_VLDO4_SEL_MASK) - 1, .suspend = REG_FIELD(DA9062AA_LDO4_CONT, __builtin_ffs((int)DA9062AA_LDO4_CONF_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_VLDO4_SEL_MASK)) - 1), __builtin_clz(DA9062AA_LDO4_CONF_MASK) - 1), .oc_event = REG_FIELD(DA9062AA_STATUS_D, __builtin_ffs((int)DA9062AA_LDO4_ILIM_MASK) - 1, sizeof(unsigned int) * 8 - Loading Loading @@ -652,10 +628,10 @@ static const struct da9062_regulator_info local_da9062_regulator_info[] = { __builtin_ffs((int)DA9062AA_BUCK1_MODE_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_BUCK1_MODE_MASK)) - 1), .suspend = REG_FIELD(DA9062AA_DVC_1, __builtin_ffs((int)DA9062AA_VBUCK1_SEL_MASK) - 1, .suspend = REG_FIELD(DA9062AA_BUCK1_CONT, __builtin_ffs((int)DA9062AA_BUCK1_CONF_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_VBUCK1_SEL_MASK)) - 1), __builtin_clz(DA9062AA_BUCK1_CONF_MASK) - 1), }, { .desc.id = DA9062_ID_BUCK2, Loading Loading @@ -688,10 +664,10 @@ static const struct da9062_regulator_info local_da9062_regulator_info[] = { __builtin_ffs((int)DA9062AA_BUCK2_MODE_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_BUCK2_MODE_MASK)) - 1), .suspend = REG_FIELD(DA9062AA_DVC_1, __builtin_ffs((int)DA9062AA_VBUCK2_SEL_MASK) - 1, .suspend = REG_FIELD(DA9062AA_BUCK2_CONT, __builtin_ffs((int)DA9062AA_BUCK2_CONF_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_VBUCK2_SEL_MASK)) - 1), __builtin_clz(DA9062AA_BUCK2_CONF_MASK) - 1), }, { .desc.id = DA9062_ID_BUCK3, Loading Loading @@ -724,10 +700,10 @@ static const struct da9062_regulator_info local_da9062_regulator_info[] = { __builtin_ffs((int)DA9062AA_BUCK3_MODE_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_BUCK3_MODE_MASK)) - 1), .suspend = REG_FIELD(DA9062AA_DVC_1, __builtin_ffs((int)DA9062AA_VBUCK3_SEL_MASK) - 1, .suspend = REG_FIELD(DA9062AA_BUCK3_CONT, __builtin_ffs((int)DA9062AA_BUCK3_CONF_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_VBUCK3_SEL_MASK)) - 1), __builtin_clz(DA9062AA_BUCK3_CONF_MASK) - 1), }, { .desc.id = DA9062_ID_BUCK4, Loading Loading @@ -760,10 +736,10 @@ static const struct da9062_regulator_info local_da9062_regulator_info[] = { __builtin_ffs((int)DA9062AA_BUCK4_MODE_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_BUCK4_MODE_MASK)) - 1), .suspend = REG_FIELD(DA9062AA_DVC_1, __builtin_ffs((int)DA9062AA_VBUCK4_SEL_MASK) - 1, .suspend = REG_FIELD(DA9062AA_BUCK4_CONT, __builtin_ffs((int)DA9062AA_BUCK4_CONF_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_VBUCK4_SEL_MASK)) - 1), __builtin_clz(DA9062AA_BUCK4_CONF_MASK) - 1), }, { .desc.id = DA9062_ID_LDO1, Loading @@ -789,10 +765,10 @@ static const struct da9062_regulator_info local_da9062_regulator_info[] = { sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_LDO1_SL_B_MASK)) - 1), .suspend_vsel_reg = DA9062AA_VLDO1_B, .suspend = REG_FIELD(DA9062AA_DVC_1, __builtin_ffs((int)DA9062AA_VLDO1_SEL_MASK) - 1, .suspend = REG_FIELD(DA9062AA_LDO1_CONT, __builtin_ffs((int)DA9062AA_LDO1_CONF_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_VLDO1_SEL_MASK)) - 1), __builtin_clz(DA9062AA_LDO1_CONF_MASK) - 1), .oc_event = REG_FIELD(DA9062AA_STATUS_D, __builtin_ffs((int)DA9062AA_LDO1_ILIM_MASK) - 1, sizeof(unsigned int) * 8 - Loading Loading @@ -822,10 +798,10 @@ static const struct da9062_regulator_info local_da9062_regulator_info[] = { sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_LDO2_SL_B_MASK)) - 1), .suspend_vsel_reg = DA9062AA_VLDO2_B, .suspend = REG_FIELD(DA9062AA_DVC_1, __builtin_ffs((int)DA9062AA_VLDO2_SEL_MASK) - 1, .suspend = REG_FIELD(DA9062AA_LDO2_CONT, __builtin_ffs((int)DA9062AA_LDO2_CONF_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_VLDO2_SEL_MASK)) - 1), __builtin_clz(DA9062AA_LDO2_CONF_MASK) - 1), .oc_event = REG_FIELD(DA9062AA_STATUS_D, __builtin_ffs((int)DA9062AA_LDO2_ILIM_MASK) - 1, sizeof(unsigned int) * 8 - Loading Loading @@ -855,10 +831,10 @@ static const struct da9062_regulator_info local_da9062_regulator_info[] = { sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_LDO3_SL_B_MASK)) - 1), .suspend_vsel_reg = DA9062AA_VLDO3_B, .suspend = REG_FIELD(DA9062AA_DVC_1, __builtin_ffs((int)DA9062AA_VLDO3_SEL_MASK) - 1, .suspend = REG_FIELD(DA9062AA_LDO3_CONT, __builtin_ffs((int)DA9062AA_LDO3_CONF_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_VLDO3_SEL_MASK)) - 1), __builtin_clz(DA9062AA_LDO3_CONF_MASK) - 1), .oc_event = REG_FIELD(DA9062AA_STATUS_D, __builtin_ffs((int)DA9062AA_LDO3_ILIM_MASK) - 1, sizeof(unsigned int) * 8 - Loading Loading @@ -888,10 +864,10 @@ static const struct da9062_regulator_info local_da9062_regulator_info[] = { sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_LDO4_SL_B_MASK)) - 1), .suspend_vsel_reg = DA9062AA_VLDO4_B, .suspend = REG_FIELD(DA9062AA_DVC_1, __builtin_ffs((int)DA9062AA_VLDO4_SEL_MASK) - 1, .suspend = REG_FIELD(DA9062AA_LDO4_CONT, __builtin_ffs((int)DA9062AA_LDO4_CONF_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_VLDO4_SEL_MASK)) - 1), __builtin_clz(DA9062AA_LDO4_CONF_MASK) - 1), .oc_event = REG_FIELD(DA9062AA_STATUS_D, __builtin_ffs((int)DA9062AA_LDO4_ILIM_MASK) - 1, sizeof(unsigned int) * 8 - Loading
drivers/regulator/fixed.c +2 −3 Original line number Diff line number Diff line Loading @@ -144,8 +144,7 @@ static int reg_fixed_voltage_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct fixed_voltage_config *config; struct fixed_voltage_data *drvdata; const struct fixed_dev_type *drvtype = of_match_device(dev->driver->of_match_table, dev)->data; const struct fixed_dev_type *drvtype = of_device_get_match_data(dev); struct regulator_config cfg = { }; enum gpiod_flags gflags; int ret; Loading Loading @@ -177,7 +176,7 @@ static int reg_fixed_voltage_probe(struct platform_device *pdev) drvdata->desc.type = REGULATOR_VOLTAGE; drvdata->desc.owner = THIS_MODULE; if (drvtype->has_enable_clock) { if (drvtype && drvtype->has_enable_clock) { drvdata->desc.ops = &fixed_voltage_clkenabled_ops; drvdata->enable_clock = devm_clk_get(dev, NULL); Loading
drivers/regulator/lochnagar-regulator.c +1 −0 Original line number Diff line number Diff line Loading @@ -210,6 +210,7 @@ static const struct regulator_desc lochnagar_regulators[] = { .enable_time = 3000, .ramp_delay = 1000, .off_on_delay = 15000, .owner = THIS_MODULE, }, Loading
drivers/regulator/of_regulator.c +18 −9 Original line number Diff line number Diff line Loading @@ -231,12 +231,12 @@ static int of_get_regulation_constraints(struct device *dev, "regulator-off-in-suspend")) suspend_state->enabled = DISABLE_IN_SUSPEND; if (!of_property_read_u32(np, "regulator-suspend-min-microvolt", &pval)) if (!of_property_read_u32(suspend_np, "regulator-suspend-min-microvolt", &pval)) suspend_state->min_uV = pval; if (!of_property_read_u32(np, "regulator-suspend-max-microvolt", &pval)) if (!of_property_read_u32(suspend_np, "regulator-suspend-max-microvolt", &pval)) suspend_state->max_uV = pval; if (!of_property_read_u32(suspend_np, Loading Loading @@ -445,12 +445,21 @@ struct regulator_init_data *regulator_of_get_init_data(struct device *dev, goto error; } if (desc->of_parse_cb && desc->of_parse_cb(child, desc, config)) { if (desc->of_parse_cb) { int ret; ret = desc->of_parse_cb(child, desc, config); if (ret) { if (ret == -EPROBE_DEFER) { of_node_put(child); return ERR_PTR(-EPROBE_DEFER); } dev_err(dev, "driver callback failed to parse DT for regulator %pOFn\n", child); goto error; } } *node = child; Loading