public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] dt-bindings: phy: spacemit: add regulator support to K1 USB2 PHY
@ 2026-02-06 10:00 Chukun Pan
  2026-02-06 10:00 ` [PATCH 2/2] " Chukun Pan
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Chukun Pan @ 2026-02-06 10:00 UTC (permalink / raw)
  To: Yixun Lan, Vinod Koul, Ze Huang
  Cc: Rob Herring, Chukun Pan, Mark Brown, Conor Dooley, Liam Girdwood,
	Krzysztof Kozlowski, Neil Armstrong, linux-riscv, linux-phy,
	linux-kernel, devicetree, spacemit

Add an optional phy-supply property to describe the regulator
supplying for USB VBUS.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
---
 Documentation/devicetree/bindings/phy/spacemit,usb2-phy.yaml | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/phy/spacemit,usb2-phy.yaml b/Documentation/devicetree/bindings/phy/spacemit,usb2-phy.yaml
index 43eaca90d88c..74a1cd5bcdbe 100644
--- a/Documentation/devicetree/bindings/phy/spacemit,usb2-phy.yaml
+++ b/Documentation/devicetree/bindings/phy/spacemit,usb2-phy.yaml
@@ -19,6 +19,10 @@ properties:
   clocks:
     maxItems: 1
 
+  phy-supply:
+    description:
+      Phandle to a regulator that provides power to VBUS.
+
   "#phy-cells":
     const: 0
 
-- 
2.34.1


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

* [PATCH 2/2] phy: spacemit: add regulator support to K1 USB2 PHY
  2026-02-06 10:00 [PATCH 1/2] dt-bindings: phy: spacemit: add regulator support to K1 USB2 PHY Chukun Pan
@ 2026-02-06 10:00 ` Chukun Pan
  2026-02-07 10:48 ` [PATCH 1/2] dt-bindings: " Krzysztof Kozlowski
  2026-02-07 11:55 ` Yixun Lan
  2 siblings, 0 replies; 10+ messages in thread
From: Chukun Pan @ 2026-02-06 10:00 UTC (permalink / raw)
  To: Yixun Lan, Vinod Koul, Ze Huang
  Cc: Rob Herring, Chukun Pan, Mark Brown, Conor Dooley, Liam Girdwood,
	Krzysztof Kozlowski, Neil Armstrong, linux-riscv, linux-phy,
	linux-kernel, devicetree, spacemit

USB VBUS may have a regulator supply. Add optional phy-supply
support to avoid the need for the regulator to be always-on.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
---
 drivers/phy/spacemit/phy-k1-usb2.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/drivers/phy/spacemit/phy-k1-usb2.c b/drivers/phy/spacemit/phy-k1-usb2.c
index 342061380012..c163a29dabf9 100644
--- a/drivers/phy/spacemit/phy-k1-usb2.c
+++ b/drivers/phy/spacemit/phy-k1-usb2.c
@@ -75,6 +75,7 @@ struct spacemit_usb2phy {
 	struct phy *phy;
 	struct clk *clk;
 	struct regmap *regmap_base;
+	struct regulator *regulator;
 };
 
 static const struct regmap_config phy_regmap_config = {
@@ -98,6 +99,12 @@ static int spacemit_usb2phy_init(struct phy *phy)
 		return ret;
 	}
 
