Skip to content

Commit af1296d

Browse files
Alina Yubroonie
authored andcommitted
regulator: rtq2208: Add fixed LDO VOUT property and check that matches the constraints
A fixed LDO VOUT property has been added to specify the fixed_uV of the regulator_desc. Additionally, a check has been included in this version to ensure that the fixed_uV matches the constraints. Signed-off-by: Alina Yu <alina_yu@richtek.com> Link: https://msgid.link/r/39357ff9e6e5f3dec5a6f7f833a3591c0defc63a.1716870419.git.alina_yu@richtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 7425999 commit af1296d

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

drivers/regulator/rtq2208-regulator.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@ static int rtq2208_of_get_ldo_dvs_ability(struct device *dev)
350350
struct of_regulator_match *match;
351351
struct regulator_desc *desc;
352352
struct regulator_init_data *init_data;
353+
u32 fixed_uV;
353354
int ret, i;
354355

355356
if (!dev->of_node)
@@ -374,9 +375,15 @@ static int rtq2208_of_get_ldo_dvs_ability(struct device *dev)
374375
if (!init_data || !desc)
375376
continue;
376377

377-
if (init_data->constraints.min_uV == init_data->constraints.max_uV) {
378-
desc->fixed_uV = init_data->constraints.min_uV;
378+
/* specify working fixed voltage if the propery exists */
379+
ret = of_property_read_u32(match->of_node, "richtek,fixed-microvolt", &fixed_uV);
380+
381+
if (!ret) {
382+
if (fixed_uV != init_data->constraints.min_uV ||
383+
fixed_uV != init_data->constraints.max_uV)
384+
return -EINVAL;
379385
desc->n_voltages = 1;
386+
desc->fixed_uV = fixed_uV;
380387
desc->fixed_uV = init_data->constraints.min_uV;
381388
desc->ops = &rtq2208_regulator_ldo_fix_ops;
382389
} else {

0 commit comments

Comments
 (0)