* [PATCH 0/2] Add specified fixed LDO VOUT propery
@ 2024-05-16 9:20 Alina Yu
2024-05-16 9:20 ` [PATCH 1/2] regulator: rtq2208: Add fixed LDO VOUT property and check that matches the constraints Alina Yu
2024-05-16 9:20 ` [PATCH 2/2] regulator: dt-bindings: rtq2208: Add specified fixed LDO VOUT property Alina Yu
0 siblings, 2 replies; 12+ messages in thread
From: Alina Yu @ 2024-05-16 9:20 UTC (permalink / raw)
To: lgirdwood, broonie, robh+dt, krzysztof.kozlowski+dt, conor+dt
Cc: linux-kernel, devicetree, alina_yu, cy_huang
Hi,
There are two types of LDO VOUT: fixed voltage mode and adjustable voltage mode.
As the fixed voltage for the LDO is outside the range of the adjustable voltage mode,
the constraints for this scenario are not suitable to represent both modes.
Therefore, A property is added to specify the fixed LDO VOUT.
Alina Yu (2):
regulator: rtq2208: Add fixed LDO VOUT property and check that matches
the constraints
regulator: dt-bindings: rtq2208: Add specified fixed LDO VOUT property
.../devicetree/bindings/regulator/richtek,rtq2208.yaml | 11 ++++++++++-
drivers/regulator/rtq2208-regulator.c | 11 +++++++++--
2 files changed, 19 insertions(+), 3 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 1/2] regulator: rtq2208: Add fixed LDO VOUT property and check that matches the constraints
2024-05-16 9:20 [PATCH 0/2] Add specified fixed LDO VOUT propery Alina Yu
@ 2024-05-16 9:20 ` Alina Yu
2024-05-27 13:00 ` Mark Brown
2024-05-16 9:20 ` [PATCH 2/2] regulator: dt-bindings: rtq2208: Add specified fixed LDO VOUT property Alina Yu
1 sibling, 1 reply; 12+ messages in thread
From: Alina Yu @ 2024-05-16 9:20 UTC (permalink / raw)
To: lgirdwood, broonie, robh+dt, krzysztof.kozlowski+dt, conor+dt
Cc: linux-kernel, devicetree, alina_yu, cy_huang
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>
---
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
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 2/2] regulator: dt-bindings: rtq2208: Add specified fixed LDO VOUT property
2024-05-16 9:20 [PATCH 0/2] Add specified fixed LDO VOUT propery Alina Yu
2024-05-16 9:20 ` [PATCH 1/2] regulator: rtq2208: Add fixed LDO VOUT property and check that matches the constraints Alina Yu
@ 2024-05-16 9:20 ` Alina Yu
2024-05-16 12:34 ` Krzysztof Kozlowski
1 sibling, 1 reply; 12+ messages in thread
From: Alina Yu @ 2024-05-16 9:20 UTC (permalink / raw)
To: lgirdwood, broonie, robh+dt, krzysztof.kozlowski+dt, conor+dt
Cc: linux-kernel, devicetree, alina_yu, cy_huang
As the fixed voltage for the LDO is outside the range of the adjustable voltage mode,
the constraints for this scenario are not suitable to represent both modes.
Therefore, A property is added to specify the fixed LDO VOUT.
Examples of fixed LDO VOUT and adjustable LDO VOUT is also added to this version.
Signed-off-by: Alina Yu <alina_yu@richtek.com>
---
.../devicetree/bindings/regulator/richtek,rtq2208.yaml | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml b/Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml
index 609c066..87accc6 100644
--- a/Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml
+++ b/Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml
@@ -75,6 +75,12 @@ properties:
description:
regulator description for ldo[1-2].
+ properties:
+ richtek,fixed-microvolt:
+ description: |
+ This property can be used to set a fixed operating voltage that lies outside
+ the range of the regulator's adjustable mode.
+
required:
- compatible
- reg
@@ -177,6 +183,8 @@ examples:
};
};
ldo1 {
+ /* Fixed LDO VOUT */
+ richtek,fixed-microvolt = <1200000>;
regulator-min-microvolt = <1200000>;
regulator-max-microvolt = <1200000>;
regulator-always-on;
@@ -185,7 +193,8 @@ examples:
};
};
ldo2 {
- regulator-min-microvolt = <3300000>;
+ /* Adjustable LDO VOUT */
+ regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3300000>;
regulator-always-on;
regulator-state-mem {
--
2.7.4
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 2/2] regulator: dt-bindings: rtq2208: Add specified fixed LDO VOUT property
2024-05-16 9:20 ` [PATCH 2/2] regulator: dt-bindings: rtq2208: Add specified fixed LDO VOUT property Alina Yu
@ 2024-05-16 12:34 ` Krzysztof Kozlowski
2024-05-22 9:03 ` Alina Yu
0 siblings, 1 reply; 12+ messages in thread
From: Krzysztof Kozlowski @ 2024-05-16 12:34 UTC (permalink / raw)
To: Alina Yu, lgirdwood, broonie, robh+dt, krzysztof.kozlowski+dt,
conor+dt
Cc: linux-kernel, devicetree, cy_huang
On 16/05/2024 11:20, Alina Yu wrote:
> As the fixed voltage for the LDO is outside the range of the adjustable voltage mode,
> the constraints for this scenario are not suitable to represent both modes.
> Therefore, A property is added to specify the fixed LDO VOUT.
>
> Examples of fixed LDO VOUT and adjustable LDO VOUT is also added to this version.
>
> Signed-off-by: Alina Yu <alina_yu@richtek.com>
> ---
This is a v1 but I am pretty sure I saw it somewhere and there was
already some sort of discussion. Confused... :(
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/2] regulator: dt-bindings: rtq2208: Add specified fixed LDO VOUT property
2024-05-16 12:34 ` Krzysztof Kozlowski
@ 2024-05-22 9:03 ` Alina Yu
2024-05-22 9:27 ` Krzysztof Kozlowski
0 siblings, 1 reply; 12+ messages in thread
From: Alina Yu @ 2024-05-22 9:03 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: lgirdwood, broonie, robh+dt, krzysztof.kozlowski+dt, conor+dt,
linux-kernel, devicetree, cy_huang
On Thu, May 16, 2024 at 02:34:02PM +0200, Krzysztof Kozlowski wrote:
> On 16/05/2024 11:20, Alina Yu wrote:
> > As the fixed voltage for the LDO is outside the range of the adjustable voltage mode,
> > the constraints for this scenario are not suitable to represent both modes.
> > Therefore, A property is added to specify the fixed LDO VOUT.
> >
> > Examples of fixed LDO VOUT and adjustable LDO VOUT is also added to this version.
> >
> > Signed-off-by: Alina Yu <alina_yu@richtek.com>
> > ---
>
> This is a v1 but I am pretty sure I saw it somewhere and there was
> already some sort of discussion. Confused... :(
>
> Best regards,
> Krzysztof
>
The discussion regarding this matter took place during v2 and v3.
Due to the fixed LDO VOUT being outside the range of the adjustable one,
a special-use property has been added to avoid overusing the constraints.
Thanks,
Alina
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/2] regulator: dt-bindings: rtq2208: Add specified fixed LDO VOUT property
2024-05-22 9:03 ` Alina Yu
@ 2024-05-22 9:27 ` Krzysztof Kozlowski
2024-05-22 9:45 ` Alina Yu
2024-05-22 11:35 ` Mark Brown
0 siblings, 2 replies; 12+ messages in thread
From: Krzysztof Kozlowski @ 2024-05-22 9:27 UTC (permalink / raw)
To: Alina Yu
Cc: lgirdwood, broonie, robh+dt, krzysztof.kozlowski+dt, conor+dt,
linux-kernel, devicetree, cy_huang
On 22/05/2024 11:03, Alina Yu wrote:
> On Thu, May 16, 2024 at 02:34:02PM +0200, Krzysztof Kozlowski wrote:
>> On 16/05/2024 11:20, Alina Yu wrote:
>>> As the fixed voltage for the LDO is outside the range of the adjustable voltage mode,
>>> the constraints for this scenario are not suitable to represent both modes.
>>> Therefore, A property is added to specify the fixed LDO VOUT.
>>>
>>> Examples of fixed LDO VOUT and adjustable LDO VOUT is also added to this version.
>>>
>>> Signed-off-by: Alina Yu <alina_yu@richtek.com>
>>> ---
>>
>> This is a v1 but I am pretty sure I saw it somewhere and there was
>> already some sort of discussion. Confused... :(
>>
>> Best regards,
>> Krzysztof
>>
>
> The discussion regarding this matter took place during v2 and v3.
So in the future?
> Due to the fixed LDO VOUT being outside the range of the adjustable one,
> a special-use property has been added to avoid overusing the constraints.
Hm, why exactly this is not a bool property? What are the benefits?
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/2] regulator: dt-bindings: rtq2208: Add specified fixed LDO VOUT property
2024-05-22 9:27 ` Krzysztof Kozlowski
@ 2024-05-22 9:45 ` Alina Yu
2024-05-22 11:35 ` Mark Brown
1 sibling, 0 replies; 12+ messages in thread
From: Alina Yu @ 2024-05-22 9:45 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: lgirdwood, broonie, robh+dt, krzysztof.kozlowski+dt, conor+dt,
linux-kernel, devicetree, cy_huang
On Wed, May 22, 2024 at 11:27:06AM +0200, Krzysztof Kozlowski wrote:
> On 22/05/2024 11:03, Alina Yu wrote:
> > On Thu, May 16, 2024 at 02:34:02PM +0200, Krzysztof Kozlowski wrote:
> >> On 16/05/2024 11:20, Alina Yu wrote:
> >>> As the fixed voltage for the LDO is outside the range of the adjustable voltage mode,
> >>> the constraints for this scenario are not suitable to represent both modes.
> >>> Therefore, A property is added to specify the fixed LDO VOUT.
> >>>
> >>> Examples of fixed LDO VOUT and adjustable LDO VOUT is also added to this version.
> >>>
> >>> Signed-off-by: Alina Yu <alina_yu@richtek.com>
> >>> ---
> >>
> >> This is a v1 but I am pretty sure I saw it somewhere and there was
> >> already some sort of discussion. Confused... :(
> >>
> >> Best regards,
> >> Krzysztof
> >>
> >
> > The discussion regarding this matter took place during v2 and v3.
>
> So in the future?
Based on the previous discussion, it is scheduled to be included in the linux-next tree.
Will we start a further discussions on this topic?
>
> > Due to the fixed LDO VOUT being outside the range of the adjustable one,
> > a special-use property has been added to avoid overusing the constraints.
>
> Hm, why exactly this is not a bool property? What are the benefits?
>
> Best regards,
> Krzysztof
>
As only the user will know the exact fixed voltage,
the property is defined as a u32 to allow user customization and decision-making.
Thanks,
Alina
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/2] regulator: dt-bindings: rtq2208: Add specified fixed LDO VOUT property
2024-05-22 9:27 ` Krzysztof Kozlowski
2024-05-22 9:45 ` Alina Yu
@ 2024-05-22 11:35 ` Mark Brown
2024-05-22 13:29 ` Krzysztof Kozlowski
1 sibling, 1 reply; 12+ messages in thread
From: Mark Brown @ 2024-05-22 11:35 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Alina Yu, lgirdwood, robh+dt, krzysztof.kozlowski+dt, conor+dt,
linux-kernel, devicetree, cy_huang
[-- Attachment #1: Type: text/plain, Size: 652 bytes --]
On Wed, May 22, 2024 at 11:27:06AM +0200, Krzysztof Kozlowski wrote:
> On 22/05/2024 11:03, Alina Yu wrote:
> > Due to the fixed LDO VOUT being outside the range of the adjustable one,
> > a special-use property has been added to avoid overusing the constraints.
> Hm, why exactly this is not a bool property? What are the benefits?
It avoids confusion between invalid constraints specified on the
variable voltage regulator and allows us to validate any constraints
that happen to be specified (though it'd be pointless to specify
constraints). The fact that the regulator could also be variable
voltage is asking for confusion if we use boolean.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/2] regulator: dt-bindings: rtq2208: Add specified fixed LDO VOUT property
2024-05-22 11:35 ` Mark Brown
@ 2024-05-22 13:29 ` Krzysztof Kozlowski
0 siblings, 0 replies; 12+ messages in thread
From: Krzysztof Kozlowski @ 2024-05-22 13:29 UTC (permalink / raw)
To: Mark Brown
Cc: Alina Yu, lgirdwood, robh+dt, krzysztof.kozlowski+dt, conor+dt,
linux-kernel, devicetree, cy_huang
On 22/05/2024 13:35, Mark Brown wrote:
> On Wed, May 22, 2024 at 11:27:06AM +0200, Krzysztof Kozlowski wrote:
>> On 22/05/2024 11:03, Alina Yu wrote:
>
>>> Due to the fixed LDO VOUT being outside the range of the adjustable one,
>>> a special-use property has been added to avoid overusing the constraints.
>
>> Hm, why exactly this is not a bool property? What are the benefits?
>
> It avoids confusion between invalid constraints specified on the
> variable voltage regulator and allows us to validate any constraints
> that happen to be specified (though it'd be pointless to specify
> constraints). The fact that the regulator could also be variable
> voltage is asking for confusion if we use boolean.
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] regulator: rtq2208: Add fixed LDO VOUT property and check that matches the constraints
2024-05-16 9:20 ` [PATCH 1/2] regulator: rtq2208: Add fixed LDO VOUT property and check that matches the constraints Alina Yu
@ 2024-05-27 13:00 ` Mark Brown
2024-05-28 6:07 ` Alina Yu
2024-05-29 6:41 ` Alina Yu
0 siblings, 2 replies; 12+ messages in thread
From: Mark Brown @ 2024-05-27 13:00 UTC (permalink / raw)
To: Alina Yu
Cc: lgirdwood, robh+dt, krzysztof.kozlowski+dt, conor+dt,
linux-kernel, devicetree, cy_huang
[-- Attachment #1: Type: text/plain, Size: 328 bytes --]
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.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] regulator: rtq2208: Add fixed LDO VOUT property and check that matches the constraints
2024-05-27 13:00 ` Mark Brown
@ 2024-05-28 6:07 ` Alina Yu
2024-05-29 6:41 ` Alina Yu
1 sibling, 0 replies; 12+ messages in thread
From: Alina Yu @ 2024-05-28 6:07 UTC (permalink / raw)
To: Mark Brown
Cc: lgirdwood, robh+dt, krzysztof.kozlowski+dt, conor+dt,
linux-kernel, devicetree, cy_huang
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
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] regulator: rtq2208: Add fixed LDO VOUT property and check that matches the constraints
2024-05-27 13:00 ` Mark Brown
2024-05-28 6:07 ` Alina Yu
@ 2024-05-29 6:41 ` Alina Yu
1 sibling, 0 replies; 12+ messages in thread
From: Alina Yu @ 2024-05-29 6:41 UTC (permalink / raw)
To: Mark Brown
Cc: lgirdwood, robh+dt, krzysztof.kozlowski+dt, conor+dt,
linux-kernel, devicetree, cy_huang
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.
Regarding the previous discussion in
https://lore.kernel.org/all/20240528060731.GA25526@linuxcarl2.richtek.com/
I found some patches missing in the linux-next tree.
So I merged the missing part in my latest resent sereies.
The issue has been addressed in
In '[RESEND 2/4] regulator: rtq2208: Fix LDO to be compatible with both fixed and adjustable vout'
https://lore.kernel.org/all/5ad4c7728c7fa7f6286db36b99d31c9d0f5d16c7.1716870419.git.alina_yu@richtek.com/
@@ -219,7 +219,7 @@ static const struct regulator_ops rtq2208_regulator_buck_ops = {
.set_suspend_mode = rtq2208_set_suspend_mode,
};
-static const struct regulator_ops rtq2208_regulator_ldo_ops = {
+static const struct regulator_ops rtq2208_regulator_ldo_fix_ops = {
.enable = regulator_enable_regmap,
.disable = regulator_disable_regmap,
.is_enabled = regulator_is_enabled_regmap,
...
Thanks,
Alina
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2024-05-29 6:51 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-16 9:20 [PATCH 0/2] Add specified fixed LDO VOUT propery Alina Yu
2024-05-16 9:20 ` [PATCH 1/2] regulator: rtq2208: Add fixed LDO VOUT property and check that matches the constraints Alina Yu
2024-05-27 13:00 ` Mark Brown
2024-05-28 6:07 ` Alina Yu
2024-05-29 6:41 ` Alina Yu
2024-05-16 9:20 ` [PATCH 2/2] regulator: dt-bindings: rtq2208: Add specified fixed LDO VOUT property Alina Yu
2024-05-16 12:34 ` Krzysztof Kozlowski
2024-05-22 9:03 ` Alina Yu
2024-05-22 9:27 ` Krzysztof Kozlowski
2024-05-22 9:45 ` Alina Yu
2024-05-22 11:35 ` Mark Brown
2024-05-22 13:29 ` Krzysztof Kozlowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).