2024-05-16 09:21:12

by Alina Yu

[permalink] [raw]
Subject: [PATCH 1/2] 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 <[email protected]>
---
drivers/regulator/rtq2208-regulator.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/rtq2208-regulator.c b/drivers/regulator/rtq2208-regulator.c
index 39147d6..c2c1689 100644
--- a/drivers/regulator/rtq2208-regulator.c
+++ b/drivers/regulator/rtq2208-regulator.c
@@ -377,6 +377,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)
@@ -401,9 +402,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) {
+ /* 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 = init_data->constraints.min_uV;
+ desc->fixed_uV = fixed_uV;
desc->ops = &rtq2208_regulator_ldo_fix_ops;
} else {
desc->n_voltages = ARRAY_SIZE(rtq2208_ldo_volt_table);
--
2.7.4



2024-05-27 13:05:50

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 1/2] regulator: rtq2208: Add fixed LDO VOUT property and check that matches the constraints

On Thu, May 16, 2024 at 05:20:33PM +0800, Alina Yu wrote:
> 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.

This doesn't apply against current code, please check and resend.


Attachments:
(No filename) (334.00 B)
signature.asc (499.00 B)
Download all attachments

2024-05-28 06:07:57

by Alina Yu

[permalink] [raw]
Subject: Re: [PATCH 1/2] regulator: rtq2208: Add fixed LDO VOUT property and check that matches the constraints

On Mon, May 27, 2024 at 02:00:47PM +0100, Mark Brown wrote:
> On Thu, May 16, 2024 at 05:20:33PM +0800, Alina Yu wrote:
> > 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.
>
> This doesn't apply against current code, please check and resend.

Sorry, I didn't notice these links missed in linux-next tree:

https://lore.kernel.org/all/a1e19b4026d7fea27526ba94c398500a3826b282.1714467553.git.alina_yu@richtek.com/

https://lore.kernel.org/all/ffeecd61c194df1f7f049bd50cb2bbbad3cf1025.1714467553.git.alina_yu@richtek.com/

I have now integrated these missing parts into the resent patches.

Thanks,
Alina