* [PATCHv2 0/2] usb: bcma: control VBUS via a regulator
@ 2026-09-21 21:41 Rosen Penev
2026-09-21 21:41 ` [PATCHv2 1/2] usb: bcma: add regulator support Rosen Penev
2026-09-21 21:41 ` [PATCHv2 2/2] ARM: dts: broadcom: model USB VBUS power with regulator-fixed Rosen Penev
0 siblings, 2 replies; 5+ messages in thread
From: Rosen Penev @ 2026-09-21 21:41 UTC (permalink / raw)
To: devicetree
Cc: Florian Fainelli, Hauke Mehrtens, Rafał Miłecki,
Broadcom internal kernel review list, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Greg Kroah-Hartman,
moderated list:BROADCOM BCM5301X ARM ARCHITECTURE, open list,
open list:USB SUBSYSTEM
bcma-hcd currently drives the USB power line by grabbing the
undocumented "vcc-gpio" property from the controller node and poking
it through gpiolib. Besides relying on a non-standard binding, this
cannot work on boards such as the NETGEAR R7000 and R8000 where one
chipcommon GPIO powers both the USB2 and USB3 cores: the two
controllers each request that GPIO exclusively, so the second one
fails with -EBUSY and its port stays dead.
Instead, switch the driver to the standard regulator interface and
express the power rails as regulator-fixed nodes bound to the
chipcommon GPIOs. The regulator core reference-counts enable/disable
requests, letting both controllers share one GPIO without conflicts.
v2: fixup dts and keep GPIO working.
Rosen Penev (2):
usb: bcma: add regulator support
ARM: dts: broadcom: model USB VBUS power with regulator-fixed
.../broadcom/bcm4708-buffalo-wxr-1750dhp.dts | 12 ++++-
.../bcm4708-buffalo-wzr-1166dhp-common.dtsi | 23 +++++++-
.../broadcom/bcm4708-buffalo-wzr-1750dhp.dts | 23 +++++++-
.../broadcom/bcm4708-linksys-ea6300-v1.dts | 12 ++++-
.../broadcom/bcm4708-linksys-ea6500-v2.dts | 12 ++++-
.../dts/broadcom/bcm4708-netgear-r6250.dts | 12 ++++-
.../dts/broadcom/bcm4708-netgear-r6300-v2.dts | 12 ++++-
.../dts/broadcom/bcm47081-luxul-xwr-1200.dts | 12 ++++-
.../broadcom/bcm47081-tplink-archer-c5-v2.dts | 12 ++++-
.../dts/broadcom/bcm4709-asus-rt-ac3200.dts | 12 ++++-
.../broadcom/bcm4709-buffalo-wxr-1900dhp.dts | 13 ++++-
.../dts/broadcom/bcm4709-linksys-ea9200.dts | 24 ++++++++-
.../dts/broadcom/bcm4709-netgear-r7000.dts | 14 ++++-
.../dts/broadcom/bcm4709-netgear-r8000.dts | 14 ++++-
.../broadcom/bcm4709-tplink-archer-c9-v1.dts | 24 ++++++++-
.../dts/broadcom/bcm47094-asus-rt-ac3100.dtsi | 12 ++++-
.../dts/broadcom/bcm47094-asus-rt-ac5300.dts | 12 ++++-
.../dts/broadcom/bcm47094-dlink-dir-885l.dts | 12 ++++-
.../dts/broadcom/bcm47094-dlink-dir-890l.dts | 24 ++++++++-
.../broadcom/bcm47094-linksys-panamera.dts | 24 ++++++++-
.../dts/broadcom/bcm47094-luxul-abr-4500.dts | 12 ++++-
.../dts/broadcom/bcm47094-luxul-xbr-4500.dts | 12 ++++-
.../dts/broadcom/bcm47094-luxul-xwr-3100.dts | 12 ++++-
.../broadcom/bcm47094-luxul-xwr-3150-v1.dts | 12 ++++-
.../arm/boot/dts/broadcom/bcm947189acdbmr.dts | 12 ++++-
drivers/usb/host/bcma-hcd.c | 54 +++++++++++++++----
26 files changed, 384 insertions(+), 45 deletions(-)
--
2.55.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCHv2 1/2] usb: bcma: add regulator support
2026-09-21 21:41 [PATCHv2 0/2] usb: bcma: control VBUS via a regulator Rosen Penev
@ 2026-09-21 21:41 ` Rosen Penev
2026-09-21 21:59 ` Rafał Miłecki
2026-09-21 21:41 ` [PATCHv2 2/2] ARM: dts: broadcom: model USB VBUS power with regulator-fixed Rosen Penev
1 sibling, 1 reply; 5+ messages in thread
From: Rosen Penev @ 2026-09-21 21:41 UTC (permalink / raw)
To: devicetree
Cc: Florian Fainelli, Hauke Mehrtens, Rafał Miłecki,
Broadcom internal kernel review list, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Greg Kroah-Hartman,
moderated list:BROADCOM BCM5301X ARM ARCHITECTURE, open list,
open list:USB SUBSYSTEM
bcma-hcd drives the USB power line by grabbing the undocumented
"vcc-gpio" from the controller node and poking it through gpiolib.
Besides relying on a non-standard binding, this cannot work on boards
such as the NETGEAR R7000 and R8000 where one chipcommon GPIO powers
both the USB2 and USB3 cores: the two controllers each request that
GPIO exclusively, so the second one fails with -EBUSY and its port
stays dead.
Add support for the standard regulator interface. Each core obtains its
(shared) VBUS supply through devm_regulator_get() and the regulator core
reference-counts the enable/disable requests, allowing both controllers to
drive one GPIO without conflicts.
Assisted-by: LLM
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
drivers/usb/host/bcma-hcd.c | 54 +++++++++++++++++++++++++++++--------
1 file changed, 43 insertions(+), 11 deletions(-)
diff --git a/drivers/usb/host/bcma-hcd.c b/drivers/usb/host/bcma-hcd.c
index 519386255886..0d5a220b6988 100644
--- a/drivers/usb/host/bcma-hcd.c
+++ b/drivers/usb/host/bcma-hcd.c
@@ -26,6 +26,7 @@
#include <linux/slab.h>
#include <linux/of.h>
#include <linux/of_platform.h>
+#include <linux/regulator/consumer.h>
#include <linux/usb/ehci_pdriver.h>
#include <linux/usb/ohci_pdriver.h>
@@ -41,6 +42,7 @@ struct bcma_hcd_device {
struct platform_device *ehci_dev;
struct platform_device *ohci_dev;
struct gpio_desc *gpio_desc;
+ struct regulator *regulator;
};
/* Wait for bitmask in a register to get set or cleared.
@@ -280,14 +282,23 @@ static int bcma_hcd_usb20_ns_init(struct bcma_hcd_device *bcma_hcd)
return 0;
}
-static void bcma_hci_platform_power_gpio(struct bcma_device *dev, bool val)
+static int bcma_hci_platform_power(struct bcma_device *dev, bool on)
{
struct bcma_hcd_device *usb_dev = bcma_get_drvdata(dev);
+ int err;
+
+ if (usb_dev->gpio_desc)
+ return gpiod_set_value(usb_dev->gpio_desc, on);
- if (!usb_dev->gpio_desc)
- return;
+ if (!usb_dev->regulator)
+ return 0;
- gpiod_set_value(usb_dev->gpio_desc, val);
+ if (on)
+ err = regulator_enable(usb_dev->regulator);
+ else
+ err = regulator_disable(usb_dev->regulator);
+
+ return err;
}
static const struct usb_ehci_pdata ehci_pdata = {
@@ -395,12 +406,12 @@ static int bcma_hcd_usb30_init(struct bcma_hcd_device *bcma_hcd)
static int bcma_hcd_probe(struct bcma_device *core)
{
int err;
+ struct device *dev = &core->dev;
struct bcma_hcd_device *usb_dev;
/* TODO: Probably need checks here; is the core connected? */
- usb_dev = devm_kzalloc(&core->dev, sizeof(struct bcma_hcd_device),
- GFP_KERNEL);
+ usb_dev = devm_kzalloc(dev, sizeof(*usb_dev), GFP_KERNEL);
if (!usb_dev)
return -ENOMEM;
usb_dev->core = core;
@@ -411,6 +422,14 @@ static int bcma_hcd_probe(struct bcma_device *core)
return dev_err_probe(&core->dev, PTR_ERR(usb_dev->gpio_desc),
"error obtaining VCC GPIO");
+ usb_dev->regulator = devm_regulator_get(dev, "vbus");
+ if (IS_ERR(usb_dev->regulator))
+ return dev_err_probe(dev, PTR_ERR(usb_dev->regulator), "error obtaining VBUS regulator");
+
+ err = regulator_enable(usb_dev->regulator);
+ if (err)
+ return dev_err_probe(dev, err, "error enabling VCC regulator");
+
switch (core->id.id) {
case BCMA_CORE_USB20_HOST:
if (IS_ENABLED(CONFIG_ARM))
@@ -427,13 +446,16 @@ static int bcma_hcd_probe(struct bcma_device *core)
err = bcma_hcd_usb30_init(usb_dev);
break;
default:
- return -ENODEV;
+ err = -ENODEV;
}
if (err)
- return err;
+ goto error;
bcma_set_drvdata(core, usb_dev);
return 0;
+error:
+ regulator_disable(usb_dev->regulator);
+ return err;
}
static void bcma_hcd_remove(struct bcma_device *dev)
@@ -442,6 +464,8 @@ static void bcma_hcd_remove(struct bcma_device *dev)
struct platform_device *ohci_dev = usb_dev->ohci_dev;
struct platform_device *ehci_dev = usb_dev->ehci_dev;
+ regulator_disable(usb_dev->regulator);
+
if (ohci_dev)
platform_device_unregister(ohci_dev);
if (ehci_dev)
@@ -452,7 +476,7 @@ static void bcma_hcd_remove(struct bcma_device *dev)
static void bcma_hcd_shutdown(struct bcma_device *dev)
{
- bcma_hci_platform_power_gpio(dev, false);
+ bcma_hci_platform_power(dev, false);
bcma_core_disable(dev, 0);
}
@@ -460,7 +484,11 @@ static void bcma_hcd_shutdown(struct bcma_device *dev)
static int bcma_hcd_suspend(struct bcma_device *dev)
{
- bcma_hci_platform_power_gpio(dev, false);
+ int err;
+
+ err = bcma_hci_platform_power(dev, false);
+ if (err)
+ return err;
bcma_core_disable(dev, 0);
return 0;
@@ -468,7 +496,11 @@ static int bcma_hcd_suspend(struct bcma_device *dev)
static int bcma_hcd_resume(struct bcma_device *dev)
{
- bcma_hci_platform_power_gpio(dev, true);
+ int err;
+
+ err = bcma_hci_platform_power(dev, true);
+ if (err)
+ return err;
bcma_core_enable(dev, 0);
return 0;
--
2.55.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCHv2 2/2] ARM: dts: broadcom: model USB VBUS power with regulator-fixed
2026-09-21 21:41 [PATCHv2 0/2] usb: bcma: control VBUS via a regulator Rosen Penev
2026-09-21 21:41 ` [PATCHv2 1/2] usb: bcma: add regulator support Rosen Penev
@ 2026-09-21 21:41 ` Rosen Penev
1 sibling, 0 replies; 5+ messages in thread
From: Rosen Penev @ 2026-09-21 21:41 UTC (permalink / raw)
To: devicetree
Cc: Florian Fainelli, Hauke Mehrtens, Rafał Miłecki,
Broadcom internal kernel review list, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Greg Kroah-Hartman,
moderated list:BROADCOM BCM5301X ARM ARCHITECTURE, open list,
open list:USB SUBSYSTEM
Replace the undocumented "vcc-gpio" property on the usb2/usb3
controller nodes with the standard vbus-supply/regulator-fixed model.
Boards now declare a regulator bound to the chipcommon GPIO that
bcma-hcd used to poke directly, one per power rail.
Polarity is preserved: rails that used a GPIO_ACTIVE_HIGH are marked
enable-active-high, while the Buffalo usb3 rails keep GPIO_ACTIVE_LOW
and rely on the binding's active-low default. regulator-boot-on mirrors
the rail being left enabled by CFE so the power line is never toggled
during probe.
Assisted-by: LLM
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
.../broadcom/bcm4708-buffalo-wxr-1750dhp.dts | 12 +++++++++-
.../bcm4708-buffalo-wzr-1166dhp-common.dtsi | 23 ++++++++++++++++--
.../broadcom/bcm4708-buffalo-wzr-1750dhp.dts | 23 ++++++++++++++++--
.../broadcom/bcm4708-linksys-ea6300-v1.dts | 12 +++++++++-
.../broadcom/bcm4708-linksys-ea6500-v2.dts | 12 +++++++++-
.../dts/broadcom/bcm4708-netgear-r6250.dts | 12 +++++++++-
.../dts/broadcom/bcm4708-netgear-r6300-v2.dts | 12 +++++++++-
.../dts/broadcom/bcm47081-luxul-xwr-1200.dts | 12 +++++++++-
.../broadcom/bcm47081-tplink-archer-c5-v2.dts | 12 +++++++++-
.../dts/broadcom/bcm4709-asus-rt-ac3200.dts | 12 +++++++++-
.../broadcom/bcm4709-buffalo-wxr-1900dhp.dts | 13 ++++++++--
.../dts/broadcom/bcm4709-linksys-ea9200.dts | 24 +++++++++++++++++--
.../dts/broadcom/bcm4709-netgear-r7000.dts | 14 +++++++++--
.../dts/broadcom/bcm4709-netgear-r8000.dts | 14 +++++++++--
.../broadcom/bcm4709-tplink-archer-c9-v1.dts | 24 +++++++++++++++++--
.../dts/broadcom/bcm47094-asus-rt-ac3100.dtsi | 12 +++++++++-
.../dts/broadcom/bcm47094-asus-rt-ac5300.dts | 12 +++++++++-
.../dts/broadcom/bcm47094-dlink-dir-885l.dts | 12 +++++++++-
.../dts/broadcom/bcm47094-dlink-dir-890l.dts | 24 +++++++++++++++++--
.../broadcom/bcm47094-linksys-panamera.dts | 24 +++++++++++++++++--
.../dts/broadcom/bcm47094-luxul-abr-4500.dts | 12 +++++++++-
.../dts/broadcom/bcm47094-luxul-xbr-4500.dts | 12 +++++++++-
.../dts/broadcom/bcm47094-luxul-xwr-3100.dts | 12 +++++++++-
.../broadcom/bcm47094-luxul-xwr-3150-v1.dts | 12 +++++++++-
.../arm/boot/dts/broadcom/bcm947189acdbmr.dts | 12 +++++++++-
25 files changed, 341 insertions(+), 34 deletions(-)
diff --git a/arch/arm/boot/dts/broadcom/bcm4708-buffalo-wxr-1750dhp.dts b/arch/arm/boot/dts/broadcom/bcm4708-buffalo-wxr-1750dhp.dts
index f5c95c9a712e..80414c72f912 100644
--- a/arch/arm/boot/dts/broadcom/bcm4708-buffalo-wxr-1750dhp.dts
+++ b/arch/arm/boot/dts/broadcom/bcm4708-buffalo-wxr-1750dhp.dts
@@ -101,6 +101,16 @@ led-usb {
trigger-sources = <&xhci_port1 &ehci_port1 &ohci_port1>;
};
};
+
+ usb_power: regulator-usb {
+ compatible = "regulator-fixed";
+ regulator-name = "usb-vcc";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-boot-on;
+ gpios = <&chipcommon 10 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
};
&srab {
@@ -130,7 +140,7 @@ port@4 {
};
&usb3 {
- vcc-gpio = <&chipcommon 10 GPIO_ACTIVE_HIGH>;
+ vbus-supply = <&usb_power>;
};
&usb3_phy {
diff --git a/arch/arm/boot/dts/broadcom/bcm4708-buffalo-wzr-1166dhp-common.dtsi b/arch/arm/boot/dts/broadcom/bcm4708-buffalo-wzr-1166dhp-common.dtsi
index 9f9084269ef5..2823592ebe76 100644
--- a/arch/arm/boot/dts/broadcom/bcm4708-buffalo-wzr-1166dhp-common.dtsi
+++ b/arch/arm/boot/dts/broadcom/bcm4708-buffalo-wzr-1166dhp-common.dtsi
@@ -136,14 +136,33 @@ button-eject {
gpios = <&chipcommon 15 GPIO_ACTIVE_LOW>;
};
};
+
+ usb2_power: regulator-usb2 {
+ compatible = "regulator-fixed";
+ regulator-name = "usb2-vcc";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-boot-on;
+ gpios = <&chipcommon 9 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
+
+ usb3_power: regulator-usb3 {
+ compatible = "regulator-fixed";
+ regulator-name = "usb3-vcc";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-boot-on;
+ gpios = <&chipcommon 10 GPIO_ACTIVE_LOW>;
+ };
};
&usb2 {
- vcc-gpio = <&chipcommon 9 GPIO_ACTIVE_HIGH>;
+ vbus-supply = <&usb2_power>;
};
&usb3 {
- vcc-gpio = <&chipcommon 10 GPIO_ACTIVE_LOW>;
+ vbus-supply = <&usb3_power>;
};
&spi_nor {
diff --git a/arch/arm/boot/dts/broadcom/bcm4708-buffalo-wzr-1750dhp.dts b/arch/arm/boot/dts/broadcom/bcm4708-buffalo-wzr-1750dhp.dts
index 95ef6ca7210b..32088b52cacb 100644
--- a/arch/arm/boot/dts/broadcom/bcm4708-buffalo-wzr-1750dhp.dts
+++ b/arch/arm/boot/dts/broadcom/bcm4708-buffalo-wzr-1750dhp.dts
@@ -132,14 +132,33 @@ button-eject {
gpios = <&chipcommon 15 GPIO_ACTIVE_LOW>;
};
};
+
+ usb2_power: regulator-usb2 {
+ compatible = "regulator-fixed";
+ regulator-name = "usb2-vcc";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-boot-on;
+ gpios = <&chipcommon 9 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
+
+ usb3_power: regulator-usb3 {
+ compatible = "regulator-fixed";
+ regulator-name = "usb3-vcc";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-boot-on;
+ gpios = <&chipcommon 10 GPIO_ACTIVE_LOW>;
+ };
};
&usb2 {
- vcc-gpio = <&chipcommon 9 GPIO_ACTIVE_HIGH>;
+ vbus-supply = <&usb2_power>;
};
&usb3 {
- vcc-gpio = <&chipcommon 10 GPIO_ACTIVE_LOW>;
+ vbus-supply = <&usb3_power>;
};
&spi_nor {
diff --git a/arch/arm/boot/dts/broadcom/bcm4708-linksys-ea6300-v1.dts b/arch/arm/boot/dts/broadcom/bcm4708-linksys-ea6300-v1.dts
index 03d5546a147c..4c94dac7c832 100644
--- a/arch/arm/boot/dts/broadcom/bcm4708-linksys-ea6300-v1.dts
+++ b/arch/arm/boot/dts/broadcom/bcm4708-linksys-ea6300-v1.dts
@@ -41,6 +41,16 @@ button-restart {
gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>;
};
};
+
+ usb_power: regulator-usb {
+ compatible = "regulator-fixed";
+ regulator-name = "usb-vcc";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-boot-on;
+ gpios = <&chipcommon 10 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
};
&usb3_phy {
@@ -48,5 +58,5 @@ &usb3_phy {
};
&usb3 {
- vcc-gpio = <&chipcommon 10 GPIO_ACTIVE_HIGH>;
+ vbus-supply = <&usb_power>;
};
diff --git a/arch/arm/boot/dts/broadcom/bcm4708-linksys-ea6500-v2.dts b/arch/arm/boot/dts/broadcom/bcm4708-linksys-ea6500-v2.dts
index ad246f9a734a..1d96f8a97149 100644
--- a/arch/arm/boot/dts/broadcom/bcm4708-linksys-ea6500-v2.dts
+++ b/arch/arm/boot/dts/broadcom/bcm4708-linksys-ea6500-v2.dts
@@ -38,6 +38,16 @@ button-restart {
gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>;
};
};
+
+ usb_power: regulator-usb {
+ compatible = "regulator-fixed";
+ regulator-name = "usb-vcc";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-boot-on;
+ gpios = <&chipcommon 10 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
};
&usb3_phy {
@@ -45,5 +55,5 @@ &usb3_phy {
};
&usb3 {
- vcc-gpio = <&chipcommon 10 GPIO_ACTIVE_HIGH>;
+ vbus-supply = <&usb_power>;
};
diff --git a/arch/arm/boot/dts/broadcom/bcm4708-netgear-r6250.dts b/arch/arm/boot/dts/broadcom/bcm4708-netgear-r6250.dts
index 2bdbc7d18b0e..7e9619432254 100644
--- a/arch/arm/boot/dts/broadcom/bcm4708-netgear-r6250.dts
+++ b/arch/arm/boot/dts/broadcom/bcm4708-netgear-r6250.dts
@@ -81,10 +81,20 @@ button-restart {
gpios = <&chipcommon 6 GPIO_ACTIVE_LOW>;
};
};
+
+ usb_power: regulator-usb {
+ compatible = "regulator-fixed";
+ regulator-name = "usb-vcc";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-boot-on;
+ gpios = <&chipcommon 0 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
};
&usb3 {
- vcc-gpio = <&chipcommon 0 GPIO_ACTIVE_HIGH>;
+ vbus-supply = <&usb_power>;
};
&spi_nor {
diff --git a/arch/arm/boot/dts/broadcom/bcm4708-netgear-r6300-v2.dts b/arch/arm/boot/dts/broadcom/bcm4708-netgear-r6300-v2.dts
index 55f0d9e90d5f..6458b0bbda35 100644
--- a/arch/arm/boot/dts/broadcom/bcm4708-netgear-r6300-v2.dts
+++ b/arch/arm/boot/dts/broadcom/bcm4708-netgear-r6300-v2.dts
@@ -77,6 +77,16 @@ button-restart {
gpios = <&chipcommon 6 GPIO_ACTIVE_LOW>;
};
};
+
+ usb_power: regulator-usb {
+ compatible = "regulator-fixed";
+ regulator-name = "usb-vcc";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-boot-on;
+ gpios = <&chipcommon 0 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
};
&spi_nor {
@@ -88,5 +98,5 @@ &usb3_phy {
};
&usb3 {
- vcc-gpio = <&chipcommon 0 GPIO_ACTIVE_HIGH>;
+ vbus-supply = <&usb_power>;
};
diff --git a/arch/arm/boot/dts/broadcom/bcm47081-luxul-xwr-1200.dts b/arch/arm/boot/dts/broadcom/bcm47081-luxul-xwr-1200.dts
index 73ff1694a4a0..360237a6f80a 100644
--- a/arch/arm/boot/dts/broadcom/bcm47081-luxul-xwr-1200.dts
+++ b/arch/arm/boot/dts/broadcom/bcm47081-luxul-xwr-1200.dts
@@ -104,10 +104,20 @@ button-restart {
gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>;
};
};
+
+ usb_power: regulator-usb {
+ compatible = "regulator-fixed";
+ regulator-name = "usb-vcc";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-boot-on;
+ gpios = <&chipcommon 9 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
};
&usb2 {
- vcc-gpio = <&chipcommon 9 GPIO_ACTIVE_HIGH>;
+ vbus-supply = <&usb_power>;
};
&gmac0 {
diff --git a/arch/arm/boot/dts/broadcom/bcm47081-tplink-archer-c5-v2.dts b/arch/arm/boot/dts/broadcom/bcm47081-tplink-archer-c5-v2.dts
index b6a5886698b2..baac898761b6 100644
--- a/arch/arm/boot/dts/broadcom/bcm47081-tplink-archer-c5-v2.dts
+++ b/arch/arm/boot/dts/broadcom/bcm47081-tplink-archer-c5-v2.dts
@@ -89,6 +89,16 @@ button-restart {
gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>;
};
};
+
+ usb_power: regulator-usb {
+ compatible = "regulator-fixed";
+ regulator-name = "usb-vcc";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-boot-on;
+ gpios = <&chipcommon 9 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
};
&spi_nor {
@@ -109,5 +119,5 @@ partition-file-system {
};
&usb2 {
- vcc-gpio = <&chipcommon 9 GPIO_ACTIVE_HIGH>;
+ vbus-supply = <&usb_power>;
};
diff --git a/arch/arm/boot/dts/broadcom/bcm4709-asus-rt-ac3200.dts b/arch/arm/boot/dts/broadcom/bcm4709-asus-rt-ac3200.dts
index 3da2daee0c84..6a2516effc07 100644
--- a/arch/arm/boot/dts/broadcom/bcm4709-asus-rt-ac3200.dts
+++ b/arch/arm/boot/dts/broadcom/bcm4709-asus-rt-ac3200.dts
@@ -73,6 +73,16 @@ led-wps {
gpios = <&chipcommon 14 GPIO_ACTIVE_LOW>;
};
};
+
+ usb_power: regulator-usb {
+ compatible = "regulator-fixed";
+ regulator-name = "usb-vcc";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-boot-on;
+ gpios = <&chipcommon 9 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
};
&gmac0 {
@@ -142,7 +152,7 @@ port@4 {
};
&usb2 {
- vcc-gpio = <&chipcommon 9 GPIO_ACTIVE_HIGH>;
+ vbus-supply = <&usb_power>;
};
&usb3_phy {
diff --git a/arch/arm/boot/dts/broadcom/bcm4709-buffalo-wxr-1900dhp.dts b/arch/arm/boot/dts/broadcom/bcm4709-buffalo-wxr-1900dhp.dts
index b7cd2faa30ce..be6e164d1a51 100644
--- a/arch/arm/boot/dts/broadcom/bcm4709-buffalo-wxr-1900dhp.dts
+++ b/arch/arm/boot/dts/broadcom/bcm4709-buffalo-wxr-1900dhp.dts
@@ -116,11 +116,20 @@ button-eject {
gpios = <&chipcommon 20 GPIO_ACTIVE_LOW>;
};
};
-};
+ usb_power: regulator-usb {
+ compatible = "regulator-fixed";
+ regulator-name = "usb-vcc";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-boot-on;
+ gpios = <&chipcommon 13 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
+};
&usb2 {
- vcc-gpio = <&chipcommon 13 GPIO_ACTIVE_HIGH>;
+ vbus-supply = <&usb_power>;
};
&spi_nor {
diff --git a/arch/arm/boot/dts/broadcom/bcm4709-linksys-ea9200.dts b/arch/arm/boot/dts/broadcom/bcm4709-linksys-ea9200.dts
index 37593e7582ba..e0a7e9510a08 100644
--- a/arch/arm/boot/dts/broadcom/bcm4709-linksys-ea9200.dts
+++ b/arch/arm/boot/dts/broadcom/bcm4709-linksys-ea9200.dts
@@ -91,6 +91,26 @@ led-3 {
linux,default-trigger = "default-on";
};
};
+
+ usb2_power: regulator-usb2 {
+ compatible = "regulator-fixed";
+ regulator-name = "usb2-vcc";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-boot-on;
+ gpios = <&chipcommon 13 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
+
+ usb3_power: regulator-usb3 {
+ compatible = "regulator-fixed";
+ regulator-name = "usb3-vcc";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-boot-on;
+ gpios = <&chipcommon 14 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
};
&pcie_bridge0 {
@@ -155,11 +175,11 @@ &usb3_phy {
};
&usb2 {
- vcc-gpios = <&chipcommon 13 GPIO_ACTIVE_HIGH>;
+ vbus-supply = <&usb2_power>;
};
&usb3 {
- vcc-gpios = <&chipcommon 14 GPIO_ACTIVE_HIGH>;
+ vbus-supply = <&usb3_power>;
};
&gmac2 {
diff --git a/arch/arm/boot/dts/broadcom/bcm4709-netgear-r7000.dts b/arch/arm/boot/dts/broadcom/bcm4709-netgear-r7000.dts
index 24ba8f8f9bf3..c46c1407be8c 100644
--- a/arch/arm/boot/dts/broadcom/bcm4709-netgear-r7000.dts
+++ b/arch/arm/boot/dts/broadcom/bcm4709-netgear-r7000.dts
@@ -91,14 +91,24 @@ button-restart {
gpios = <&chipcommon 6 GPIO_ACTIVE_LOW>;
};
};
+
+ usb_power: regulator-usb {
+ compatible = "regulator-fixed";
+ regulator-name = "usb-vcc";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-boot-on;
+ gpios = <&chipcommon 0 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
};
&usb2 {
- vcc-gpio = <&chipcommon 0 GPIO_ACTIVE_HIGH>;
+ vbus-supply = <&usb_power>;
};
&usb3 {
- vcc-gpio = <&chipcommon 0 GPIO_ACTIVE_HIGH>;
+ vbus-supply = <&usb_power>;
};
&usb3_phy {
diff --git a/arch/arm/boot/dts/broadcom/bcm4709-netgear-r8000.dts b/arch/arm/boot/dts/broadcom/bcm4709-netgear-r8000.dts
index a4b135d37659..56d35d61a8be 100644
--- a/arch/arm/boot/dts/broadcom/bcm4709-netgear-r8000.dts
+++ b/arch/arm/boot/dts/broadcom/bcm4709-netgear-r8000.dts
@@ -184,14 +184,24 @@ wifi@0,0 {
};
};
};
+
+ usb_power: regulator-usb {
+ compatible = "regulator-fixed";
+ regulator-name = "usb-vcc";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-boot-on;
+ gpios = <&chipcommon 0 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
};
&usb2 {
- vcc-gpio = <&chipcommon 0 GPIO_ACTIVE_HIGH>;
+ vbus-supply = <&usb_power>;
};
&usb3 {
- vcc-gpio = <&chipcommon 0 GPIO_ACTIVE_HIGH>;
+ vbus-supply = <&usb_power>;
};
&usb3_phy {
diff --git a/arch/arm/boot/dts/broadcom/bcm4709-tplink-archer-c9-v1.dts b/arch/arm/boot/dts/broadcom/bcm4709-tplink-archer-c9-v1.dts
index 5a8b2b1567e6..3c9c7ce5dfd5 100644
--- a/arch/arm/boot/dts/broadcom/bcm4709-tplink-archer-c9-v1.dts
+++ b/arch/arm/boot/dts/broadcom/bcm4709-tplink-archer-c9-v1.dts
@@ -90,14 +90,34 @@ button-restart {
gpios = <&chipcommon 3 GPIO_ACTIVE_LOW>;
};
};
+
+ usb2_power: regulator-usb2 {
+ compatible = "regulator-fixed";
+ regulator-name = "usb2-vcc";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-boot-on;
+ gpios = <&chipcommon 13 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
+
+ usb3_power: regulator-usb3 {
+ compatible = "regulator-fixed";
+ regulator-name = "usb3-vcc";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-boot-on;
+ gpios = <&chipcommon 12 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
};
&usb2 {
- vcc-gpio = <&chipcommon 13 GPIO_ACTIVE_HIGH>;
+ vbus-supply = <&usb2_power>;
};
&usb3 {
- vcc-gpio = <&chipcommon 12 GPIO_ACTIVE_HIGH>;
+ vbus-supply = <&usb3_power>;
};
&spi_nor {
diff --git a/arch/arm/boot/dts/broadcom/bcm47094-asus-rt-ac3100.dtsi b/arch/arm/boot/dts/broadcom/bcm47094-asus-rt-ac3100.dtsi
index 2d2e7e581291..6012cebb2512 100644
--- a/arch/arm/boot/dts/broadcom/bcm47094-asus-rt-ac3100.dtsi
+++ b/arch/arm/boot/dts/broadcom/bcm47094-asus-rt-ac3100.dtsi
@@ -98,6 +98,16 @@ led-wps {
gpios = <&chipcommon 19 GPIO_ACTIVE_LOW>;
};
};
+
+ usb_power: regulator-usb {
+ compatible = "regulator-fixed";
+ regulator-name = "usb-vcc";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-boot-on;
+ gpios = <&chipcommon 9 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
};
&nandcs {
@@ -167,7 +177,7 @@ port@8 {
};
&usb2 {
- vcc-gpio = <&chipcommon 9 GPIO_ACTIVE_HIGH>;
+ vbus-supply = <&usb_power>;
};
&usb3_phy {
diff --git a/arch/arm/boot/dts/broadcom/bcm47094-asus-rt-ac5300.dts b/arch/arm/boot/dts/broadcom/bcm47094-asus-rt-ac5300.dts
index 8bf623c67de0..2e4b2f40d525 100644
--- a/arch/arm/boot/dts/broadcom/bcm47094-asus-rt-ac5300.dts
+++ b/arch/arm/boot/dts/broadcom/bcm47094-asus-rt-ac5300.dts
@@ -79,6 +79,16 @@ led-wps {
gpios = <&chipcommon 19 GPIO_ACTIVE_LOW>;
};
};
+
+ usb_power: regulator-usb {
+ compatible = "regulator-fixed";
+ regulator-name = "usb-vcc";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-boot-on;
+ gpios = <&chipcommon 9 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
};
&gmac0 {
@@ -151,7 +161,7 @@ port@4 {
};
&usb2 {
- vcc-gpio = <&chipcommon 9 GPIO_ACTIVE_HIGH>;
+ vbus-supply = <&usb_power>;
};
&usb3_phy {
diff --git a/arch/arm/boot/dts/broadcom/bcm47094-dlink-dir-885l.dts b/arch/arm/boot/dts/broadcom/bcm47094-dlink-dir-885l.dts
index c5099defe9f9..8cf704b3d462 100644
--- a/arch/arm/boot/dts/broadcom/bcm47094-dlink-dir-885l.dts
+++ b/arch/arm/boot/dts/broadcom/bcm47094-dlink-dir-885l.dts
@@ -115,10 +115,20 @@ button-restart {
gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>;
};
};
+
+ usb_power: regulator-usb {
+ compatible = "regulator-fixed";
+ regulator-name = "usb-vcc";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-boot-on;
+ gpios = <&chipcommon 18 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
};
&usb3 {
- vcc-gpio = <&chipcommon 18 GPIO_ACTIVE_HIGH>;
+ vbus-supply = <&usb_power>;
};
&gmac0 {
diff --git a/arch/arm/boot/dts/broadcom/bcm47094-dlink-dir-890l.dts b/arch/arm/boot/dts/broadcom/bcm47094-dlink-dir-890l.dts
index 944d592dee2c..bf7291d98bd4 100644
--- a/arch/arm/boot/dts/broadcom/bcm47094-dlink-dir-890l.dts
+++ b/arch/arm/boot/dts/broadcom/bcm47094-dlink-dir-890l.dts
@@ -117,6 +117,26 @@ et0macaddr: et0macaddr {
#nvmem-cell-cells = <1>;
};
};
+
+ usb2_power: regulator-usb2 {
+ compatible = "regulator-fixed";
+ regulator-name = "usb2-vcc";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-boot-on;
+ gpios = <&chipcommon 21 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
+
+ usb3_power: regulator-usb3 {
+ compatible = "regulator-fixed";
+ regulator-name = "usb3-vcc";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-boot-on;
+ gpios = <&chipcommon 18 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
};
&gmac2 {
@@ -158,11 +178,11 @@ firmware@0 {
};
&usb2 {
- vcc-gpios = <&chipcommon 21 GPIO_ACTIVE_HIGH>;
+ vbus-supply = <&usb2_power>;
};
&usb3 {
- vcc-gpios = <&chipcommon 18 GPIO_ACTIVE_HIGH>;
+ vbus-supply = <&usb3_power>;
};
&usb3_phy {
diff --git a/arch/arm/boot/dts/broadcom/bcm47094-linksys-panamera.dts b/arch/arm/boot/dts/broadcom/bcm47094-linksys-panamera.dts
index bdbd0f097925..4f965370f024 100644
--- a/arch/arm/boot/dts/broadcom/bcm47094-linksys-panamera.dts
+++ b/arch/arm/boot/dts/broadcom/bcm47094-linksys-panamera.dts
@@ -195,14 +195,34 @@ fixed-link {
};
};
};
+
+ usb2_power: regulator-usb2 {
+ compatible = "regulator-fixed";
+ regulator-name = "usb2-vcc";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-boot-on;
+ gpios = <&chipcommon 13 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
+
+ usb3_power: regulator-usb3 {
+ compatible = "regulator-fixed";
+ regulator-name = "usb3-vcc";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-boot-on;
+ gpios = <&chipcommon 14 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
};
&usb2 {
- vcc-gpio = <&chipcommon 13 GPIO_ACTIVE_HIGH>;
+ vbus-supply = <&usb2_power>;
};
&usb3 {
- vcc-gpio = <&chipcommon 14 GPIO_ACTIVE_HIGH>;
+ vbus-supply = <&usb3_power>;
};
&srab {
diff --git a/arch/arm/boot/dts/broadcom/bcm47094-luxul-abr-4500.dts b/arch/arm/boot/dts/broadcom/bcm47094-luxul-abr-4500.dts
index e374062eb5b7..c6a1d02f7fbb 100644
--- a/arch/arm/boot/dts/broadcom/bcm47094-luxul-abr-4500.dts
+++ b/arch/arm/boot/dts/broadcom/bcm47094-luxul-abr-4500.dts
@@ -59,10 +59,20 @@ button-restart {
gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>;
};
};
+
+ usb_power: regulator-usb {
+ compatible = "regulator-fixed";
+ regulator-name = "usb-vcc";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-boot-on;
+ gpios = <&chipcommon 18 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
};
&usb3 {
- vcc-gpio = <&chipcommon 18 GPIO_ACTIVE_HIGH>;
+ vbus-supply = <&usb_power>;
};
&gmac0 {
diff --git a/arch/arm/boot/dts/broadcom/bcm47094-luxul-xbr-4500.dts b/arch/arm/boot/dts/broadcom/bcm47094-luxul-xbr-4500.dts
index cf95af9db1e6..cf5bd700976b 100644
--- a/arch/arm/boot/dts/broadcom/bcm47094-luxul-xbr-4500.dts
+++ b/arch/arm/boot/dts/broadcom/bcm47094-luxul-xbr-4500.dts
@@ -59,10 +59,20 @@ button-restart {
gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>;
};
};
+
+ usb_power: regulator-usb {
+ compatible = "regulator-fixed";
+ regulator-name = "usb-vcc";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-boot-on;
+ gpios = <&chipcommon 18 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
};
&usb3 {
- vcc-gpio = <&chipcommon 18 GPIO_ACTIVE_HIGH>;
+ vbus-supply = <&usb_power>;
};
&gmac0 {
diff --git a/arch/arm/boot/dts/broadcom/bcm47094-luxul-xwr-3100.dts b/arch/arm/boot/dts/broadcom/bcm47094-luxul-xwr-3100.dts
index 4d0ba315a204..74c6fe007210 100644
--- a/arch/arm/boot/dts/broadcom/bcm47094-luxul-xwr-3100.dts
+++ b/arch/arm/boot/dts/broadcom/bcm47094-luxul-xwr-3100.dts
@@ -99,10 +99,20 @@ button-restart {
gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>;
};
};
+
+ usb_power: regulator-usb {
+ compatible = "regulator-fixed";
+ regulator-name = "usb-vcc";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-boot-on;
+ gpios = <&chipcommon 18 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
};
&usb3 {
- vcc-gpio = <&chipcommon 18 GPIO_ACTIVE_HIGH>;
+ vbus-supply = <&usb_power>;
};
&gmac0 {
diff --git a/arch/arm/boot/dts/broadcom/bcm47094-luxul-xwr-3150-v1.dts b/arch/arm/boot/dts/broadcom/bcm47094-luxul-xwr-3150-v1.dts
index 8e487f60a2cc..8ea19bd2ae35 100644
--- a/arch/arm/boot/dts/broadcom/bcm47094-luxul-xwr-3150-v1.dts
+++ b/arch/arm/boot/dts/broadcom/bcm47094-luxul-xwr-3150-v1.dts
@@ -74,6 +74,16 @@ button-restart {
gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>;
};
};
+
+ usb_power: regulator-usb {
+ compatible = "regulator-fixed";
+ regulator-name = "usb-vcc";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-boot-on;
+ gpios = <&chipcommon 18 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
};
&gmac0 {
@@ -98,7 +108,7 @@ wifi@0,0 {
};
&usb3 {
- vcc-gpio = <&chipcommon 18 GPIO_ACTIVE_HIGH>;
+ vbus-supply = <&usb_power>;
};
&usb3_phy {
diff --git a/arch/arm/boot/dts/broadcom/bcm947189acdbmr.dts b/arch/arm/boot/dts/broadcom/bcm947189acdbmr.dts
index 0b8727ae6f16..9106a5907957 100644
--- a/arch/arm/boot/dts/broadcom/bcm947189acdbmr.dts
+++ b/arch/arm/boot/dts/broadcom/bcm947189acdbmr.dts
@@ -69,6 +69,16 @@ spi {
/* External BCM6802 MoCA chip is connected */
};
+
+ usb_power: regulator-usb {
+ compatible = "regulator-fixed";
+ regulator-name = "usb-vcc";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-boot-on;
+ gpios = <&chipcommon 8 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
};
&pcie0 {
@@ -92,5 +102,5 @@ wifi@0,1,0 {
};
&usb2 {
- vcc-gpio = <&chipcommon 8 GPIO_ACTIVE_HIGH>;
+ vbus-supply = <&usb_power>;
};
--
2.55.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCHv2 1/2] usb: bcma: add regulator support
2026-09-21 21:41 ` [PATCHv2 1/2] usb: bcma: add regulator support Rosen Penev
@ 2026-09-21 21:59 ` Rafał Miłecki
2026-09-21 22:06 ` Rosen Penev
0 siblings, 1 reply; 5+ messages in thread
From: Rafał Miłecki @ 2026-09-21 21:59 UTC (permalink / raw)
To: Rosen Penev, devicetree
Cc: Florian Fainelli, Hauke Mehrtens,
Broadcom internal kernel review list, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Greg Kroah-Hartman,
moderated list:BROADCOM BCM5301X ARM ARCHITECTURE, open list,
open list:USB SUBSYSTEM
W dniu 21.09.2026 o 23:41, Rosen Penev pisze:
> @@ -411,6 +422,14 @@ static int bcma_hcd_probe(struct bcma_device *core)
> return dev_err_probe(&core->dev, PTR_ERR(usb_dev->gpio_desc),
> "error obtaining VCC GPIO");
>
> + usb_dev->regulator = devm_regulator_get(dev, "vbus");
> + if (IS_ERR(usb_dev->regulator))
> + return dev_err_probe(dev, PTR_ERR(usb_dev->regulator), "error obtaining VBUS regulator");
Did you test this for DT without VBUS? You seem to *require* regulator. Shouldn't you make it optional?
> + err = regulator_enable(usb_dev->regulator);
> + if (err)
> + return dev_err_probe(dev, err, "error enabling VCC regulator");
> +
Can't you use one of devm helpers that get and enable regulator for you?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCHv2 1/2] usb: bcma: add regulator support
2026-09-21 21:59 ` Rafał Miłecki
@ 2026-09-21 22:06 ` Rosen Penev
0 siblings, 0 replies; 5+ messages in thread
From: Rosen Penev @ 2026-09-21 22:06 UTC (permalink / raw)
To: Rafał Miłecki
Cc: devicetree, Florian Fainelli, Hauke Mehrtens,
Broadcom internal kernel review list, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Greg Kroah-Hartman,
moderated list:BROADCOM BCM5301X ARM ARCHITECTURE, open list,
open list:USB SUBSYSTEM
On Mon, Sep 21, 2026 at 2:59 PM Rafał Miłecki <zajec5@gmail.com> wrote:
>
> W dniu 21.09.2026 o 23:41, Rosen Penev pisze:
> > @@ -411,6 +422,14 @@ static int bcma_hcd_probe(struct bcma_device *core)
> > return dev_err_probe(&core->dev, PTR_ERR(usb_dev->gpio_desc),
> > "error obtaining VCC GPIO");
> >
> > + usb_dev->regulator = devm_regulator_get(dev, "vbus");
> > + if (IS_ERR(usb_dev->regulator))
> > + return dev_err_probe(dev, PTR_ERR(usb_dev->regulator), "error obtaining VBUS regulator");
>
> Did you test this for DT without VBUS? You seem to *require* regulator. Shouldn't you make it optional?
Nope. Confusingly, devm_regulator_get_optional returns -ENODEV if a
regulator is missing, which means probe will fail.
I could remove the return but then I would need to guard all
regulator_en/disable calls with IS_ERR. Much cleaner to have a dummy
regulator.
>
>
> > + err = regulator_enable(usb_dev->regulator);
> > + if (err)
> > + return dev_err_probe(dev, err, "error enabling VCC regulator");
> > +
>
> Can't you use one of devm helpers that get and enable regulator for you?
nope. devm_regulator_get_enable_optional returns an int, not a
pointer. This driver requires management of the regulator in suspend
and resume paths.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-09-21 22:06 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-21 21:41 [PATCHv2 0/2] usb: bcma: control VBUS via a regulator Rosen Penev
2026-09-21 21:41 ` [PATCHv2 1/2] usb: bcma: add regulator support Rosen Penev
2026-09-21 21:59 ` Rafał Miłecki
2026-09-21 22:06 ` Rosen Penev
2026-09-21 21:41 ` [PATCHv2 2/2] ARM: dts: broadcom: model USB VBUS power with regulator-fixed Rosen Penev
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®