Skip to contentSkip to conversation

power: regulator: denied disable on always-on regulator

PATCH RESEND Superseded Patrice Chotard 5 participants 9 messages Nov 15, 2018 – Dec 6, 2018

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 power: regulator: denied disable on always-on regulator

From: Patrick Delaunay <[email protected]>

Don't disable regulator which are tagged as "regulator-always-on" in DT.

---

 drivers/power/regulator/regulator-uclass.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/power/regulator/regulator-uclass.c +5 -0
index 4da8e43259fc..4511625ff251 100644
@@ -106,10 +106,15 @@ int regulator_get_enable(struct udevice *dev)
 int regulator_set_enable(struct udevice *dev, bool enable)
 {
 	const struct dm_regulator_ops *ops = dev_get_driver_ops(dev);
+	struct dm_regulator_uclass_platdata *uc_pdata;
 
 	if (!ops || !ops->set_enable)
 		return -ENOSYS;
 
+	uc_pdata = dev_get_uclass_platdata(dev);
+	if (!enable && uc_pdata->always_on)
+		return -EACCES;
+
 	return ops->set_enable(dev, enable);
 }
 
Signature · 1 line
1.9.1
#1 lore raw

PATCH RESEND 1/1 power: regulator: denied disable on always-on regulator

Quoted 10 lines · Patrice Chotard

From: Patrick Delaunay <[email protected]>

Don't disable regulator which are tagged as "regulator-always-on" in DT.

#2 lore raw

PATCH RESEND 1/1 power: regulator: denied disable on always-on regulator

In reply to Patrice Chotard
Quoted 11 lines · Patrice Chotard

From: Patrick Delaunay <[email protected]>

Don't disable regulator which are tagged as "regulator-always-on" in DT.

---

#3 lore raw

PATCH RESEND 1/1 power: regulator: denied disable on always-on regulator

In reply to Patrice Chotard
Quoted 25 lines · Patrice Chotard

From: Patrick Delaunay <[email protected]>

Don't disable regulator which are tagged as "regulator-always-on" in DT.

---

 drivers/power/regulator/regulator-uclass.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/power/regulator/regulator-uclass.c +1 -0
index 4da8e43259fc..4511625ff251 100644
@@ -106,10 +106,15 @@ int regulator_get_enable(struct udevice *dev)
 int regulator_set_enable(struct udevice *dev, bool enable)
 {
 	const struct dm_regulator_ops *ops = dev_get_driver_ops(dev);
+	struct dm_regulator_uclass_platdata *uc_pdata;
 

drivers/power/regulator/regulator-uclass.c int regulator_get_enable(struct udevice *dev) · line 120

Quoted 10 lines
drivers/power/regulator/regulator-uclass.c +4 -0
 	if (!ops || !ops->set_enable)
 		return -ENOSYS;
 
+	uc_pdata = dev_get_uclass_platdata(dev);
+	if (!enable && uc_pdata->always_on)
+		return -EACCES;
+
 	return ops->set_enable(dev, enable);
 }
 

This patch has been around since May 2018 (albeit superseded). A request from Patrice Chotard to Jaehoon Chung about the patch status change never got answered. Looking Patchwork I don't see any post from Jaehoon after May 8. 2018.
Please don't get me wrong: I just want to make sure this patch doesn't get forgotten, knowing very well, that it was posted (resent) just 2 weeks ago. Expecting quite a few board maintainers to enable DM_MMC in the coming weeks and months this patch might get important to more people as it prevents powering off the MMC supply voltage during power cycling.
If the patch is on someones radar that's fine with me.

regards, Felix

#4 lore raw

PATCH RESEND 1/1 power: regulator: denied disable on always-on regulator

Hi,

Quoted 13 lines · Felix Brack
Quoted 11 lines · Patrice Chotard

From: Patrick Delaunay <[email protected]>

Don't disable regulator which are tagged as "regulator-always-on" in DT.

---

Quoted 3 lines
Quoted 3 lines
 drivers/power/regulator/regulator-uclass.c | 5 +++++
 1 file changed, 5 insertions(+)

I'm happy to pick it up if that helps.

Regards,
Simon

#5 lore raw

PATCH RESEND 1/1 power: regulator: denied disable on always-on regulator

Quoted 16 lines · Simon Glass

Hi,

Quoted 13 lines · Felix Brack
Quoted 11 lines · Patrice Chotard

From: Patrick Delaunay <[email protected]>

Don't disable regulator which are tagged as "regulator-always-on" in DT.

---

Quoted 5 lines
Quoted 3 lines
Quoted 3 lines
 drivers/power/regulator/regulator-uclass.c | 5 +++++
 1 file changed, 5 insertions(+)

I'm happy to pick it up if that helps.

Please, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181203/4d472060/attachment.sig>
#6 lore raw

PATCH RESEND 1/1 power: regulator: denied disable on always-on regulator

In reply to Simon Glass

Hello Simon,

Quoted 16 lines · Simon Glass

Hi,

Quoted 13 lines · Felix Brack
Quoted 11 lines · Patrice Chotard

From: Patrick Delaunay <[email protected]>

Don't disable regulator which are tagged as "regulator-always-on" in DT.

---

Quoted 6 lines
Quoted 3 lines
Quoted 3 lines
  drivers/power/regulator/regulator-uclass.c | 5 +++++
  1 file changed, 5 insertions(+)

I'm happy to pick it up if that helps.

Excellent! Thank you very much for taking care.

Regards, Felix

#7 lore raw

PATCH RESEND 1/1 power: regulator: denied disable on always-on regulator

In reply to Simon Glass

Hi Simon

Quoted 16 lines · Simon Glass

Hi,

Quoted 13 lines · Felix Brack
Quoted 11 lines · Patrice Chotard

From: Patrick Delaunay <[email protected]>

Don't disable regulator which are tagged as "regulator-always-on" in DT.

---

Quoted 5 lines
Quoted 3 lines
Quoted 3 lines
 drivers/power/regulator/regulator-uclass.c | 5 +++++
 1 file changed, 5 insertions(+)

I'm happy to pick it up if that helps.

Thank you ;-)

Quoted 4 lines

Regards,
Simon

#8 lore raw

PATCH RESEND 1/1 power: regulator: denied disable on always-on regulator

Quoted 20 lines · Patrice CHOTARD

Hi Simon

Quoted 16 lines · Simon Glass

Hi,

Quoted 13 lines · Felix Brack
Quoted 11 lines · Patrice Chotard

From: Patrick Delaunay <[email protected]>

Don't disable regulator which are tagged as "regulator-always-on" in DT.

---

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 3 lines
 drivers/power/regulator/regulator-uclass.c | 5 +++++
 1 file changed, 5 insertions(+)

I'm happy to pick it up if that helps.

Thank you ;-)

Applied to u-boot-dm, thanks!