2021-09-27 04:51:10

by Shawn Guo

[permalink] [raw]
Subject: [PATCH 0/3] Add missing vdd-supply for QUSB2 PHY

The series adds missing vdd-supply for QUSB2 PHY which is required for
digital circuit. The driver works right now likely because firmware
already sets it up. Add it to bindings, driver and DTS that miss the
supply.

It should not cause problem for existing DTBs:
- SC7180, SDM630, SDM845 based platforms already specified vdd-supply
in the DTBs.
- MSM8996 and MSM8998 platform DTBs miss vdd-supply, but dummy regulator
will ensure QUSB2 PHY driver works as before on these platforms.


Shawn Guo (3):
dt-bindings: phy: qcom,qusb2: Add missing vdd-supply
phy: qcom-qusb2: Add missing vdd supply
arm64: dts: qcom: Add missing vdd-supply for QUSB2 PHY

Documentation/devicetree/bindings/phy/qcom,qusb2-phy.yaml | 6 ++++++
arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi | 2 ++
arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone.dtsi | 1 +
arch/arm64/boot/dts/qcom/msm8998-clamshell.dtsi | 1 +
arch/arm64/boot/dts/qcom/msm8998-oneplus-common.dtsi | 1 +
drivers/phy/qualcomm/phy-qcom-qusb2.c | 2 +-
6 files changed, 12 insertions(+), 1 deletion(-)

--
2.17.1


2021-09-27 04:51:10

by Shawn Guo

[permalink] [raw]
Subject: [PATCH 1/3] dt-bindings: phy: qcom,qusb2: Add missing vdd-supply

Besides vdda-pll and vdda-phy-dpdm, vdd-supply is a required supply for
PHY digital circuit operation. Add it for correctness and completeness.

Signed-off-by: Shawn Guo <[email protected]>
---
Documentation/devicetree/bindings/phy/qcom,qusb2-phy.yaml | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/phy/qcom,qusb2-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,qusb2-phy.yaml
index 48ae604b2194..96e31f582fc9 100644
--- a/Documentation/devicetree/bindings/phy/qcom,qusb2-phy.yaml
+++ b/Documentation/devicetree/bindings/phy/qcom,qusb2-phy.yaml
@@ -51,6 +51,10 @@ properties:
- const: ref
- const: iface

+ vdda-supply:
+ description:
+ Phandle to 0.9V regulator supply to PHY digital circuit.
+
vdda-pll-supply:
description:
Phandle to 1.8V regulator supply to PHY refclk pll block.
@@ -157,6 +161,7 @@ required:
- "#phy-cells"
- clocks
- clock-names
+ - vdd-supply
- vdda-pll-supply
- vdda-phy-dpdm-supply
- resets
@@ -175,6 +180,7 @@ examples:
<&gcc GCC_RX1_USB2_CLKREF_CLK>;
clock-names = "cfg_ahb", "ref";

+ vdd-supply = <&pm8994_l28>;
vdda-pll-supply = <&pm8994_l12>;
vdda-phy-dpdm-supply = <&pm8994_l24>;

--
2.17.1

2021-09-27 04:51:28

by Shawn Guo

[permalink] [raw]
Subject: [PATCH 2/3] phy: qcom-qusb2: Add missing vdd supply

Per downstream kernel, beside vdda-pll and vdda-phy-dpdm, vdd is also a
required supply for QUSB2 PHY digital circuit operation. The driver
works right now likely because firmware already sets it up. Add it for
correctness and completeness.

Signed-off-by: Shawn Guo <[email protected]>
---
drivers/phy/qualcomm/phy-qcom-qusb2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/phy/qualcomm/phy-qcom-qusb2.c b/drivers/phy/qualcomm/phy-qcom-qusb2.c
index ae063a8b3e28..7a8e4333babe 100644
--- a/drivers/phy/qualcomm/phy-qcom-qusb2.c
+++ b/drivers/phy/qualcomm/phy-qcom-qusb2.c
@@ -371,7 +371,7 @@ static const struct qusb2_phy_cfg sm6115_phy_cfg = {
};

static const char * const qusb2_phy_vreg_names[] = {
- "vdda-pll", "vdda-phy-dpdm",
+ "vdd", "vdda-pll", "vdda-phy-dpdm",
};

#define QUSB2_NUM_VREGS ARRAY_SIZE(qusb2_phy_vreg_names)
--
2.17.1

2021-09-27 04:51:35

by Shawn Guo

[permalink] [raw]
Subject: [PATCH 3/3] arm64: dts: qcom: Add missing vdd-supply for QUSB2 PHY

QUSB2 PHY requires vdd-supply for digital circuit operation. Add it for
platforms that miss it.