+	if (sphy->regulator) {
+		ret = regulator_enable(sphy->regulator);
+		if (ret)
+			return ret;
+	}
+
 	/*
 	 * make sure the usb controller is not under reset process before
 	 * any configuration
@@ -139,6 +146,9 @@ static int spacemit_usb2phy_exit(struct phy *phy)
 
 	clk_disable(sphy->clk);
 
+	if (sphy->regulator)
+		return regulator_disable(sphy->regulator);
+
 	return 0;
 }
 
@@ -171,6 +181,16 @@ static int spacemit_usb2phy_probe(struct platform_device *pdev)
 	if (IS_ERR(sphy->regmap_base))
 		return dev_err_probe(dev, PTR_ERR(sphy->regmap_base), "Failed to init regmap\n");
 
+	sphy->regulator = devm_regulator_get_optional(dev, "phy");
+	if (IS_ERR(sphy->regulator)) {
+		int ret = PTR_ERR(sphy->regulator);
+
+		if (ret != -ENODEV)
+			return dev_err_probe(dev, ret, "Failed to get regulator\n");
+
+		sphy->regulator = NULL;
+	}
+
 	sphy->phy = devm_phy_create(dev, NULL, &spacemit_usb2phy_ops);
 	if (IS_ERR(sphy->phy))
 		return dev_err_probe(dev, PTR_ERR(sphy->phy), "Failed to create phy\n");
-- 
2.34.1


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

* Re: [PATCH 1/2] dt-bindings: phy: spacemit: add regulator support to K1 USB2 PHY
  2026-02-06 10:00 [PATCH 1/2] dt-bindings: phy: spacemit: add regulator support to K1 USB2 PHY Chukun Pan
  2026-02-06 10:00 ` [PATCH 2/2] " Chukun Pan
@ 2026-02-07 10:48 ` Krzysztof Kozlowski
  2026-02-07 10:49   ` Krzysztof Kozlowski
  2026-02-07 12:30   ` Ze Huang
  2026-02-07 11:55 ` Yixun Lan
  2 siblings, 2 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2026-02-07 10:48 UTC (permalink / raw)
  To: Chukun Pan
  Cc: Yixun Lan, Vinod Koul, Ze Huang, Rob Herring, Mark Brown,
	Conor Dooley, Liam Girdwood, Krzysztof Kozlowski, Neil Armstrong,
	linux-riscv, linux-phy, linux-kernel, devicetree, spacemit

On Fri, Feb 06, 2026 at 06:00:08PM +0800, Chukun Pan wrote:
> Add an optional phy-supply property to describe the regulator
> supplying for USB VBUS.

Why wasn't it there before? USB did not have VBUS?

Explanation is so incomplete I suspect you are patching broken things,
so as well this could be completely different hardware (e.g. there is no
regulator for this block but e.g. connector).


> 
> Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
> ---
>  Documentation/devicetree/bindings/phy/spacemit,usb2-phy.yaml | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/phy/spacemit,usb2-phy.yaml b/Documentation/devicetree/bindings/phy/spacemit,usb2-phy.yaml
> index 43eaca90d88c..74a1cd5bcdbe 100644
> --- a/Documentation/devicetree/bindings/phy/spacemit,usb2-phy.yaml
> +++ b/Documentation/devicetree/bindings/phy/spacemit,usb2-phy.yaml
> @@ -19,6 +19,10 @@ properties:
>    clocks:
>      maxItems: 1
>  
> +  phy-supply:
> +    description:
> +      Phandle to a regulator that provides power to VBUS.

Drop redundant part. This cannot be anything else than phandle and
regulator.

"VBUS power supply" for example. But anyway, I don't have certainty that
this is correct hardware representation. It's your task to provide that.

Best regards,
Krzysztof


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

* Re: [PATCH 1/2] dt-bindings: phy: spacemit: add regulator support to K1 USB2 PHY
  2026-02-07 10:48 ` [PATCH 1/2] dt-bindings: " Krzysztof Kozlowski
@ 2026-02-07 10:49   ` Krzysztof Kozlowski
  2026-02-07 12:30   ` Ze Huang
  1 sibling, 0 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2026-02-07 10:49 UTC (permalink / raw)
  To: Chukun Pan
  Cc: Yixun Lan, Vinod Koul, Ze Huang, Rob Herring, Mark Brown,
	Conor Dooley, Liam Girdwood, Krzysztof Kozlowski, Neil Armstrong,
	linux-riscv, linux-phy, linux-kernel, devicetree, spacemit

On 07/02/2026 11:48, Krzysztof Kozlowski wrote:
> On Fri, Feb 06, 2026 at 06:00:08PM +0800, Chukun Pan wrote:
>> Add an optional phy-supply property to describe the regulator
>> supplying for USB VBUS.
> 
> Why wasn't it there before? USB did not have VBUS?
> 
> Explanation is so incomplete I suspect you are patching broken things,
> so as well this could be completely different hardware (e.g. there is no
> regulator for this block but e.g. connector).
> 
> 
>>
>> Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
>> ---
>>  Documentation/devicetree/bindings/phy/spacemit,usb2-phy.yaml | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/phy/spacemit,usb2-phy.yaml b/Documentation/devicetree/bindings/phy/spacemit,usb2-phy.yaml
>> index 43eaca90d88c..74a1cd5bcdbe 100644
>> --- a/Documentation/devicetree/bindings/phy/spacemit,usb2-phy.yaml
>> +++ b/Documentation/devicetree/bindings/phy/spacemit,usb2-phy.yaml
>> @@ -19,6 +19,10 @@ properties:
>>    clocks:
>>      maxItems: 1
>>  
>> +  phy-supply:
>> +    description:
>> +      Phandle to a regulator that provides power to VBUS.
> 
> Drop redundant part. This cannot be anything else than phandle and
> regulator.
> 
> "VBUS power supply" for example. But anyway, I don't have certainty that
> this is correct hardware representation. It's your task to provide that.


Plus, if this was a vbus regulator it would not be called "phy"... Even
more confusing.

Best regards,
Krzysztof

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

* Re: [PATCH 1/2] dt-bindings: phy: spacemit: add regulator support to K1 USB2 PHY
  2026-02-06 10:00 [PATCH 1/2] dt-bindings: phy: spacemit: add regulator support to K1 USB2 PHY Chukun Pan
  2026-02-06 10:00 ` [PATCH 2/2] " Chukun Pan
  2026-02-07 10:48 ` [PATCH 1/2] dt-bindings: " Krzysztof Kozlowski
@ 2026-02-07 11:55 ` Yixun Lan
  2 siblings, 0 replies; 10+ messages in thread
From: Yixun Lan @ 2026-02-07 11:55 UTC (permalink / raw)
  To: Chukun Pan
  Cc: Yixun Lan, Vinod Koul, Ze Huang, Rob Herring, Mark Brown,
	Conor Dooley, Liam Girdwood, Krzysztof Kozlowski, Neil Armstrong,
	linux-riscv, linux-phy, linux-kernel, devicetree, spacemit

Hi Chukun,

On 18:00 Fri 06 Feb     , Chukun Pan wrote:
> Add an optional phy-supply property to describe the regulator
> supplying for USB VBUS.
> 
No, the phy itself doesn't require regulator supply

We previously had a discussion about this, and I personally agree it 
should be handled at USB port level, see Ze's comment

https://lore.kernel.org/all/aWJAT3n_KcND8bOz@monica.localdomain/

> Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
> ---
>  Documentation/devicetree/bindings/phy/spacemit,usb2-phy.yaml | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/phy/spacemit,usb2-phy.yaml b/Documentation/devicetree/bindings/phy/spacemit,usb2-phy.yaml
> index 43eaca90d88c..74a1cd5bcdbe 100644
> --- a/Documentation/devicetree/bindings/phy/spacemit,usb2-phy.yaml
> +++ b/Documentation/devicetree/bindings/phy/spacemit,usb2-phy.yaml
> @@ -19,6 +19,10 @@ properties:
>    clocks:
>      maxItems: 1
>  
> +  phy-supply:
> +    description:
> +      Phandle to a regulator that provides power to VBUS.
> +
>    "#phy-cells":
>      const: 0
>  
> -- 
> 2.34.1
> 

-- 
Yixun Lan (dlan)

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

* Re: [PATCH 1/2] dt-bindings: phy: spacemit: add regulator support to K1 USB2 PHY
  2026-02-07 10:48 ` [PATCH 1/2] dt-bindings: " Krzysztof Kozlowski
  2026-02-07 10:49   ` Krzysztof Kozlowski
@ 2026-02-07 12:30   ` Ze Huang
  2026-02-07 13:44     ` Krzysztof Kozlowski
  1 sibling, 1 reply; 10+ messages in thread
From: Ze Huang @ 2026-02-07 12:30 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Chukun Pan
  Cc: Yixun Lan, Vinod Koul, Ze Huang, Rob Herring, Mark Brown,
	Conor Dooley, Liam Girdwood, Krzysztof Kozlowski, Neil Armstrong,
	linux-riscv, linux-phy, linux-kernel, devicetree, spacemit

On Sat Feb 7, 2026 at 6:48 PM CST, Krzysztof Kozlowski wrote:
> On Fri, Feb 06, 2026 at 06:00:08PM +0800, Chukun Pan wrote:
>> Add an optional phy-supply property to describe the regulator
>> supplying for USB VBUS.
>
> Why wasn't it there before? USB did not have VBUS?

Previously, the VBUS regulator was defined as regulator-always-on in
the device tree as a workaround.

>
> Explanation is so incomplete I suspect you are patching broken things,
> so as well this could be completely different hardware (e.g. there is no
> regulator for this block but e.g. connector).
>

usb ports under usb hub node can describe the topology well, but
still regulator always-on is necessary as no driver toggles it.

    usb3 {
     dr_mode = "host";
     #address-cells = <1>;
     #size-cells = <0>;
     status = "okay";

     hub_2_0: hub@1 {
      compatible = "usb2109,2817";
      reg = <0x1>;
      #address-cells = <1>;
      #size-cells = <0>;
      vdd-supply = <&usb3_vhub>;
      peer-hub = <&hub_3_0>;
      reset-gpios = <&gpio K1_GPIO(124) GPIO_ACTIVE_LOW>;

      port@1 {
       reg = <1>;
       vbus-supply = <&usb3_vbus>;
      };

      port@2 {
       reg = <2>;
       vbus-supply = <&usb3_vbus>;
      };

      ...

      hub_3_0: hub@2 {
        ...
      };
    };

Here is the diagram for the USB2, USB3 controller on K1 Jupiter board [1] (page 21)

    +-----------------------+
    |        K1 SoC         |
    |                       |
    |  +-----------------+  |   (USB 3.0)
    |  | USB3 Controller |--|---------------------------------->+--------------------------+
    |  +-----------------+  |                                   |        VL817 Hub         |
    |                       |                                   |                          |---> [USB3 Ports]
    |      HUB_PWREN        |                                   | +----------------------+ |     ^
    |       (GPIO)  --------|---------------------------------->| | Enable Chip Power    | |     |
    |                       |                                   | +----------------------+ |     |
    |                       |                                   +--------------------------+     |
    |      USB3_PWREN       |                                                                    |
    |       (GPIO)   -------|----------------------------------------------------------> [VBUS of USB3 Ports]
    |                       |
    |                       |
    |~~~~~~~~~~~~~~~~~~~~~~~|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    |                       |
    |  +-----------------+  |   (USB 2.0)
    |  | USB2 Controller |--|---------------------------------->+--------------------------+
    |  +-----------------+  |                                   |      FE1_1S Hub          |---> [USB2 Ports]
    |                       |                                   +--------------------------+     ^
    |   USB_HOST_PWREN_H    |                                                                    |
    |       (GPIO)      ----|-----------------------------------------------------------> [VBUS of USB2 Ports]
    |                       |
    |                       |
    +-----------------------+

[1] https://github.com/milkv-jupiter/jupiter-files/blob/main/hardware/v1_0/jupiter-sch-v1_0.pdf

>
>> 
>> Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
>> ---
>>  Documentation/devicetree/bindings/phy/spacemit,usb2-phy.yaml | 4 ++++
>>  1 file changed, 4 insertions(+)
>> 
>> diff --git a/Documentation/devicetree/bindings/phy/spacemit,usb2-phy.yaml b/Documentation/devicetree/bindings/phy/spacemit,usb2-phy.yaml
>> index 43eaca90d88c..74a1cd5bcdbe 100644
>> --- a/Documentation/devicetree/bindings/phy/spacemit,usb2-phy.yaml
>> +++ b/Documentation/devicetree/bindings/phy/spacemit,usb2-phy.yaml
>> @@ -19,6 +19,10 @@ properties:
>>    clocks:
>>      maxItems: 1
>>  
>> +  phy-supply:
>> +    description:
>> +      Phandle to a regulator that provides power to VBUS.
>

"vbus-supply" should be more accurate.

> Drop redundant part. This cannot be anything else than phandle and
> regulator.
>
> "VBUS power supply" for example.
>

> But anyway, I don't have certainty that
> this is correct hardware representation. It's your task to provide that.
>
> Best regards,
> Krzysztof

I initially considered handling VBUS via the onboard_usb_dev driver, as
we discussed previously for the BananaPi-F3 board (which uses a VL817
Hub) [2]. I was waiting for Marco Felsch's patch series "onboard-dev USB
hub host managed vbus" to land [3].

[2] https://lore.kernel.org/linux-riscv/aWJAT3n_KcND8bOz@monica.localdomain/
[3] https://lore.kernel.org/all/20250911-v6-16-topic-usb-onboard-dev-v4-0-1af288125d74@pengutronix.de/

I am not certain if managing VBUS in the PHY driver (e.g.,
phy-stm32-usbphyc.c and phy-rockchip-usb.c) is the standard method.
I would not insist on the "onboard_usb_dev managed vbus" if this patch
(PHY managed) is considered proper way.

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

* Re: [PATCH 1/2] dt-bindings: phy: spacemit: add regulator support to K1 USB2 PHY
  2026-02-07 12:30   ` Ze Huang
@ 2026-02-07 13:44     ` Krzysztof Kozlowski
  2026-02-09  6:40       ` Chukun Pan
  0 siblings, 1 reply; 10+ messages in thread
From: Krzysztof Kozlowski @ 2026-02-07 13:44 UTC (permalink / raw)
  To: Ze Huang, Chukun Pan
  Cc: Yixun Lan, Vinod Koul, Rob Herring, Mark Brown, Conor Dooley,
	Liam Girdwood, Krzysztof Kozlowski, Neil Armstrong, linux-riscv,
	linux-phy, linux-kernel, devicetree, spacemit

On 07/02/2026 13:30, Ze Huang wrote:
> On Sat Feb 7, 2026 at 6:48 PM CST, Krzysztof Kozlowski wrote:
>> On Fri, Feb 06, 2026 at 06:00:08PM +0800, Chukun Pan wrote:
>>> Add an optional phy-supply property to describe the regulator
>>> supplying for USB VBUS.
>>
>> Why wasn't it there before? USB did not have VBUS?
> 
> Previously, the VBUS regulator was defined as regulator-always-on in
> the device tree as a workaround.

Bindings are supposed to be complete regardless what driver does (or
does not).

You must list all supplies with proper names.

If this regulator was missing, then what else?

> 
>>
>> Explanation is so incomplete I suspect you are patching broken things,
>> so as well this could be completely different hardware (e.g. there is no
>> regulator for this block but e.g. connector).
>>
> 
> usb ports under usb hub node can describe the topology well, but
> still regulator always-on is necessary as no driver toggles it.
> 
>     usb3 {
>      dr_mode = "host";
>      #address-cells = <1>;
>      #size-cells = <0>;
>      status = "okay";
> 
>      hub_2_0: hub@1 {
>       compatible = "usb2109,2817";
>       reg = <0x1>;
>       #address-cells = <1>;
>       #size-cells = <0>;
>       vdd-supply = <&usb3_vhub>;
>       peer-hub = <&hub_3_0>;
>       reset-gpios = <&gpio K1_GPIO(124) GPIO_ACTIVE_LOW>;
> 
>       port@1 {
>        reg = <1>;
>        vbus-supply = <&usb3_vbus>;
>       };
> 
>       port@2 {
>        reg = <2>;
>        vbus-supply = <&usb3_vbus>;
>       };
> 
>       ...
> 
>       hub_3_0: hub@2 {
>         ...
>       };
>     };
> 
> Here is the diagram for the USB2, USB3 controller on K1 Jupiter board [1] (page 21)
> 
>     +-----------------------+
>     |        K1 SoC         |
>     |                       |
>     |  +-----------------+  |   (USB 3.0)
>     |  | USB3 Controller |--|---------------------------------->+--------------------------+
>     |  +-----------------+  |                                   |        VL817 Hub         |
>     |                       |                                   |                          |---> [USB3 Ports]
>     |      HUB_PWREN        |                                   | +----------------------+ |     ^
>     |       (GPIO)  --------|---------------------------------->| | Enable Chip Power    | |     |
>     |                       |                                   | +----------------------+ |     |
>     |                       |                                   +--------------------------+     |
>     |      USB3_PWREN       |                                                                    |
>     |       (GPIO)   -------|----------------------------------------------------------> [VBUS of USB3 Ports]
>     |                       |
>     |                       |
>     |~~~~~~~~~~~~~~~~~~~~~~~|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>     |                       |
>     |  +-----------------+  |   (USB 2.0)
>     |  | USB2 Controller |--|---------------------------------->+--------------------------+
>     |  +-----------------+  |                                   |      FE1_1S Hub          |---> [USB2 Ports]
>     |                       |                                   +--------------------------+     ^
>     |   USB_HOST_PWREN_H    |                                                                    |
>     |       (GPIO)      ----|-----------------------------------------------------------> [VBUS of USB2 Ports]
>     |                       |
>     |                       |
>     +-----------------------+


I do not see here a "phy" regulator supply. Are you sure this is how
your pin or supply is called?

> 
> [1] https://github.com/milkv-jupiter/jupiter-files/blob/main/hardware/v1_0/jupiter-sch-v1_0.pdf

This page shows the connector, so not the phy.

> 
>>
>>>
>>> Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
>>> ---
>>>  Documentation/devicetree/bindings/phy/spacemit,usb2-phy.yaml | 4 ++++
>>>  1 file changed, 4 insertions(+)
>>>
>>> diff --git a/Documentation/devicetree/bindings/phy/spacemit,usb2-phy.yaml b/Documentation/devicetree/bindings/phy/spacemit,usb2-phy.yaml
>>> index 43eaca90d88c..74a1cd5bcdbe 100644
>>> --- a/Documentation/devicetree/bindings/phy/spacemit,usb2-phy.yaml
>>> +++ b/Documentation/devicetree/bindings/phy/spacemit,usb2-phy.yaml
>>> @@ -19,6 +19,10 @@ properties:
>>>    clocks:
>>>      maxItems: 1
>>>  
>>> +  phy-supply:
>>> +    description:
>>> +      Phandle to a regulator that provides power to VBUS.
>>
> 
> "vbus-supply" should be more accurate.
> 
>> Drop redundant part. This cannot be anything else than phandle and
>> regulator.
>>
>> "VBUS power supply" for example.
>>
> 
>> But anyway, I don't have certainty that
>> this is correct hardware representation. It's your task to provide that.
>>
>> Best regards,
>> Krzysztof
> 
> I initially considered handling VBUS via the onboard_usb_dev driver, as
> we discussed previously for the BananaPi-F3 board (which uses a VL817
> Hub) [2]. I was waiting for Marco Felsch's patch series "onboard-dev USB
> hub host managed vbus" to land [3].
> 
> [2] https://lore.kernel.org/linux-riscv/aWJAT3n_KcND8bOz@monica.localdomain/
> [3] https://lore.kernel.org/all/20250911-v6-16-topic-usb-onboard-dev-v4-0-1af288125d74@pengutronix.de/
> 
> I am not certain if managing VBUS in the PHY driver (e.g.,
> phy-stm32-usbphyc.c and phy-rockchip-usb.c) is the standard method.
> I would not insist on the "onboard_usb_dev managed vbus" if this patch
> (PHY managed) is considered proper way.

I am not talking about driver here at all.

Please start describing in the bindings your complete hardware, not your
drivers.

That's a no for this patch, because phy does not have such supply.

Best regards,
Krzysztof

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

* Re: [PATCH 1/2] dt-bindings: phy: spacemit: add regulator support to K1 USB2 PHY
  2026-02-07 13:44     ` Krzysztof Kozlowski
@ 2026-02-09  6:40       ` Chukun Pan
  2026-02-10  5:50         ` Ze Huang
  0 siblings, 1 reply; 10+ messages in thread
From: Chukun Pan @ 2026-02-09  6:40 UTC (permalink / raw)
  To: krzk
  Cc: amadeus, broonie, conor+dt, devicetree, dlan, huang.ze, krzk+dt,
	lgirdwood, linux-kernel, linux-phy, linux-riscv, neil.armstrong,
	robh, spacemit, vkoul

Hi,

> Plus, if this was a vbus regulator it would not be called "phy"...
> Even more confusing.

Sorry, I didn't consider that this naming is confusing. Other
platforms, such as Rockchip's inno-usb2phy driver, use the
"phy-supply" property. I continued with this bad naming.

> Bindings are supposed to be complete regardless what driver does
> (or does not).
>
> You must list all supplies with proper names.
>
> If this regulator was missing, then what else?

(...)

> Please start describing in the bindings your complete hardware, not
> your drivers.

It appears Ze Huang described the vbus-supply property in
spacemit.k1-dwc3.yaml. So I should enable the regulator in
the dwc3-generic-plat driver. Sorry for the noise.

Thanks,
Chukun

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

* Re: [PATCH 1/2] dt-bindings: phy: spacemit: add regulator support to K1 USB2 PHY
  2026-02-09  6:40       ` Chukun Pan
@ 2026-02-10  5:50         ` Ze Huang
  2026-02-10  7:00           ` Chukun Pan
  0 siblings, 1 reply; 10+ messages in thread
From: Ze Huang @ 2026-02-10  5:50 UTC (permalink / raw)
  To: Chukun Pan, krzk
  Cc: broonie, conor+dt, devicetree, dlan, huang.ze, krzk+dt, lgirdwood,
	linux-kernel, linux-phy, linux-riscv, neil.armstrong, robh,
	spacemit, vkoul

On Mon Feb 9, 2026 at 2:40 PM CST, Chukun Pan wrote:
> Hi,
>
>> Plus, if this was a vbus regulator it would not be called "phy"...
>> Even more confusing.
>
> Sorry, I didn't consider that this naming is confusing. Other
> platforms, such as Rockchip's inno-usb2phy driver, use the
> "phy-supply" property. I continued with this bad naming.
>
>> Bindings are supposed to be complete regardless what driver does
>> (or does not).
>>
>> You must list all supplies with proper names.
>>
>> If this regulator was missing, then what else?
>
> (...)
>
>> Please start describing in the bindings your complete hardware, not
>> your drivers.
>
> It appears Ze Huang described the vbus-supply property in
> spacemit.k1-dwc3.yaml.
>

> So I should enable the regulator in the dwc3-generic-plat driver.

No, we will enable regulator at port level.

>
> Sorry for the noise.
>
> Thanks,
> Chukun


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

* Re: [PATCH 1/2] dt-bindings: phy: spacemit: add regulator support to K1 USB2 PHY
  2026-02-10  5:50         ` Ze Huang
@ 2026-02-10  7:00           ` Chukun Pan
  0 siblings, 0 replies; 10+ messages in thread
From: Chukun Pan @ 2026-02-10  7:00 UTC (permalink / raw)
  To: huang.ze
  Cc: amadeus, broonie, conor+dt, devicetree, dlan, krzk+dt, krzk,
	lgirdwood, linux-kernel, linux-phy, linux-riscv, neil.armstrong,
	robh, spacemit, vkoul

Hi,

> > It appears Ze Huang described the vbus-supply property in
> > spacemit.k1-dwc3.yaml.
> >
> > So I should enable the regulator in the dwc3-generic-plat driver.
>
> No, we will enable regulator at port level.

Since dt-bindings (spacemit.k1-dwc3.yaml) already describes the
vbus-supply property, why can't it be implemented in the dwc3 driver?

> Previously, the VBUS regulator was defined as regulator-always-on
> in the device tree as a workaround.

I don't like this workaround because we can control the VBUS regulator
through the USB PHY driver or the USB Controller driver. These are widely
implemented in other similar drivers.

Regarding port level, few manufacturers use different VBUS supplies
for the ports coming out of the USB hub, such as the ArmSoM Sige1 board.
Most boards use the same VBUS for a single USB socket, so I don't quite
understand why we need to wait for port level implementation.

Thanks,
Chukun

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

end of thread, other threads:[~2026-02-10  7:00 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-06 10:00 [PATCH 1/2] dt-bindings: phy: spacemit: add regulator support to K1 USB2 PHY Chukun Pan
2026-02-06 10:00 ` [PATCH 2/2] " Chukun Pan
2026-02-07 10:48 ` [PATCH 1/2] dt-bindings: " Krzysztof Kozlowski
2026-02-07 10:49   ` Krzysztof Kozlowski
2026-02-07 12:30   ` Ze Huang
2026-02-07 13:44     ` Krzysztof Kozlowski
2026-02-09  6:40       ` Chukun Pan
2026-02-10  5:50         ` Ze Huang
2026-02-10  7:00           ` Chukun Pan
2026-02-07 11:55 ` Yixun Lan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox