All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] phy: usbphyc: use regulator_set_enable_if_allowed for disabling vdd supply
@ 2020-07-03 17:13 Patrick Delaunay
  2020-07-28 13:28 ` Patrice CHOTARD
  0 siblings, 1 reply; 3+ messages in thread
From: Patrick Delaunay @ 2020-07-03 17:13 UTC (permalink / raw)
  To: u-boot

Use regulator_set_enable_if_allowed() api instead of regulator_set_enable()
while disabling vdd supply. This way the driver doesn't see an error
when disabling an always-on regulator.

This patch is needed since the commit f93fab312615 ("Revert 'power:
regulator: Return success on attempt to disable an always-on regulator'")
and use the API introduced by commit cc4a224af226 ("power: regulator:
Introduce regulator_set_enable_if_allowed api").

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
---

 drivers/phy/phy-stm32-usbphyc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/phy/phy-stm32-usbphyc.c b/drivers/phy/phy-stm32-usbphyc.c
index 464b0735e8..c6d3048602 100644
--- a/drivers/phy/phy-stm32-usbphyc.c
+++ b/drivers/phy/phy-stm32-usbphyc.c
@@ -263,7 +263,7 @@ static int stm32_usbphyc_phy_power_off(struct phy *phy)
 		return 0;
 
 	if (usbphyc_phy->vdd) {
-		ret = regulator_set_enable(usbphyc_phy->vdd, false);
+		ret = regulator_set_enable_if_allowed(usbphyc_phy->vdd, false);
 		if (ret)
 			return ret;
 	}
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] phy: usbphyc: use regulator_set_enable_if_allowed for disabling vdd supply
  2020-07-03 17:13 [PATCH] phy: usbphyc: use regulator_set_enable_if_allowed for disabling vdd supply Patrick Delaunay
@ 2020-07-28 13:28 ` Patrice CHOTARD
  2020-07-28 16:01   ` [Uboot-stm32] " Patrice CHOTARD
  0 siblings, 1 reply; 3+ messages in thread
From: Patrice CHOTARD @ 2020-07-28 13:28 UTC (permalink / raw)
  To: u-boot


On 7/3/20 7:13 PM, Patrick Delaunay wrote:
> Use regulator_set_enable_if_allowed() api instead of regulator_set_enable()
> while disabling vdd supply. This way the driver doesn't see an error
> when disabling an always-on regulator.
>
> This patch is needed since the commit f93fab312615 ("Revert 'power:
> regulator: Return success on attempt to disable an always-on regulator'")
> and use the API introduced by commit cc4a224af226 ("power: regulator:
> Introduce regulator_set_enable_if_allowed api").
>
> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
> ---
>
>  drivers/phy/phy-stm32-usbphyc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/phy/phy-stm32-usbphyc.c b/drivers/phy/phy-stm32-usbphyc.c
> index 464b0735e8..c6d3048602 100644
> --- a/drivers/phy/phy-stm32-usbphyc.c
> +++ b/drivers/phy/phy-stm32-usbphyc.c
> @@ -263,7 +263,7 @@ static int stm32_usbphyc_phy_power_off(struct phy *phy)
>  		return 0;
>  
>  	if (usbphyc_phy->vdd) {
> -		ret = regulator_set_enable(usbphyc_phy->vdd, false);
> +		ret = regulator_set_enable_if_allowed(usbphyc_phy->vdd, false);
>  		if (ret)
>  			return ret;
>  	}

Reviewed-by: Patrice Chotard <patrice.chotard@st.com>

Thanks

Patrice

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Uboot-stm32] [PATCH] phy: usbphyc: use regulator_set_enable_if_allowed for disabling vdd supply
  2020-07-28 13:28 ` Patrice CHOTARD
@ 2020-07-28 16:01   ` Patrice CHOTARD
  0 siblings, 0 replies; 3+ messages in thread
From: Patrice CHOTARD @ 2020-07-28 16:01 UTC (permalink / raw)
  To: u-boot


On 7/28/20 3:28 PM, Patrice CHOTARD wrote:
> On 7/3/20 7:13 PM, Patrick Delaunay wrote:
>> Use regulator_set_enable_if_allowed() api instead of regulator_set_enable()
>> while disabling vdd supply. This way the driver doesn't see an error
>> when disabling an always-on regulator.
>>
>> This patch is needed since the commit f93fab312615 ("Revert 'power:
>> regulator: Return success on attempt to disable an always-on regulator'")
>> and use the API introduced by commit cc4a224af226 ("power: regulator:
>> Introduce regulator_set_enable_if_allowed api").
>>
>> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
>> ---
>>
>>  drivers/phy/phy-stm32-usbphyc.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/phy/phy-stm32-usbphyc.c b/drivers/phy/phy-stm32-usbphyc.c
>> index 464b0735e8..c6d3048602 100644
>> --- a/drivers/phy/phy-stm32-usbphyc.c
>> +++ b/drivers/phy/phy-stm32-usbphyc.c
>> @@ -263,7 +263,7 @@ static int stm32_usbphyc_phy_power_off(struct phy *phy)
>>  		return 0;
>>  
>>  	if (usbphyc_phy->vdd) {
>> -		ret = regulator_set_enable(usbphyc_phy->vdd, false);
>> +		ret = regulator_set_enable_if_allowed(usbphyc_phy->vdd, false);
>>  		if (ret)
>>  			return ret;
>>  	}
> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
>
> Thanks
>
> Patrice
> _______________________________________________
> Uboot-stm32 mailing list
> Uboot-stm32 at st-md-mailman.stormreply.com
> https://st-md-mailman.stormreply.com/mailman/listinfo/uboot-stm32
Applied to u-boot-stm/master

Thanks

Patrice

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-07-28 16:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-03 17:13 [PATCH] phy: usbphyc: use regulator_set_enable_if_allowed for disabling vdd supply Patrick Delaunay
2020-07-28 13:28 ` Patrice CHOTARD
2020-07-28 16:01   ` [Uboot-stm32] " Patrice CHOTARD

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.