Signed-off-by: Shawn Guo <[email protected]>
---
arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi | 2 ++
arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone.dtsi | 1 +
arch/arm64/boot/dts/qcom/msm8998-clamshell.dtsi | 1 +
arch/arm64/boot/dts/qcom/msm8998-oneplus-common.dtsi | 1 +
4 files changed, 5 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi b/arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi
index 51e17094d7b1..d9826ce27e50 100644
--- a/arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi
+++ b/arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi
@@ -230,6 +230,7 @@
&hsusb_phy1 {
status = "okay";

+ vdd-supply = <&vreg_l28a_0p925>;
vdda-pll-supply = <&vreg_l12a_1p8>;
vdda-phy-dpdm-supply = <&vreg_l24a_3p075>;
};
@@ -237,6 +238,7 @@
&hsusb_phy2 {
status = "okay";

+ vdd-supply = <&vreg_l28a_0p925>;
vdda-pll-supply = <&vreg_l12a_1p8>;
vdda-phy-dpdm-supply = <&vreg_l24a_3p075>;
};
diff --git a/arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone.dtsi b/arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone.dtsi
index 507396c4d23b..61ea6d4ef8ac 100644
--- a/arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone.dtsi
@@ -184,6 +184,7 @@
&hsusb_phy1 {
status = "okay";

+ vdd-supply = <&pm8994_l28>;
vdda-pll-supply = <&pm8994_l12>;
vdda-phy-dpdm-supply = <&pm8994_l24>;
};
diff --git a/arch/arm64/boot/dts/qcom/msm8998-clamshell.dtsi b/arch/arm64/boot/dts/qcom/msm8998-clamshell.dtsi
index 125d7923d713..4f823974559b 100644
--- a/arch/arm64/boot/dts/qcom/msm8998-clamshell.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8998-clamshell.dtsi
@@ -102,6 +102,7 @@
&qusb2phy {
status = "okay";

+ vdd-supply = <&vreg_l1a_0p875>;
vdda-pll-supply = <&vreg_l12a_1p8>;
vdda-phy-dpdm-supply = <&vreg_l24a_3p075>;
};
diff --git a/arch/arm64/boot/dts/qcom/msm8998-oneplus-common.dtsi b/arch/arm64/boot/dts/qcom/msm8998-oneplus-common.dtsi
index 0f5c7828a901..243f4ee5da8c 100644
--- a/arch/arm64/boot/dts/qcom/msm8998-oneplus-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8998-oneplus-common.dtsi
@@ -260,6 +260,7 @@
&qusb2phy {
status = "okay";

+ vdd-supply = <&vreg_l1a_0p875>;
vdda-pll-supply = <&vreg_l12a_1p8>;
vdda-phy-dpdm-supply = <&vreg_l24a_3p075>;
};
--
2.17.1

2021-09-27 12:25:47

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH 1/3] dt-bindings: phy: qcom,qusb2: Add missing vdd-supply

On Mon, 27 Sep 2021 12:48:22 +0800, Shawn Guo wrote:
> Besides vdda-pll and vdda-phy-dpdm, vdd-supply is a required supply for
> PHY digital circuit operation. Add it for correctness and completeness.
>
> Signed-off-by: Shawn Guo <[email protected]>
> ---
> Documentation/devicetree/bindings/phy/qcom,qusb2-phy.yaml | 6 ++++++
> 1 file changed, 6 insertions(+)
>

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/phy/qcom,qusb2-phy.example.dt.yaml: phy@7411000: 'vdd-supply' does not match any of the regexes: 'pinctrl-[0-9]+'
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/phy/qcom,qusb2-phy.yaml

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/patch/1533177

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit.

2021-09-27 12:32:13

by Shawn Guo

[permalink] [raw]
Subject: Re: [PATCH 1/3] dt-bindings: phy: qcom,qusb2: Add missing vdd-supply

On Mon, Sep 27, 2021 at 12:48:22PM +0800, Shawn Guo wrote:
> Besides vdda-pll and vdda-phy-dpdm, vdd-supply is a required supply for
> PHY digital circuit operation. Add it for correctness and completeness.
>
> Signed-off-by: Shawn Guo <[email protected]>
> ---
> Documentation/devicetree/bindings/phy/qcom,qusb2-phy.yaml | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/phy/qcom,qusb2-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,qusb2-phy.yaml
> index 48ae604b2194..96e31f582fc9 100644
> --- a/Documentation/devicetree/bindings/phy/qcom,qusb2-phy.yaml
> +++ b/Documentation/devicetree/bindings/phy/qcom,qusb2-phy.yaml
> @@ -51,6 +51,10 @@ properties:
> - const: ref
> - const: iface
>
> + vdda-supply:

Oops, it should be `vdd-supply`. Will fix it in v2.

Shawn

> + description:
> + Phandle to 0.9V regulator supply to PHY digital circuit.
> +
> vdda-pll-supply:
> description:
> Phandle to 1.8V regulator supply to PHY refclk pll block.
> @@ -157,6 +161,7 @@ required:
> - "#phy-cells"
> - clocks
> - clock-names
> + - vdd-supply
> - vdda-pll-supply
> - vdda-phy-dpdm-supply
> - resets
> @@ -175,6 +180,7 @@ examples:
> <&gcc GCC_RX1_USB2_CLKREF_CLK>;
> clock-names = "cfg_ahb", "ref";
>
> + vdd-supply = <&pm8994_l28>;
> vdda-pll-supply = <&pm8994_l12>;
> vdda-phy-dpdm-supply = <&pm8994_l24>;
>
> --
> 2.17.1
>