diff options
author | Alina Yu <alina_yu@richtek.com> | 2024-05-28 14:01:15 +0800 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2024-05-29 14:41:13 +0100 |
commit | af1296d15d8907a5aeeeb4ecd3e5878c9a349048 (patch) | |
tree | ad1d48b18a4ed83d4e4aebd7dc1debcb203501c2 /drivers/regulator | |
parent | 74259990b5938dc55fbe2f9b0431d5f370d34b85 (diff) | |
download | linux-af1296d15d8907a5aeeeb4ecd3e5878c9a349048.tar.gz linux-af1296d15d8907a5aeeeb4ecd3e5878c9a349048.tar.bz2 linux-af1296d15d8907a5aeeeb4ecd3e5878c9a349048.zip |
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>
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/rtq2208-regulator.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/regulator/rtq2208-regulator.c b/drivers/regulator/rtq2208-regulator.c index f6afa4e52814..a5c126afc648 100644 --- a/drivers/regulator/rtq2208-regulator.c +++ b/drivers/regulator/rtq2208-regulator.c @@ -350,6 +350,7 @@ static int rtq2208_of_get_ldo_dvs_ability(struct device *dev) struct of_regulator_match *match; struct regulator_desc *desc; struct regulator_init_data *init_data; + u32 fixed_uV; int ret, i; if (!dev->of_node) @@ -374,9 +375,15 @@ static int rtq2208_of_get_ldo_dvs_ability(struct device *dev) if (!init_data || !desc) continue; - if (init_data->constraints.min_uV == init_data->constraints.max_uV) { - desc->fixed_uV = init_data->constraints.min_uV; + /* specify working fixed voltage if the propery exists */ + ret = of_property_read_u32(match->of_node, "richtek,fixed-microvolt", &fixed_uV); + + if (!ret) { + if (fixed_uV != init_data->constraints.min_uV || + fixed_uV != init_data->constraints.max_uV) + return -EINVAL; desc->n_voltages = 1; + desc->fixed_uV = fixed_uV; desc->fixed_uV = init_data->constraints.min_uV; desc->ops = &rtq2208_regulator_ldo_fix_ops; } else { |