Skip to contentSkip to conversation

regulator: implement basic reference counter

PATCH Superseded Eugen Hristev 2 participants 5 messages Mar 31, 2023 – Apr 12, 2023

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/2 regulator: implement basic reference counter

Some devices share a regulator supply, when the first one will request regulator disable, the second device will have it's supply cut off before graciously shutting down. Hence there will be timeouts and other failed operations.
Implement a reference counter mechanism similar with what is done in Linux, to keep track of enable and disable requests, and only disable the regulator when the last of the consumers has requested shutdown.

---
Changes in v4:
- add documentation for error codes
Changes in v3:
- add error return codes
Changes in v2:
- add info in header regarding the function

 drivers/power/regulator/regulator_common.c | 22 ++++++++++++++++++++++
 drivers/power/regulator/regulator_common.h | 21 +++++++++++++++++++++
 2 files changed, 43 insertions(+)
drivers/power/regulator/regulator_common.c +22 -0
index 93d8196b381e..484a4fc31ef7 100644
@@ -73,6 +73,23 @@ int regulator_common_set_enable(const struct udevice *dev,
 		return 0;
 	}
 
+	/* If previously enabled, increase count */
+	if (enable && dev_pdata->enable_count > 0) {
+		dev_pdata->enable_count++;
+		return -EALREADY;
+	}
+
+	if (!enable) {
+		if (dev_pdata->enable_count > 1) {
+			/* If enabled multiple times, decrease count */
+			dev_pdata->enable_count--;
+			return -EBUSY;
+		} else if (!dev_pdata->enable_count) {
+			/* If already disabled, do nothing */
+			return -EALREADY;
+		}
+	}
+
 	ret = dm_gpio_set_value(&dev_pdata->gpio, enable);
 	if (ret) {
 		pr_err("Can't set regulator : %s gpio to: %d\n", dev->name,
@@ -87,5 +104,10 @@ int regulator_common_set_enable(const struct udevice *dev,
 	if (!enable && dev_pdata->off_on_delay_us)
 		udelay(dev_pdata->off_on_delay_us);
 
+	if (enable)
+		dev_pdata->enable_count++;
+	else
+		dev_pdata->enable_count--;
+
 	return 0;
 }
drivers/power/regulator/regulator_common.h +21 -0
index c10492f01675..0faab447d099 100644
@@ -13,6 +13,7 @@ struct regulator_common_plat {
 	struct gpio_desc gpio; /* GPIO for regulator enable control */
 	unsigned int startup_delay_us;
 	unsigned int off_on_delay_us;
+	unsigned int enable_count;
 };
 
 int regulator_common_of_to_plat(struct udevice *dev,
@@ -20,6 +21,26 @@ int regulator_common_of_to_plat(struct udevice *dev,
 				char *enable_gpio_name);
 int regulator_common_get_enable(const struct udevice *dev,
 	struct regulator_common_plat *dev_pdata);
+/*
+ * Enable or Disable a regulator
+ *
+ * This is a reentrant function and subsequent calls that enable will
+ * increase an internal counter, and disable calls will decrease the counter.
+ * The actual resource will be enabled when the counter gets to 1 coming from 0,
+ * and disabled when it reaches 0 coming from 1.
+ *
+ * @dev: regulator device
+ * @dev_pdata: Platform data
+ * @enable: bool indicating whether to enable or disable the regulator
+ * @return:
+ * 0 on Success
+ * -EBUSY if the regulator cannot be disabled because it's requested by
+ *        another device
+ * -EALREADY if the regulator has already been enabled or has already been
+ *        disabled
+ * -EACCES if there is no possibility to enable/disable the regulator
+ * -ve on different error situation
+ */
 int regulator_common_set_enable(const struct udevice *dev,
 	struct regulator_common_plat *dev_pdata, bool enable);
 
Signature · 1 line
2.34.1
#1 lore raw

PATCH v4 2/2 regulator: rename dev_pdata to plat

Simplify the subsystem by renaming dev_pdata to just plat. No functional change, just trivial renaming.

---
Changes in v3,v4:
- none
Changes in v2:
- this is a new patch

 drivers/power/regulator/fan53555.c         | 10 ++--
 drivers/power/regulator/fixed.c            | 16 +++----
 drivers/power/regulator/gpio-regulator.c   | 46 +++++++++----------
 drivers/power/regulator/regulator_common.c | 53 +++++++++++-----------
 drivers/power/regulator/regulator_common.h |  8 ++--
 5 files changed, 66 insertions(+), 67 deletions(-)
drivers/power/regulator/fan53555.c +5 -5
index 5681206bbafe..815f96beef61 100644
@@ -101,7 +101,7 @@ struct fan53555_priv {
 
 static int fan53555_regulator_of_to_plat(struct udevice *dev)
 {
-	struct fan53555_plat *dev_pdata = dev_get_plat(dev);
+	struct fan53555_plat *plat = dev_get_plat(dev);
 	struct dm_regulator_uclass_plat *uc_pdata =
 		dev_get_uclass_plat(dev);
 	u32 sleep_vsel;
@@ -118,12 +118,12 @@ static int fan53555_regulator_of_to_plat(struct udevice *dev)
 	 */
 	switch (sleep_vsel) {
 	case FAN53555_VSEL0:
-		dev_pdata->sleep_reg = FAN53555_VSEL0;
-		dev_pdata->vol_reg = FAN53555_VSEL1;
+		plat->sleep_reg = FAN53555_VSEL0;
+		plat->vol_reg = FAN53555_VSEL1;
 		break;
 	case FAN53555_VSEL1:
-		dev_pdata->sleep_reg = FAN53555_VSEL1;
-		dev_pdata->vol_reg = FAN53555_VSEL0;
+		plat->sleep_reg = FAN53555_VSEL1;
+		plat->vol_reg = FAN53555_VSEL0;
 		break;
 	default:
 		pr_err("%s: invalid vsel id %d\n", dev->name, sleep_vsel);
drivers/power/regulator/fixed.c +8 -8
index 90004d1601a9..ad3b4b98d667 100644
@@ -24,16 +24,16 @@ struct fixed_clock_regulator_plat {
 static int fixed_regulator_of_to_plat(struct udevice *dev)
 {
 	struct dm_regulator_uclass_plat *uc_pdata;
-	struct regulator_common_plat *dev_pdata;
+	struct regulator_common_plat *plat;
 
-	dev_pdata = dev_get_plat(dev);
+	plat = dev_get_plat(dev);
 	uc_pdata = dev_get_uclass_plat(dev);
 	if (!uc_pdata)
 		return -ENXIO;
 
 	uc_pdata->type = REGULATOR_TYPE_FIXED;
 
-	return regulator_common_of_to_plat(dev, dev_pdata, "gpio");
+	return regulator_common_of_to_plat(dev, plat, "gpio");
 }
 
 static int fixed_regulator_get_value(struct udevice *dev)
@@ -88,7 +88,7 @@ static int fixed_clock_regulator_get_enable(struct udevice *dev)
 static int fixed_clock_regulator_set_enable(struct udevice *dev, bool enable)
 {
 	struct fixed_clock_regulator_plat *priv = dev_get_priv(dev);
-	struct regulator_common_plat *dev_pdata = dev_get_plat(dev);
+	struct regulator_common_plat *plat = dev_get_plat(dev);
 	int ret = 0;
 
 	if (enable) {
@@ -101,11 +101,11 @@ static int fixed_clock_regulator_set_enable(struct udevice *dev, bool enable)
 	if (ret)
 		return ret;
 
-	if (enable && dev_pdata->startup_delay_us)
-		udelay(dev_pdata->startup_delay_us);
+	if (enable && plat->startup_delay_us)
+		udelay(plat->startup_delay_us);
 
-	if (!enable && dev_pdata->off_on_delay_us)
-		udelay(dev_pdata->off_on_delay_us);
+	if (!enable && plat->off_on_delay_us)
+		udelay(plat->off_on_delay_us);
 
 	return ret;
 }
drivers/power/regulator/gpio-regulator.c +23 -23

107 lines not on this page · raw message

drivers/power/regulator/regulator_common.c +26 -27

117 lines not on this page · raw message

drivers/power/regulator/regulator_common.h +4 -4
index 0faab447d099..d4962899d830 100644
@@ -17,10 +17,10 @@ struct regulator_common_plat {
 };
 
 int regulator_common_of_to_plat(struct udevice *dev,
-				struct regulator_common_plat *dev_pdata, const
+				struct regulator_common_plat *plat, const
 				char *enable_gpio_name);
 int regulator_common_get_enable(const struct udevice *dev,
-	struct regulator_common_plat *dev_pdata);
+	struct regulator_common_plat *plat);
 /*
  * Enable or Disable a regulator
  *
@@ -30,7 +30,7 @@ int regulator_common_get_enable(const struct udevice *dev,
  * and disabled when it reaches 0 coming from 1.
  *
  * @dev: regulator device
- * @dev_pdata: Platform data
+ * @plat: Platform data
  * @enable: bool indicating whether to enable or disable the regulator
  * @return:
  * 0 on Success
@@ -42,6 +42,6 @@ int regulator_common_get_enable(const struct udevice *dev,
  * -ve on different error situation
  */
 int regulator_common_set_enable(const struct udevice *dev,
-	struct regulator_common_plat *dev_pdata, bool enable);
+	struct regulator_common_plat *plat, bool enable);
 
 #endif /* _REGULATOR_COMMON_H */
Signature · 1 line
2.34.1
#2 lore raw
In reply to Eugen Hristev

Hi Eugen,

Quoted 84 lines · Eugen Hristev

Some devices share a regulator supply, when the first one will request regulator disable, the second device will have it's supply cut off before graciously shutting down. Hence there will be timeouts and other failed operations.
Implement a reference counter mechanism similar with what is done in Linux, to keep track of enable and disable requests, and only disable the regulator when the last of the consumers has requested shutdown.

---
Changes in v4:
- add documentation for error codes
Changes in v3:
- add error return codes
Changes in v2:
- add info in header regarding the function

 drivers/power/regulator/regulator_common.c | 22 ++++++++++++++++++++++
 drivers/power/regulator/regulator_common.h | 21 +++++++++++++++++++++
 2 files changed, 43 insertions(+)
drivers/power/regulator/regulator_common.c +22 -0
index 93d8196b381e..484a4fc31ef7 100644
@@ -73,6 +73,23 @@ int regulator_common_set_enable(const struct udevice *dev,
 		return 0;
 	}
 
+	/* If previously enabled, increase count */
+	if (enable && dev_pdata->enable_count > 0) {
+		dev_pdata->enable_count++;
+		return -EALREADY;
+	}
+
+	if (!enable) {
+		if (dev_pdata->enable_count > 1) {
+			/* If enabled multiple times, decrease count */
+			dev_pdata->enable_count--;
+			return -EBUSY;
+		} else if (!dev_pdata->enable_count) {
+			/* If already disabled, do nothing */
+			return -EALREADY;
+		}
+	}
+
 	ret = dm_gpio_set_value(&dev_pdata->gpio, enable);
 	if (ret) {
 		pr_err("Can't set regulator : %s gpio to: %d\n", dev->name,
@@ -87,5 +104,10 @@ int regulator_common_set_enable(const struct udevice *dev,
 	if (!enable && dev_pdata->off_on_delay_us)
 		udelay(dev_pdata->off_on_delay_us);
 
+	if (enable)
+		dev_pdata->enable_count++;
+	else
+		dev_pdata->enable_count--;
+
 	return 0;
 }
drivers/power/regulator/regulator_common.h +8 -0
index c10492f01675..0faab447d099 100644
@@ -13,6 +13,7 @@ struct regulator_common_plat {
 	struct gpio_desc gpio; /* GPIO for regulator enable control */
 	unsigned int startup_delay_us;
 	unsigned int off_on_delay_us;
+	unsigned int enable_count;
 };
 
 int regulator_common_of_to_plat(struct udevice *dev,
@@ -20,6 +21,26 @@ int regulator_common_of_to_plat(struct udevice *dev,
 				char *enable_gpio_name);
 int regulator_common_get_enable(const struct udevice *dev,
 	struct regulator_common_plat *dev_pdata);
+/*
+ * Enable or Disable a regulator
+ *
+ * This is a reentrant function and subsequent calls that enable will
+ * increase an internal counter, and disable calls will decrease the counter.
+ * The actual resource will be enabled when the counter gets to 1 coming from 0,
+ * and disabled when it reaches 0 coming from 1.

drivers/power/regulator/regulator_common.h int regulator_common_of_to_plat(struct udevice *dev, · line 40

Quoted 10 lines
drivers/power/regulator/regulator_common.h +10 -0
+ *
+ * @dev: regulator device
+ * @dev_pdata: Platform data
+ * @enable: bool indicating whether to enable or disable the regulator
+ * @return:
+ * 0 on Success
+ * -EBUSY if the regulator cannot be disabled because it's requested by
+ *        another device
+ * -EALREADY if the regulator has already been enabled or has already been
+ *        disabled

With this new return value added this has potential to break IO voltage switching for mmc UHS support. Main pattern for IO voltage switch seem to be: disable regulator, set voltage, enable regulator.

regulator_set_enable_if_allowed should probably be updated to return success on -EALREADY, but that also has the potential to hide regulators enabled at boot not being disabled unless initial enable_count reflects the initial regulator state.

Guessing initial enable_count will match for regulator-boot-on regulators in Rockchip and few other platforms/boards because they the call regulators_enable_boot_on, does not look like all platform will have initial enable_count match regulator initial state.

Regards,
Jonas

Quoted 6 lines
drivers/power/regulator/regulator_common.h +3 -0
+ * -EACCES if there is no possibility to enable/disable the regulator
+ * -ve on different error situation
+ */
 int regulator_common_set_enable(const struct udevice *dev,
 	struct regulator_common_plat *dev_pdata, bool enable);
 
#3 lore raw
Quoted 93 lines · Jonas Karlman

Hi Eugen,

Quoted 90 lines · Eugen Hristev

Some devices share a regulator supply, when the first one will request regulator disable, the second device will have it's supply cut off before graciously shutting down. Hence there will be timeouts and other failed operations.
Implement a reference counter mechanism similar with what is done in Linux, to keep track of enable and disable requests, and only disable the regulator when the last of the consumers has requested shutdown.

---
Changes in v4:
- add documentation for error codes
Changes in v3:
- add error return codes
Changes in v2:
- add info in header regarding the function

  drivers/power/regulator/regulator_common.c | 22 ++++++++++++++++++++++
  drivers/power/regulator/regulator_common.h | 21 +++++++++++++++++++++
  2 files changed, 43 insertions(+)
drivers/power/regulator/regulator_common.c +22 -0
index 93d8196b381e..484a4fc31ef7 100644
@@ -73,6 +73,23 @@ int regulator_common_set_enable(const struct udevice *dev,
  		return 0;
  	}
 
+	/* If previously enabled, increase count */
+	if (enable && dev_pdata->enable_count > 0) {
+		dev_pdata->enable_count++;
+		return -EALREADY;
+	}
+
+	if (!enable) {
+		if (dev_pdata->enable_count > 1) {
+			/* If enabled multiple times, decrease count */
+			dev_pdata->enable_count--;
+			return -EBUSY;
+		} else if (!dev_pdata->enable_count) {
+			/* If already disabled, do nothing */
+			return -EALREADY;
+		}
+	}
+
  	ret = dm_gpio_set_value(&dev_pdata->gpio, enable);
  	if (ret) {
  		pr_err("Can't set regulator : %s gpio to: %d\n", dev->name,
@@ -87,5 +104,10 @@ int regulator_common_set_enable(const struct udevice *dev,
  	if (!enable && dev_pdata->off_on_delay_us)
  		udelay(dev_pdata->off_on_delay_us);
 
+	if (enable)
+		dev_pdata->enable_count++;
+	else
+		dev_pdata->enable_count--;
+
  	return 0;
  }
drivers/power/regulator/regulator_common.h +14 -0
index c10492f01675..0faab447d099 100644
@@ -13,6 +13,7 @@ struct regulator_common_plat {
  	struct gpio_desc gpio; /* GPIO for regulator enable control */
  	unsigned int startup_delay_us;
  	unsigned int off_on_delay_us;
+	unsigned int enable_count;
  };
 
  int regulator_common_of_to_plat(struct udevice *dev,
@@ -20,6 +21,26 @@ int regulator_common_of_to_plat(struct udevice *dev,
  				char *enable_gpio_name);
  int regulator_common_get_enable(const struct udevice *dev,
  	struct regulator_common_plat *dev_pdata);
+/*
+ * Enable or Disable a regulator
+ *
+ * This is a reentrant function and subsequent calls that enable will
+ * increase an internal counter, and disable calls will decrease the counter.
+ * The actual resource will be enabled when the counter gets to 1 coming from 0,
+ * and disabled when it reaches 0 coming from 1.
+ *
+ * @dev: regulator device
+ * @dev_pdata: Platform data
+ * @enable: bool indicating whether to enable or disable the regulator
+ * @return:
+ * 0 on Success
Quoted 8 lines

drivers/power/regulator/regulator_common.h int regulator_common_of_to_plat(struct udevice *dev, · line 40

Quoted 4 lines
drivers/power/regulator/regulator_common.h +4 -0
+ * -EBUSY if the regulator cannot be disabled because it's requested by
+ *        another device
+ * -EALREADY if the regulator has already been enabled or has already been
+ *        disabled

With this new return value added this has potential to break IO voltage switching for mmc UHS support. Main pattern for IO voltage switch seem to be: disable regulator, set voltage, enable regulator.

How can the breakage happen in this case ?

Quoted 5 lines

regulator_set_enable_if_allowed should probably be updated to return success on -EALREADY, but that also has the potential to hide regulators enabled at boot not being disabled unless initial enable_count reflects the initial regulator state.

If the regulators enabled at boot are fixed/gpio regulators (which have the enable count), then at boot , the autoset should call the enable_common, thus taking into account the enable_count.

So I think that if I updated regulator_set_enable_if_allowed to return success on -EALREADY it should be fine. Do you have any other scenario in mind ?

Quoted 5 lines

Guessing initial enable_count will match for regulator-boot-on regulators in Rockchip and few other platforms/boards because they the call regulators_enable_boot_on, does not look like all platform will have initial enable_count match regulator initial state.

If the other platforms do not call regulator enable, then they will have the enable_count==0, which is expected right ?
You refer to specific platforms where the regulator is already enabled from hardware but no code is called to enable, and by looking at enable_count it would appear disabled ? There are such cases ? And those regulators are not initialized at all ?

Quoted 11 lines

Regards,
Jonas

Quoted 6 lines
drivers/power/regulator/regulator_common.h +3 -0
+ * -EACCES if there is no possibility to enable/disable the regulator
+ * -ve on different error situation
+ */
  int regulator_common_set_enable(const struct udevice *dev,
  	struct regulator_common_plat *dev_pdata, bool enable);
 
Tested-by Reviewed-by
#4 lore raw

Hi Eugen,

Quoted 103 lines · Eugen Hristev
Quoted 93 lines · Jonas Karlman

Hi Eugen,

Quoted 90 lines · Eugen Hristev

Some devices share a regulator supply, when the first one will request regulator disable, the second device will have it's supply cut off before graciously shutting down. Hence there will be timeouts and other failed operations.
Implement a reference counter mechanism similar with what is done in Linux, to keep track of enable and disable requests, and only disable the regulator when the last of the consumers has requested shutdown.

---
Changes in v4:
- add documentation for error codes
Changes in v3:
- add error return codes
Changes in v2:
- add info in header regarding the function

  drivers/power/regulator/regulator_common.c | 22 ++++++++++++++++++++++
  drivers/power/regulator/regulator_common.h | 21 +++++++++++++++++++++
  2 files changed, 43 insertions(+)
drivers/power/regulator/regulator_common.c +22 -0
index 93d8196b381e..484a4fc31ef7 100644
@@ -73,6 +73,23 @@ int regulator_common_set_enable(const struct udevice *dev,
  		return 0;
  	}
 
+	/* If previously enabled, increase count */
+	if (enable && dev_pdata->enable_count > 0) {
+		dev_pdata->enable_count++;
+		return -EALREADY;
+	}
+
+	if (!enable) {
+		if (dev_pdata->enable_count > 1) {
+			/* If enabled multiple times, decrease count */
+			dev_pdata->enable_count--;
+			return -EBUSY;
+		} else if (!dev_pdata->enable_count) {
+			/* If already disabled, do nothing */
+			return -EALREADY;
+		}
+	}
+
  	ret = dm_gpio_set_value(&dev_pdata->gpio, enable);
  	if (ret) {
  		pr_err("Can't set regulator : %s gpio to: %d\n", dev->name,
@@ -87,5 +104,10 @@ int regulator_common_set_enable(const struct udevice *dev,
  	if (!enable && dev_pdata->off_on_delay_us)
  		udelay(dev_pdata->off_on_delay_us);
 
+	if (enable)
+		dev_pdata->enable_count++;
+	else
+		dev_pdata->enable_count--;
+
  	return 0;
  }
drivers/power/regulator/regulator_common.h +14 -0
index c10492f01675..0faab447d099 100644
@@ -13,6 +13,7 @@ struct regulator_common_plat {
  	struct gpio_desc gpio; /* GPIO for regulator enable control */
  	unsigned int startup_delay_us;
  	unsigned int off_on_delay_us;
+	unsigned int enable_count;
  };
 
  int regulator_common_of_to_plat(struct udevice *dev,
@@ -20,6 +21,26 @@ int regulator_common_of_to_plat(struct udevice *dev,
  				char *enable_gpio_name);
  int regulator_common_get_enable(const struct udevice *dev,
  	struct regulator_common_plat *dev_pdata);
+/*
+ * Enable or Disable a regulator
+ *
+ * This is a reentrant function and subsequent calls that enable will
+ * increase an internal counter, and disable calls will decrease the counter.
+ * The actual resource will be enabled when the counter gets to 1 coming from 0,
+ * and disabled when it reaches 0 coming from 1.
+ *
+ * @dev: regulator device
+ * @dev_pdata: Platform data
+ * @enable: bool indicating whether to enable or disable the regulator
+ * @return:
+ * 0 on Success
Quoted 8 lines

drivers/power/regulator/regulator_common.h int regulator_common_of_to_plat(struct udevice *dev, · line 40

Quoted 4 lines
drivers/power/regulator/regulator_common.h +4 -0
+ * -EBUSY if the regulator cannot be disabled because it's requested by
+ *        another device
+ * -EALREADY if the regulator has already been enabled or has already been
+ *        disabled

With this new return value added this has potential to break IO voltage switching for mmc UHS support. Main pattern for IO voltage switch seem to be: disable regulator, set voltage, enable regulator.

Quoted 1 line

How can the breakage happen in this case ?

This was more of a theoretical issue then anything I have observed.

Quoted 7 lines
Quoted 6 lines

regulator_set_enable_if_allowed should probably be updated to return success on -EALREADY, but that also has the potential to hide regulators enabled at boot not being disabled unless initial enable_count reflects the initial regulator state.

Quoted 7 lines

If the regulators enabled at boot are fixed/gpio regulators (which have the enable count), then at boot , the autoset should call the enable_common, thus taking into account the enable_count.

So I think that if I updated regulator_set_enable_if_allowed to return success on -EALREADY it should be fine. Do you have any other scenario in mind ?

I did more runtime test of this with USB on RK3568 and [1], -EBUSY should possibly also return success.

Testing a "usb start" / "usb stop" cycle report the following -EBUSY error with a shared regulator:

=> usb stop
stopping USB..
Host not halted after 16000 microseconds.
rockchip_usb2phy_port host-port: PHY: Failed to disable regulator vcc5v0-usb-host-regulator: -16. Host not halted after 16000 microseconds.
rockchip_usb2phy_port otg-port: PHY: Failed to disable regulator vcc5v0-usb-host-regulator: -16.

Unsure if this should be reported as error or not.

Quoted 6 lines
Quoted 5 lines

Guessing initial enable_count will match for regulator-boot-on regulators in Rockchip and few other platforms/boards because they the call regulators_enable_boot_on, does not look like all platform will have initial enable_count match regulator initial state.

Quoted 6 lines

If the other platforms do not call regulator enable, then they will have the enable_count==0, which is expected right ?
You refer to specific platforms where the regulator is already enabled from hardware but no code is called to enable, and by looking at enable_count it would appear disabled ? There are such cases ? And those regulators are not initialized at all ?

This was more of a theoretical issue then anything I have observed.

There could be a need in the future to initialize the enable_count based on the state of e.g. the gpio at regulator probe time or at first call to set enable/disable if this becomes an issue.

I did notice that there have been some calls to regulator enable/disable missing that result in unbalanced enable_count. E.g. in dw_mmc and rk pcie.

This looks and works good, as long as set enable/disable calls are balanced so,

[1] https://github.com/Kwiboo/u-boot-rockchip/commits/rk3568-usb-v1

Regards,
Jonas

Quoted 13 lines
Quoted 12 lines

Regards,
Jonas

Quoted 6 lines
drivers/power/regulator/regulator_common.h +3 -0
+ * -EACCES if there is no possibility to enable/disable the regulator
+ * -ve on different error situation
+ */
  int regulator_common_set_enable(const struct udevice *dev,
  	struct regulator_common_plat *dev_pdata, bool enable);