* [PATCH v8 00/11] Add Qualcomm PMIC TPCM support
@ 2023-05-15 13:36 Bryan O'Donoghue
2023-05-15 13:36 ` [PATCH v8 01/11] dt-bindings: regulator: qcom,usb-vbus-regulator: Mark reg as required Bryan O'Donoghue
` (11 more replies)
0 siblings, 12 replies; 20+ messages in thread
From: Bryan O'Donoghue @ 2023-05-15 13:36 UTC (permalink / raw)
To: linux, heikki.krogerus, gregkh, andersson, robh+dt,
krzysztof.kozlowski+dt, luca.weiss, lujianhua000, linux-usb,
linux-arm-msm, devicetree
Cc: konrad.dybcio, caleb.connolly, bryan.odonoghue, subbaram, jackp,
robertom
Bootable tree
Link: https://git.codelinaro.org/bryan.odonoghue/kernel/-/tree/usb-next-23-05-14-qcom-wrapper-typec-mux-bjorn
V8:
- Makes pm8150b_typec::status = disabled by default - bod
- Greg merged the TCPM description and driver to usb-next so two patches less now.
I've rebased this series on to usb-next using "--base=auto"
All of the kernel robot dts/yaml checks should now pass against usb-next / a4422ff221429c600c3dc5d0394fb3738b89d040
V7:
- Adds R/B to "dt-bindings: phy: qcom,sc7180-qmp-usb3-dp-phy: Add input and output ports" - Krzysztof
- Fixes indicated, adds R/B to "dt-bindings: usb: Add Qualcomm PMIC Type-C" - Krzysztof
- Fixes indicated, adds R/B to "usb: typec: qcom: Add Qualcomm PMIC Type-C driver" - Guenter
- Fixes indicated, adds R/B to "usb: typec: qcom: Add Qualcomm PMIC Type-C driver" - Caleb
- Adds R/B to "arm64: dts: qcom: sm8250: Define ports for qmpphy orientation-switching" - Konrad
- Adds R/B to "arm64: dts: qcom: qrb5165-rb5: Switch on Type-C VBUS boost" - Konrad
- Fixes indicated, adds R/B to "arm64: dts: qcom: qrb5165-rb5: Switch on basic TCPM" - Jianhua, Konrad
- Connector ports/endpoints left inside of connector
Documentation/devicetree/bindings/connector/usb-connector.yaml - Jianhua
- dwc3_role_switch_in -> usb_1_dwc3_role_switch_in
qmpphy_typec_mux_in -> usb_1_qmpphy_typec_mux_in
Both ports/endpoints defined inside of pm8150b dtsi - Konrad
I modified the name of both so that the port/endpoint would be directly
adjacent to the containing node in the dtsi file for code locality/readbility - bod
- Fixes newline indicated "arm64: dts: qcom: qrb5165-rb5: Switch on TCPM usb-role-switching for usb_1" - Jianhua, Konrad
- Fixes newline indicated "arm64: dts: qcom: qrb5165-rb5: Switch on TCPM orientation-switch for usb_1_qmpphy" - Jianhua, Konrad
- connector
I have left the connector defintion and its ports/endpoints in the platform dts
The reason for this
a) Prior art e.g. arch/arm64/boot/dts/qcom/sc8280xp*
b) The connector is really a non-SoC/PMIC component its something that is defined
for your platform.
I'm open to further debate on this topic:
Link: https://imgflip.com/i/7kw6ck
- port@1 -> port@1 "arm64: dts: qcom: qrb5165-rb5: Switch on TCPM orientation-switch for usb_1_qmpphy" - Jianhua
- OF: graph: no port node found in /soc@0/spmi@c440000/pmic@2/typec@1500
I left this as-is since the DT model we want is to connect the connector directly to
the PHY for orientation or controller for data-role switching
I similarly didn't put this hack in place to remove the warning but "it would work"
V6:
- I'm dropping the previous V1-V6 log because the text is getting too long
here's a link to the previous cover letter instead
Link: https://lore.kernel.org/linux-arm-msm/20230501121111.1058190-1-bryan.odonoghue@linaro.org/
Bryan O'Donoghue (11):
dt-bindings: regulator: qcom,usb-vbus-regulator: Mark reg as required
dt-bindings: regulator: qcom,usb-vbus-regulator: Mark
regulator-*-microamp required
dt-bindings: phy: qcom,sc7180-qmp-usb3-dp-phy: Add orientation-switch
as optional
dt-bindings: phy: qcom,sc7180-qmp-usb3-dp-phy: Add input and output
ports
dt-bindings: mfd: qcom,spmi-pmic: Add typec to SPMI device types
arm64: dts: qcom: sm8250: Define ports for qmpphy
orientation-switching
arm64: dts: qcom: pm8150b: Add a TCPM description
arm64: dts: qcom: qrb5165-rb5: Switch on Type-C VBUS boost
arm64: dts: qcom: qrb5165-rb5: Switch on basic TCPM
arm64: dts: qcom: qrb5165-rb5: Switch on TCPM usb-role-switching for
usb_1
arm64: dts: qcom: qrb5165-rb5: Switch on TCPM orientation-switch for
usb_1_qmpphy
.../bindings/mfd/qcom,spmi-pmic.yaml | 4 ++
.../phy/qcom,sc7180-qmp-usb3-dp-phy.yaml | 44 +++++++++++++++
.../regulator/qcom,usb-vbus-regulator.yaml | 10 +++-
arch/arm64/boot/dts/qcom/pm8150b.dtsi | 40 +++++++++++++
arch/arm64/boot/dts/qcom/qrb5165-rb5.dts | 56 ++++++++++++++++++-
arch/arm64/boot/dts/qcom/sm8250.dtsi | 18 ++++++
6 files changed, 170 insertions(+), 2 deletions(-)
base-commit: a4422ff221429c600c3dc5d0394fb3738b89d040
--
2.39.2
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH v8 01/11] dt-bindings: regulator: qcom,usb-vbus-regulator: Mark reg as required
2023-05-15 13:36 [PATCH v8 00/11] Add Qualcomm PMIC TPCM support Bryan O'Donoghue
@ 2023-05-15 13:36 ` Bryan O'Donoghue
2023-05-15 13:36 ` [PATCH v8 02/11] dt-bindings: regulator: qcom,usb-vbus-regulator: Mark regulator-*-microamp required Bryan O'Donoghue
` (10 subsequent siblings)
11 siblings, 0 replies; 20+ messages in thread
From: Bryan O'Donoghue @ 2023-05-15 13:36 UTC (permalink / raw)
To: linux, heikki.krogerus, gregkh, andersson, robh+dt,
krzysztof.kozlowski+dt, luca.weiss, lujianhua000, linux-usb,
linux-arm-msm, devicetree
Cc: konrad.dybcio, caleb.connolly, bryan.odonoghue, subbaram, jackp,
robertom, Krzysztof Kozlowski
The regulator code needs to know the location of the register to write to
to switch on/off. Right now we have a driver that does this, a yaml that
partially describes it and no dts that uses it.
Switching on the VBUS for sm8250 shows that we haven't documented reg as a
required property, do so now.
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
.../devicetree/bindings/regulator/qcom,usb-vbus-regulator.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/regulator/qcom,usb-vbus-regulator.yaml b/Documentation/devicetree/bindings/regulator/qcom,usb-vbus-regulator.yaml
index b1cff3adb21b5..7a3b59f836092 100644
--- a/Documentation/devicetree/bindings/regulator/qcom,usb-vbus-regulator.yaml
+++ b/Documentation/devicetree/bindings/regulator/qcom,usb-vbus-regulator.yaml
@@ -25,6 +25,7 @@ properties:
required:
- compatible
+ - reg
additionalProperties: false
--
2.39.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH v8 02/11] dt-bindings: regulator: qcom,usb-vbus-regulator: Mark regulator-*-microamp required
2023-05-15 13:36 [PATCH v8 00/11] Add Qualcomm PMIC TPCM support Bryan O'Donoghue
2023-05-15 13:36 ` [PATCH v8 01/11] dt-bindings: regulator: qcom,usb-vbus-regulator: Mark reg as required Bryan O'Donoghue
@ 2023-05-15 13:36 ` Bryan O'Donoghue
2023-05-15 13:36 ` [PATCH v8 03/11] dt-bindings: phy: qcom,sc7180-qmp-usb3-dp-phy: Add orientation-switch as optional Bryan O'Donoghue
` (9 subsequent siblings)
11 siblings, 0 replies; 20+ messages in thread
From: Bryan O'Donoghue @ 2023-05-15 13:36 UTC (permalink / raw)
To: linux, heikki.krogerus, gregkh, andersson, robh+dt,
krzysztof.kozlowski+dt, luca.weiss, lujianhua000, linux-usb,
linux-arm-msm, devicetree
Cc: konrad.dybcio, caleb.connolly, bryan.odonoghue, subbaram, jackp,
robertom, Krzysztof Kozlowski
The VBUS driver needs to know the regulator-min-microamp and
regulator-max-microamp so they should both be marked as required.
regulator.yaml defines those two dependencies so include regulator.yaml.
We need to change from additionalProperties: false to
unevaluatedProperties: false.
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
.../bindings/regulator/qcom,usb-vbus-regulator.yaml | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/regulator/qcom,usb-vbus-regulator.yaml b/Documentation/devicetree/bindings/regulator/qcom,usb-vbus-regulator.yaml
index 7a3b59f836092..89c564dfa5db5 100644
--- a/Documentation/devicetree/bindings/regulator/qcom,usb-vbus-regulator.yaml
+++ b/Documentation/devicetree/bindings/regulator/qcom,usb-vbus-regulator.yaml
@@ -14,6 +14,9 @@ description: |
regulator will be enabled in situations where the device is required to
provide power to the connected peripheral.
+allOf:
+ - $ref: regulator.yaml#
+
properties:
compatible:
enum:
@@ -26,8 +29,10 @@ properties:
required:
- compatible
- reg
+ - regulator-min-microamp
+ - regulator-max-microamp
-additionalProperties: false
+unevaluatedProperties: false
examples:
- |
@@ -37,6 +42,8 @@ examples:
pm8150b_vbus: usb-vbus-regulator@1100 {
compatible = "qcom,pm8150b-vbus-reg";
reg = <0x1100>;
+ regulator-min-microamp = <500000>;
+ regulator-max-microamp = <3000000>;
};
};
...
--
2.39.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH v8 03/11] dt-bindings: phy: qcom,sc7180-qmp-usb3-dp-phy: Add orientation-switch as optional
2023-05-15 13:36 [PATCH v8 00/11] Add Qualcomm PMIC TPCM support Bryan O'Donoghue
2023-05-15 13:36 ` [PATCH v8 01/11] dt-bindings: regulator: qcom,usb-vbus-regulator: Mark reg as required Bryan O'Donoghue
2023-05-15 13:36 ` [PATCH v8 02/11] dt-bindings: regulator: qcom,usb-vbus-regulator: Mark regulator-*-microamp required Bryan O'Donoghue
@ 2023-05-15 13:36 ` Bryan O'Donoghue
2023-05-15 13:36 ` [PATCH v8 04/11] dt-bindings: phy: qcom,sc7180-qmp-usb3-dp-phy: Add input and output ports Bryan O'Donoghue
` (8 subsequent siblings)
11 siblings, 0 replies; 20+ messages in thread
From: Bryan O'Donoghue @ 2023-05-15 13:36 UTC (permalink / raw)
To: linux, heikki.krogerus, gregkh, andersson, robh+dt,
krzysztof.kozlowski+dt, luca.weiss, lujianhua000, linux-usb,
linux-arm-msm, devicetree
Cc: konrad.dybcio, caleb.connolly, bryan.odonoghue, subbaram, jackp,
robertom, Krzysztof Kozlowski
orientation-switch it the standard declaration to inform the Type-C mux
layer that a remote-endpoint is capable of processing orientation change
messages.
Add as an optional since not all versions of the dp-phy currently support
the orientation-switch.
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
.../bindings/phy/qcom,sc7180-qmp-usb3-dp-phy.yaml | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/Documentation/devicetree/bindings/phy/qcom,sc7180-qmp-usb3-dp-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,sc7180-qmp-usb3-dp-phy.yaml
index 0ef2c9b9d4669..d307343388888 100644
--- a/Documentation/devicetree/bindings/phy/qcom,sc7180-qmp-usb3-dp-phy.yaml
+++ b/Documentation/devicetree/bindings/phy/qcom,sc7180-qmp-usb3-dp-phy.yaml
@@ -61,6 +61,10 @@ properties:
power-domains:
maxItems: 1
+ orientation-switch:
+ description: Flag the port as possible handler of orientation switching
+ type: boolean
+
resets:
items:
- description: reset of phy block.
@@ -251,6 +255,8 @@ examples:
vdda-phy-supply = <&vdda_usb2_ss_1p2>;
vdda-pll-supply = <&vdda_usb2_ss_core>;
+ orientation-switch;
+
usb3-phy@200 {
reg = <0x200 0x128>,
<0x400 0x200>,
--
2.39.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH v8 04/11] dt-bindings: phy: qcom,sc7180-qmp-usb3-dp-phy: Add input and output ports
2023-05-15 13:36 [PATCH v8 00/11] Add Qualcomm PMIC TPCM support Bryan O'Donoghue
` (2 preceding siblings ...)
2023-05-15 13:36 ` [PATCH v8 03/11] dt-bindings: phy: qcom,sc7180-qmp-usb3-dp-phy: Add orientation-switch as optional Bryan O'Donoghue
@ 2023-05-15 13:36 ` Bryan O'Donoghue
2023-05-15 19:59 ` Bjorn Andersson
2023-05-15 13:36 ` [PATCH v8 05/11] dt-bindings: mfd: qcom,spmi-pmic: Add typec to SPMI device types Bryan O'Donoghue
` (7 subsequent siblings)
11 siblings, 1 reply; 20+ messages in thread
From: Bryan O'Donoghue @ 2023-05-15 13:36 UTC (permalink / raw)
To: linux, heikki.krogerus, gregkh, andersson, robh+dt,
krzysztof.kozlowski+dt, luca.weiss, lujianhua000, linux-usb,
linux-arm-msm, devicetree
Cc: konrad.dybcio, caleb.connolly, bryan.odonoghue, subbaram, jackp,
robertom, Krzysztof Kozlowski
Add a ports declaration which is optional containing two port@
declarations.
port@0 to receive an orientation-switch message from the Type-C port or
redriver
port@1 to subsequently transmit the orientation-switch on once the PHY has
finished doing its orientation turn-around.
If ports is declared the input port port@0 is mandatory but the output
port@1 is optional.
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
.../phy/qcom,sc7180-qmp-usb3-dp-phy.yaml | 38 +++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/Documentation/devicetree/bindings/phy/qcom,sc7180-qmp-usb3-dp-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,sc7180-qmp-usb3-dp-phy.yaml
index d307343388888..c370b9cd58c2e 100644
--- a/Documentation/devicetree/bindings/phy/qcom,sc7180-qmp-usb3-dp-phy.yaml
+++ b/Documentation/devicetree/bindings/phy/qcom,sc7180-qmp-usb3-dp-phy.yaml
@@ -65,6 +65,25 @@ properties:
description: Flag the port as possible handler of orientation switching
type: boolean
+ ports:
+ $ref: /schemas/graph.yaml#/properties/ports
+ description: OF graph bindings that model incoming orientation-switch and
+ outgoing orientation-switch messages. An example of an incoming
+ orientation-switch message might come form a Type-C connector or a USB
+ redriver. An example of an output would be a DisplayPort controller.
+
+ properties:
+ port@0:
+ $ref: /schemas/graph.yaml#/properties/port
+ description: Type-C mux orientation-switch input.
+
+ port@1:
+ $ref: /schemas/graph.yaml#/properties/port
+ description: PHY orientation-switch output.
+
+ required:
+ - port@0
+
resets:
items:
- description: reset of phy block.
@@ -279,4 +298,23 @@ examples:
#clock-cells = <1>;
#phy-cells = <0>;
};
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+ qmpphy_typec_mux_in: endpoint {
+ remote-endpoint = <&pmic_typec_mux_out>;
+ };
+ };
+
+ port@1 {
+ reg = <1>;
+ qmpphy_typec_mux_out: endpoint {
+ remote-endpoint = <&dp_typec_mux_in>;
+ };
+ };
+ };
};
--
2.39.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH v8 05/11] dt-bindings: mfd: qcom,spmi-pmic: Add typec to SPMI device types
2023-05-15 13:36 [PATCH v8 00/11] Add Qualcomm PMIC TPCM support Bryan O'Donoghue
` (3 preceding siblings ...)
2023-05-15 13:36 ` [PATCH v8 04/11] dt-bindings: phy: qcom,sc7180-qmp-usb3-dp-phy: Add input and output ports Bryan O'Donoghue
@ 2023-05-15 13:36 ` Bryan O'Donoghue
2023-05-15 13:36 ` [PATCH v8 06/11] arm64: dts: qcom: sm8250: Define ports for qmpphy orientation-switching Bryan O'Donoghue
` (6 subsequent siblings)
11 siblings, 0 replies; 20+ messages in thread
From: Bryan O'Donoghue @ 2023-05-15 13:36 UTC (permalink / raw)
To: linux, heikki.krogerus, gregkh, andersson, robh+dt,
krzysztof.kozlowski+dt, luca.weiss, lujianhua000, linux-usb,
linux-arm-msm, devicetree
Cc: konrad.dybcio, caleb.connolly, bryan.odonoghue, subbaram, jackp,
robertom, Krzysztof Kozlowski
Add the PMIC Type-C port driver to the list of devices.
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml b/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml
index 36de335a33aa8..6e6f562a915be 100644
--- a/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml
+++ b/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml
@@ -158,6 +158,10 @@ patternProperties:
type: object
$ref: /schemas/thermal/qcom,spmi-temp-alarm.yaml#
+ "^typec@[0-9a-f]+$":
+ type: object
+ $ref: /schemas/usb/qcom,pmic-typec.yaml#
+
"^usb-detect@[0-9a-f]+$":
type: object
$ref: /schemas/extcon/qcom,pm8941-misc.yaml#
--
2.39.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH v8 06/11] arm64: dts: qcom: sm8250: Define ports for qmpphy orientation-switching
2023-05-15 13:36 [PATCH v8 00/11] Add Qualcomm PMIC TPCM support Bryan O'Donoghue
` (4 preceding siblings ...)
2023-05-15 13:36 ` [PATCH v8 05/11] dt-bindings: mfd: qcom,spmi-pmic: Add typec to SPMI device types Bryan O'Donoghue
@ 2023-05-15 13:36 ` Bryan O'Donoghue
2023-05-15 13:36 ` [PATCH v8 07/11] arm64: dts: qcom: pm8150b: Add a TCPM description Bryan O'Donoghue
` (5 subsequent siblings)
11 siblings, 0 replies; 20+ messages in thread
From: Bryan O'Donoghue @ 2023-05-15 13:36 UTC (permalink / raw)
To: linux, heikki.krogerus, gregkh, andersson, robh+dt,
krzysztof.kozlowski+dt, luca.weiss, lujianhua000, linux-usb,
linux-arm-msm, devicetree
Cc: konrad.dybcio, caleb.connolly, bryan.odonoghue, subbaram, jackp,
robertom
ports for orientation switching input and output. The individual board dts
files will instantiate port@0 and port@1 depending on the supported
feature-set.
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
arch/arm64/boot/dts/qcom/sm8250.dtsi | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/sm8250.dtsi b/arch/arm64/boot/dts/qcom/sm8250.dtsi
index 7bea916900e29..0bc7486e59e54 100644
--- a/arch/arm64/boot/dts/qcom/sm8250.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8250.dtsi
@@ -3581,6 +3581,19 @@ dp_phy: dp-phy@88ea200 {
#phy-cells = <0>;
#clock-cells = <1>;
};
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+ };
+
+ port@1 {
+ reg = <1>;
+ };
+ };
};
usb_2_qmpphy: phy@88eb000 {
--
2.39.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH v8 07/11] arm64: dts: qcom: pm8150b: Add a TCPM description
2023-05-15 13:36 [PATCH v8 00/11] Add Qualcomm PMIC TPCM support Bryan O'Donoghue
` (5 preceding siblings ...)
2023-05-15 13:36 ` [PATCH v8 06/11] arm64: dts: qcom: sm8250: Define ports for qmpphy orientation-switching Bryan O'Donoghue
@ 2023-05-15 13:36 ` Bryan O'Donoghue
2023-05-18 10:01 ` Konrad Dybcio
2023-05-15 13:36 ` [PATCH v8 08/11] arm64: dts: qcom: qrb5165-rb5: Switch on Type-C VBUS boost Bryan O'Donoghue
` (4 subsequent siblings)
11 siblings, 1 reply; 20+ messages in thread
From: Bryan O'Donoghue @ 2023-05-15 13:36 UTC (permalink / raw)
To: linux, heikki.krogerus, gregkh, andersson, robh+dt,
krzysztof.kozlowski+dt, luca.weiss, lujianhua000, linux-usb,
linux-arm-msm, devicetree
Cc: konrad.dybcio, caleb.connolly, bryan.odonoghue, subbaram, jackp,
robertom
Type-C port management functionality lives inside of the PMIC block on
pm8150b.
The Type-C port management logic controls orientation detection, vbus/vconn
sense and to send/receive Type-C Power Domain messages.
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
arch/arm64/boot/dts/qcom/pm8150b.dtsi | 40 +++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/pm8150b.dtsi b/arch/arm64/boot/dts/qcom/pm8150b.dtsi
index 66752cc063d60..136e5f96a3d53 100644
--- a/arch/arm64/boot/dts/qcom/pm8150b.dtsi
+++ b/arch/arm64/boot/dts/qcom/pm8150b.dtsi
@@ -59,6 +59,46 @@ pm8150b_vbus: usb-vbus-regulator@1100 {
reg = <0x1100>;
};
+ pm8150b_typec: typec@1500 {
+ compatible = "qcom,pm8150b-typec";
+ status = "disabled";
+ reg = <0x1500>,
+ <0x1700>;
+ interrupts = <0x2 0x15 0x00 IRQ_TYPE_EDGE_RISING>,
+ <0x2 0x15 0x01 IRQ_TYPE_EDGE_BOTH>,
+ <0x2 0x15 0x02 IRQ_TYPE_EDGE_RISING>,
+ <0x2 0x15 0x03 IRQ_TYPE_EDGE_BOTH>,
+ <0x2 0x15 0x04 IRQ_TYPE_EDGE_RISING>,
+ <0x2 0x15 0x05 IRQ_TYPE_EDGE_RISING>,
+ <0x2 0x15 0x06 IRQ_TYPE_EDGE_BOTH>,
+ <0x2 0x15 0x07 IRQ_TYPE_EDGE_RISING>,
+ <0x2 0x17 0x00 IRQ_TYPE_EDGE_RISING>,
+ <0x2 0x17 0x01 IRQ_TYPE_EDGE_RISING>,
+ <0x2 0x17 0x02 IRQ_TYPE_EDGE_RISING>,
+ <0x2 0x17 0x03 IRQ_TYPE_EDGE_RISING>,
+ <0x2 0x17 0x04 IRQ_TYPE_EDGE_RISING>,
+ <0x2 0x17 0x05 IRQ_TYPE_EDGE_RISING>,
+ <0x2 0x17 0x06 IRQ_TYPE_EDGE_RISING>,
+ <0x2 0x17 0x07 IRQ_TYPE_EDGE_RISING>;
+ interrupt-names = "or-rid-detect-change",
+ "vpd-detect",
+ "cc-state-change",
+ "vconn-oc",
+ "vbus-change",
+ "attach-detach",
+ "legacy-cable-detect",
+ "try-snk-src-detect",
+ "sig-tx",
+ "sig-rx",
+ "msg-tx",
+ "msg-rx",
+ "msg-tx-failed",
+ "msg-tx-discarded",
+ "msg-rx-discarded",
+ "fr-swap";
+ vdd-vbus-supply = <&pm8150b_vbus>;
+ };
+
pm8150b_temp: temp-alarm@2400 {
compatible = "qcom,spmi-temp-alarm";
reg = <0x2400>;
--
2.39.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH v8 08/11] arm64: dts: qcom: qrb5165-rb5: Switch on Type-C VBUS boost
2023-05-15 13:36 [PATCH v8 00/11] Add Qualcomm PMIC TPCM support Bryan O'Donoghue
` (6 preceding siblings ...)
2023-05-15 13:36 ` [PATCH v8 07/11] arm64: dts: qcom: pm8150b: Add a TCPM description Bryan O'Donoghue
@ 2023-05-15 13:36 ` Bryan O'Donoghue
2023-07-09 0:17 ` Dmitry Baryshkov
2023-05-15 13:36 ` [PATCH v8 09/11] arm64: dts: qcom: qrb5165-rb5: Switch on basic TCPM Bryan O'Donoghue
` (3 subsequent siblings)
11 siblings, 1 reply; 20+ messages in thread
From: Bryan O'Donoghue @ 2023-05-15 13:36 UTC (permalink / raw)
To: linux, heikki.krogerus, gregkh, andersson, robh+dt,
krzysztof.kozlowski+dt, luca.weiss, lujianhua000, linux-usb,
linux-arm-msm, devicetree
Cc: konrad.dybcio, caleb.connolly, bryan.odonoghue, subbaram, jackp,
robertom
Switch on VBUS for the Type-C port. We need to support a higher amperage
than the bootloader set 2 Amps.
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
arch/arm64/boot/dts/qcom/qrb5165-rb5.dts | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts b/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts
index dd924331b0eea..b326bdeeb7742 100644
--- a/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts
+++ b/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts
@@ -1338,3 +1338,9 @@ &qup_spi0_data_clk {
drive-strength = <6>;
bias-disable;
};
+
+&pm8150b_vbus {
+ regulator-min-microamp = <500000>;
+ regulator-max-microamp = <3000000>;
+ status = "okay";
+};
--
2.39.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH v8 09/11] arm64: dts: qcom: qrb5165-rb5: Switch on basic TCPM
2023-05-15 13:36 [PATCH v8 00/11] Add Qualcomm PMIC TPCM support Bryan O'Donoghue
` (7 preceding siblings ...)
2023-05-15 13:36 ` [PATCH v8 08/11] arm64: dts: qcom: qrb5165-rb5: Switch on Type-C VBUS boost Bryan O'Donoghue
@ 2023-05-15 13:36 ` Bryan O'Donoghue
2023-05-15 13:36 ` [PATCH v8 10/11] arm64: dts: qcom: qrb5165-rb5: Switch on TCPM usb-role-switching for usb_1 Bryan O'Donoghue
` (2 subsequent siblings)
11 siblings, 0 replies; 20+ messages in thread
From: Bryan O'Donoghue @ 2023-05-15 13:36 UTC (permalink / raw)
To: linux, heikki.krogerus, gregkh, andersson, robh+dt,
krzysztof.kozlowski+dt, luca.weiss, lujianhua000, linux-usb,
linux-arm-msm, devicetree
Cc: konrad.dybcio, caleb.connolly, bryan.odonoghue, subbaram, jackp,
robertom
Switch on TCPM for the RB5. Here we declare as a source only not a sink
since qrb5165 doesn't support powering exclusively from the type-c port.
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
arch/arm64/boot/dts/qcom/qrb5165-rb5.dts | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts b/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts
index b326bdeeb7742..d80a22bff7969 100644
--- a/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts
+++ b/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts
@@ -9,6 +9,7 @@
#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
#include <dt-bindings/sound/qcom,q6afe.h>
#include <dt-bindings/sound/qcom,q6asm.h>
+#include <dt-bindings/usb/pd.h>
#include "sm8250.dtsi"
#include "pm8150.dtsi"
#include "pm8150b.dtsi"
@@ -1344,3 +1345,22 @@ &pm8150b_vbus {
regulator-max-microamp = <3000000>;
status = "okay";
};
+
+&pm8150b_typec {
+ status = "okay";
+
+ vdd-pdphy-supply = <&vreg_l2a_3p1>;
+
+ connector {
+ compatible = "usb-c-connector";
+
+ power-role = "source";
+ data-role = "dual";
+ self-powered;
+
+ source-pdos = <PDO_FIXED(5000, 3000,
+ PDO_FIXED_DUAL_ROLE |
+ PDO_FIXED_USB_COMM |
+ PDO_FIXED_DATA_SWAP)>;
+ };
+};
--
2.39.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH v8 10/11] arm64: dts: qcom: qrb5165-rb5: Switch on TCPM usb-role-switching for usb_1
2023-05-15 13:36 [PATCH v8 00/11] Add Qualcomm PMIC TPCM support Bryan O'Donoghue
` (8 preceding siblings ...)
2023-05-15 13:36 ` [PATCH v8 09/11] arm64: dts: qcom: qrb5165-rb5: Switch on basic TCPM Bryan O'Donoghue
@ 2023-05-15 13:36 ` Bryan O'Donoghue
2023-07-08 23:48 ` Dmitry Baryshkov
2023-05-15 13:36 ` [PATCH v8 11/11] arm64: dts: qcom: qrb5165-rb5: Switch on TCPM orientation-switch for usb_1_qmpphy Bryan O'Donoghue
2023-07-08 23:49 ` [PATCH v8 00/11] Add Qualcomm PMIC TPCM support Dmitry Baryshkov
11 siblings, 1 reply; 20+ messages in thread
From: Bryan O'Donoghue @ 2023-05-15 13:36 UTC (permalink / raw)
To: linux, heikki.krogerus, gregkh, andersson, robh+dt,
krzysztof.kozlowski+dt, luca.weiss, lujianhua000, linux-usb,
linux-arm-msm, devicetree
Cc: konrad.dybcio, caleb.connolly, bryan.odonoghue, subbaram, jackp,
robertom
Switch on usb-role-switching for usb_1 via TCPM. We need to declare
usb-role-switch in &usb_1 and associate with the remote-endpoint in TCPM
which provides the necessary signal.
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
arch/arm64/boot/dts/qcom/qrb5165-rb5.dts | 19 ++++++++++++++++++-
arch/arm64/boot/dts/qcom/sm8250.dtsi | 4 ++++
2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts b/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts
index d80a22bff7969..580ed63c6fb54 100644
--- a/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts
+++ b/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts
@@ -1273,7 +1273,12 @@ &usb_1 {
};
&usb_1_dwc3 {
- dr_mode = "peripheral";
+ dr_mode = "otg";
+ usb-role-switch;
+};
+
+&usb_1_dwc3_role_switch_in {
+ remote-endpoint = <&pm8150b_role_switch_out>;
};
&usb_1_hsphy {
@@ -1362,5 +1367,17 @@ connector {
PDO_FIXED_DUAL_ROLE |
PDO_FIXED_USB_COMM |
PDO_FIXED_DATA_SWAP)>;
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+ pm8150b_role_switch_out: endpoint {
+ remote-endpoint = <&usb_1_dwc3_role_switch_in>;
+ };
+ };
+ };
};
};
diff --git a/arch/arm64/boot/dts/qcom/sm8250.dtsi b/arch/arm64/boot/dts/qcom/sm8250.dtsi
index 0bc7486e59e54..b9f55a9ef89f8 100644
--- a/arch/arm64/boot/dts/qcom/sm8250.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8250.dtsi
@@ -3740,6 +3740,10 @@ usb_1_dwc3: usb@a600000 {
snps,dis_enblslpm_quirk;
phys = <&usb_1_hsphy>, <&usb_1_ssphy>;
phy-names = "usb2-phy", "usb3-phy";
+
+ port {
+ usb_1_dwc3_role_switch_in: endpoint {};
+ };
};
};
--
2.39.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH v8 11/11] arm64: dts: qcom: qrb5165-rb5: Switch on TCPM orientation-switch for usb_1_qmpphy
2023-05-15 13:36 [PATCH v8 00/11] Add Qualcomm PMIC TPCM support Bryan O'Donoghue
` (9 preceding siblings ...)
2023-05-15 13:36 ` [PATCH v8 10/11] arm64: dts: qcom: qrb5165-rb5: Switch on TCPM usb-role-switching for usb_1 Bryan O'Donoghue
@ 2023-05-15 13:36 ` Bryan O'Donoghue
2023-07-08 23:48 ` Dmitry Baryshkov
2023-07-08 23:49 ` [PATCH v8 00/11] Add Qualcomm PMIC TPCM support Dmitry Baryshkov
11 siblings, 1 reply; 20+ messages in thread
From: Bryan O'Donoghue @ 2023-05-15 13:36 UTC (permalink / raw)
To: linux, heikki.krogerus, gregkh, andersson, robh+dt,
krzysztof.kozlowski+dt, luca.weiss, lujianhua000, linux-usb,
linux-arm-msm, devicetree
Cc: konrad.dybcio, caleb.connolly, bryan.odonoghue, subbaram, jackp,
robertom
Switch on USB orientation-switching for usb_1_qmp via TCPM. Detecting the
orientation switch is required to get the PHY to reset and bring-up the PHY
with the CC lines set to the appropriate lane.
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
arch/arm64/boot/dts/qcom/qrb5165-rb5.dts | 11 +++++++++++
arch/arm64/boot/dts/qcom/sm8250.dtsi | 1 +
2 files changed, 12 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts b/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts
index 580ed63c6fb54..9b314c390e3f8 100644
--- a/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts
+++ b/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts
@@ -1294,6 +1294,11 @@ &usb_1_qmpphy {
vdda-phy-supply = <&vreg_l9a_1p2>;
vdda-pll-supply = <&vreg_l18a_0p92>;
+ orientation-switch;
+};
+
+&usb_1_qmpphy_typec_mux_in {
+ remote-endpoint = <&pm8150b_typec_mux_out>;
};
&usb_2 {
@@ -1378,6 +1383,12 @@ pm8150b_role_switch_out: endpoint {
remote-endpoint = <&usb_1_dwc3_role_switch_in>;
};
};
+ port@1 {
+ reg = <1>;
+ pm8150b_typec_mux_out: endpoint {
+ remote-endpoint = <&usb_1_qmpphy_typec_mux_in>;
+ };
+ };
};
};
};
diff --git a/arch/arm64/boot/dts/qcom/sm8250.dtsi b/arch/arm64/boot/dts/qcom/sm8250.dtsi
index b9f55a9ef89f8..f538216f3704f 100644
--- a/arch/arm64/boot/dts/qcom/sm8250.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8250.dtsi
@@ -3588,6 +3588,7 @@ ports {
port@0 {
reg = <0>;
+ usb_1_qmpphy_typec_mux_in: endpoint {};
};
port@1 {
--
2.39.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* Re: [PATCH v8 04/11] dt-bindings: phy: qcom,sc7180-qmp-usb3-dp-phy: Add input and output ports
2023-05-15 13:36 ` [PATCH v8 04/11] dt-bindings: phy: qcom,sc7180-qmp-usb3-dp-phy: Add input and output ports Bryan O'Donoghue
@ 2023-05-15 19:59 ` Bjorn Andersson
2023-05-16 10:15 ` Bryan O'Donoghue
2023-07-18 6:09 ` Dmitry Baryshkov
0 siblings, 2 replies; 20+ messages in thread
From: Bjorn Andersson @ 2023-05-15 19:59 UTC (permalink / raw)
To: Bryan O'Donoghue
Cc: linux, heikki.krogerus, gregkh, robh+dt, krzysztof.kozlowski+dt,
luca.weiss, lujianhua000, linux-usb, linux-arm-msm, devicetree,
konrad.dybcio, caleb.connolly, subbaram, jackp, robertom,
Krzysztof Kozlowski
On Mon, May 15, 2023 at 02:36:36PM +0100, Bryan O'Donoghue wrote:
> Add a ports declaration which is optional containing two port@
> declarations.
>
> port@0 to receive an orientation-switch message from the Type-C port or
> redriver
>
> port@1 to subsequently transmit the orientation-switch on once the PHY has
> finished doing its orientation turn-around.
>
> If ports is declared the input port port@0 is mandatory but the output
> port@1 is optional.
>
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> ---
> .../phy/qcom,sc7180-qmp-usb3-dp-phy.yaml | 38 +++++++++++++++++++
> 1 file changed, 38 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/phy/qcom,sc7180-qmp-usb3-dp-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,sc7180-qmp-usb3-dp-phy.yaml
> index d307343388888..c370b9cd58c2e 100644
> --- a/Documentation/devicetree/bindings/phy/qcom,sc7180-qmp-usb3-dp-phy.yaml
> +++ b/Documentation/devicetree/bindings/phy/qcom,sc7180-qmp-usb3-dp-phy.yaml
> @@ -65,6 +65,25 @@ properties:
> description: Flag the port as possible handler of orientation switching
> type: boolean
>
> + ports:
> + $ref: /schemas/graph.yaml#/properties/ports
> + description: OF graph bindings that model incoming orientation-switch and
> + outgoing orientation-switch messages. An example of an incoming
> + orientation-switch message might come form a Type-C connector or a USB
> + redriver. An example of an output would be a DisplayPort controller.
Orientation switching is just one of the uses of this graph, and each
port is both input and output of different signals (orientation switch,
altmode switch, hot plug signals, signal path).
How about aligning this version of the QMP binding with the proposed
binding for 8280xp here:
https://lore.kernel.org/linux-arm-msm/20230515032743.400170-2-quic_bjorande@quicinc.com/
Perhaps we could put some of this in a separate yaml and include that?
Regards,
Bjorn
> +
> + properties:
> + port@0:
> + $ref: /schemas/graph.yaml#/properties/port
> + description: Type-C mux orientation-switch input.
> +
> + port@1:
> + $ref: /schemas/graph.yaml#/properties/port
> + description: PHY orientation-switch output.
> +
> + required:
> + - port@0
> +
> resets:
> items:
> - description: reset of phy block.
> @@ -279,4 +298,23 @@ examples:
> #clock-cells = <1>;
> #phy-cells = <0>;
> };
> +
> + ports {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + port@0 {
> + reg = <0>;
> + qmpphy_typec_mux_in: endpoint {
> + remote-endpoint = <&pmic_typec_mux_out>;
> + };
> + };
> +
> + port@1 {
> + reg = <1>;
> + qmpphy_typec_mux_out: endpoint {
> + remote-endpoint = <&dp_typec_mux_in>;
> + };
> + };
> + };
> };
> --
> 2.39.2
>
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH v8 04/11] dt-bindings: phy: qcom,sc7180-qmp-usb3-dp-phy: Add input and output ports
2023-05-15 19:59 ` Bjorn Andersson
@ 2023-05-16 10:15 ` Bryan O'Donoghue
2023-07-18 6:09 ` Dmitry Baryshkov
1 sibling, 0 replies; 20+ messages in thread
From: Bryan O'Donoghue @ 2023-05-16 10:15 UTC (permalink / raw)
To: Bjorn Andersson
Cc: linux, heikki.krogerus, gregkh, robh+dt, krzysztof.kozlowski+dt,
luca.weiss, lujianhua000, linux-usb, linux-arm-msm, devicetree,
konrad.dybcio, caleb.connolly, subbaram, jackp, robertom,
Krzysztof Kozlowski
On 15/05/2023 20:59, Bjorn Andersson wrote:
> Perhaps we could put some of this in a separate yaml and include that?
Ok sure.
---
bod
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH v8 07/11] arm64: dts: qcom: pm8150b: Add a TCPM description
2023-05-15 13:36 ` [PATCH v8 07/11] arm64: dts: qcom: pm8150b: Add a TCPM description Bryan O'Donoghue
@ 2023-05-18 10:01 ` Konrad Dybcio
0 siblings, 0 replies; 20+ messages in thread
From: Konrad Dybcio @ 2023-05-18 10:01 UTC (permalink / raw)
To: Bryan O'Donoghue, linux, heikki.krogerus, gregkh, andersson,
robh+dt, krzysztof.kozlowski+dt, luca.weiss, lujianhua000,
linux-usb, linux-arm-msm, devicetree
Cc: caleb.connolly, subbaram, jackp, robertom
On 15.05.2023 15:36, Bryan O'Donoghue wrote:
> Type-C port management functionality lives inside of the PMIC block on
> pm8150b.
>
> The Type-C port management logic controls orientation detection, vbus/vconn
> sense and to send/receive Type-C Power Domain messages.
>
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Konrad
> arch/arm64/boot/dts/qcom/pm8150b.dtsi | 40 +++++++++++++++++++++++++++
> 1 file changed, 40 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/pm8150b.dtsi b/arch/arm64/boot/dts/qcom/pm8150b.dtsi
> index 66752cc063d60..136e5f96a3d53 100644
> --- a/arch/arm64/boot/dts/qcom/pm8150b.dtsi
> +++ b/arch/arm64/boot/dts/qcom/pm8150b.dtsi
> @@ -59,6 +59,46 @@ pm8150b_vbus: usb-vbus-regulator@1100 {
> reg = <0x1100>;
> };
>
> + pm8150b_typec: typec@1500 {
> + compatible = "qcom,pm8150b-typec";
> + status = "disabled";
> + reg = <0x1500>,
> + <0x1700>;
> + interrupts = <0x2 0x15 0x00 IRQ_TYPE_EDGE_RISING>,
> + <0x2 0x15 0x01 IRQ_TYPE_EDGE_BOTH>,
> + <0x2 0x15 0x02 IRQ_TYPE_EDGE_RISING>,
> + <0x2 0x15 0x03 IRQ_TYPE_EDGE_BOTH>,
> + <0x2 0x15 0x04 IRQ_TYPE_EDGE_RISING>,
> + <0x2 0x15 0x05 IRQ_TYPE_EDGE_RISING>,
> + <0x2 0x15 0x06 IRQ_TYPE_EDGE_BOTH>,
> + <0x2 0x15 0x07 IRQ_TYPE_EDGE_RISING>,
> + <0x2 0x17 0x00 IRQ_TYPE_EDGE_RISING>,
> + <0x2 0x17 0x01 IRQ_TYPE_EDGE_RISING>,
> + <0x2 0x17 0x02 IRQ_TYPE_EDGE_RISING>,
> + <0x2 0x17 0x03 IRQ_TYPE_EDGE_RISING>,
> + <0x2 0x17 0x04 IRQ_TYPE_EDGE_RISING>,
> + <0x2 0x17 0x05 IRQ_TYPE_EDGE_RISING>,
> + <0x2 0x17 0x06 IRQ_TYPE_EDGE_RISING>,
> + <0x2 0x17 0x07 IRQ_TYPE_EDGE_RISING>;
> + interrupt-names = "or-rid-detect-change",
> + "vpd-detect",
> + "cc-state-change",
> + "vconn-oc",
> + "vbus-change",
> + "attach-detach",
> + "legacy-cable-detect",
> + "try-snk-src-detect",
> + "sig-tx",
> + "sig-rx",
> + "msg-tx",
> + "msg-rx",
> + "msg-tx-failed",
> + "msg-tx-discarded",
> + "msg-rx-discarded",
> + "fr-swap";
> + vdd-vbus-supply = <&pm8150b_vbus>;
> + };
> +
> pm8150b_temp: temp-alarm@2400 {
> compatible = "qcom,spmi-temp-alarm";
> reg = <0x2400>;
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH v8 10/11] arm64: dts: qcom: qrb5165-rb5: Switch on TCPM usb-role-switching for usb_1
2023-05-15 13:36 ` [PATCH v8 10/11] arm64: dts: qcom: qrb5165-rb5: Switch on TCPM usb-role-switching for usb_1 Bryan O'Donoghue
@ 2023-07-08 23:48 ` Dmitry Baryshkov
0 siblings, 0 replies; 20+ messages in thread
From: Dmitry Baryshkov @ 2023-07-08 23:48 UTC (permalink / raw)
To: Bryan O'Donoghue, linux, heikki.krogerus, gregkh, andersson,
robh+dt, krzysztof.kozlowski+dt, luca.weiss, lujianhua000,
linux-usb, linux-arm-msm, devicetree
Cc: konrad.dybcio, caleb.connolly, subbaram, jackp, robertom
On 15/05/2023 16:36, Bryan O'Donoghue wrote:
> Switch on usb-role-switching for usb_1 via TCPM. We need to declare
> usb-role-switch in &usb_1 and associate with the remote-endpoint in TCPM
> which provides the necessary signal.
>
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> ---
> arch/arm64/boot/dts/qcom/qrb5165-rb5.dts | 19 ++++++++++++++++++-
> arch/arm64/boot/dts/qcom/sm8250.dtsi | 4 ++++
> 2 files changed, 22 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts b/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts
> index d80a22bff7969..580ed63c6fb54 100644
> --- a/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts
> +++ b/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts
> @@ -1273,7 +1273,12 @@ &usb_1 {
> };
>
> &usb_1_dwc3 {
> - dr_mode = "peripheral";
> + dr_mode = "otg";
> + usb-role-switch;
> +};
> +
> +&usb_1_dwc3_role_switch_in {
> + remote-endpoint = <&pm8150b_role_switch_out>;
> };
>
> &usb_1_hsphy {
> @@ -1362,5 +1367,17 @@ connector {
> PDO_FIXED_DUAL_ROLE |
> PDO_FIXED_USB_COMM |
> PDO_FIXED_DATA_SWAP)>;
> +
> + ports {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + port@0 {
> + reg = <0>;
Empty line before the child node, please.
> + pm8150b_role_switch_out: endpoint {
> + remote-endpoint = <&usb_1_dwc3_role_switch_in>;
> + };
> + };
> + };
> };
> };
> diff --git a/arch/arm64/boot/dts/qcom/sm8250.dtsi b/arch/arm64/boot/dts/qcom/sm8250.dtsi
> index 0bc7486e59e54..b9f55a9ef89f8 100644
> --- a/arch/arm64/boot/dts/qcom/sm8250.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sm8250.dtsi
> @@ -3740,6 +3740,10 @@ usb_1_dwc3: usb@a600000 {
> snps,dis_enblslpm_quirk;
> phys = <&usb_1_hsphy>, <&usb_1_ssphy>;
> phy-names = "usb2-phy", "usb3-phy";
> +
> + port {
> + usb_1_dwc3_role_switch_in: endpoint {};
> + };
> };
> };
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH v8 11/11] arm64: dts: qcom: qrb5165-rb5: Switch on TCPM orientation-switch for usb_1_qmpphy
2023-05-15 13:36 ` [PATCH v8 11/11] arm64: dts: qcom: qrb5165-rb5: Switch on TCPM orientation-switch for usb_1_qmpphy Bryan O'Donoghue
@ 2023-07-08 23:48 ` Dmitry Baryshkov
0 siblings, 0 replies; 20+ messages in thread
From: Dmitry Baryshkov @ 2023-07-08 23:48 UTC (permalink / raw)
To: Bryan O'Donoghue, linux, heikki.krogerus, gregkh, andersson,
robh+dt, krzysztof.kozlowski+dt, luca.weiss, lujianhua000,
linux-usb, linux-arm-msm, devicetree
Cc: konrad.dybcio, caleb.connolly, subbaram, jackp, robertom
On 15/05/2023 16:36, Bryan O'Donoghue wrote:
> Switch on USB orientation-switching for usb_1_qmp via TCPM. Detecting the
> orientation switch is required to get the PHY to reset and bring-up the PHY
> with the CC lines set to the appropriate lane.
>
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> ---
> arch/arm64/boot/dts/qcom/qrb5165-rb5.dts | 11 +++++++++++
> arch/arm64/boot/dts/qcom/sm8250.dtsi | 1 +
> 2 files changed, 12 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts b/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts
> index 580ed63c6fb54..9b314c390e3f8 100644
> --- a/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts
> +++ b/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts
> @@ -1294,6 +1294,11 @@ &usb_1_qmpphy {
>
> vdda-phy-supply = <&vreg_l9a_1p2>;
> vdda-pll-supply = <&vreg_l18a_0p92>;
> + orientation-switch;
> +};
> +
> +&usb_1_qmpphy_typec_mux_in {
> + remote-endpoint = <&pm8150b_typec_mux_out>;
> };
>
> &usb_2 {
> @@ -1378,6 +1383,12 @@ pm8150b_role_switch_out: endpoint {
> remote-endpoint = <&usb_1_dwc3_role_switch_in>;
> };
> };
> + port@1 {
> + reg = <1>;
Empty line before the child node, please.
> + pm8150b_typec_mux_out: endpoint {
> + remote-endpoint = <&usb_1_qmpphy_typec_mux_in>;
> + };
> + };
> };
> };
> };
> diff --git a/arch/arm64/boot/dts/qcom/sm8250.dtsi b/arch/arm64/boot/dts/qcom/sm8250.dtsi
> index b9f55a9ef89f8..f538216f3704f 100644
> --- a/arch/arm64/boot/dts/qcom/sm8250.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sm8250.dtsi
> @@ -3588,6 +3588,7 @@ ports {
>
> port@0 {
> reg = <0>;
And maybe here too.
> + usb_1_qmpphy_typec_mux_in: endpoint {};
> };
>
> port@1 {
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH v8 00/11] Add Qualcomm PMIC TPCM support
2023-05-15 13:36 [PATCH v8 00/11] Add Qualcomm PMIC TPCM support Bryan O'Donoghue
` (10 preceding siblings ...)
2023-05-15 13:36 ` [PATCH v8 11/11] arm64: dts: qcom: qrb5165-rb5: Switch on TCPM orientation-switch for usb_1_qmpphy Bryan O'Donoghue
@ 2023-07-08 23:49 ` Dmitry Baryshkov
11 siblings, 0 replies; 20+ messages in thread
From: Dmitry Baryshkov @ 2023-07-08 23:49 UTC (permalink / raw)
To: Bryan O'Donoghue, linux, heikki.krogerus, gregkh, andersson,
robh+dt, krzysztof.kozlowski+dt, luca.weiss, lujianhua000,
linux-usb, linux-arm-msm, devicetree
Cc: konrad.dybcio, caleb.connolly, subbaram, jackp, robertom
On 15/05/2023 16:36, Bryan O'Donoghue wrote:
> Bootable tree
> Link: https://git.codelinaro.org/bryan.odonoghue/kernel/-/tree/usb-next-23-05-14-qcom-wrapper-typec-mux-bjorn
>
> V8:
> - Makes pm8150b_typec::status = disabled by default - bod
> - Greg merged the TCPM description and driver to usb-next so two patches less now.
> I've rebased this series on to usb-next using "--base=auto"
> All of the kernel robot dts/yaml checks should now pass against usb-next / a4422ff221429c600c3dc5d0394fb3738b89d040
>
> V7:
> - Adds R/B to "dt-bindings: phy: qcom,sc7180-qmp-usb3-dp-phy: Add input and output ports" - Krzysztof
> - Fixes indicated, adds R/B to "dt-bindings: usb: Add Qualcomm PMIC Type-C" - Krzysztof
> - Fixes indicated, adds R/B to "usb: typec: qcom: Add Qualcomm PMIC Type-C driver" - Guenter
> - Fixes indicated, adds R/B to "usb: typec: qcom: Add Qualcomm PMIC Type-C driver" - Caleb
> - Adds R/B to "arm64: dts: qcom: sm8250: Define ports for qmpphy orientation-switching" - Konrad
> - Adds R/B to "arm64: dts: qcom: qrb5165-rb5: Switch on Type-C VBUS boost" - Konrad
> - Fixes indicated, adds R/B to "arm64: dts: qcom: qrb5165-rb5: Switch on basic TCPM" - Jianhua, Konrad
> - Connector ports/endpoints left inside of connector
> Documentation/devicetree/bindings/connector/usb-connector.yaml - Jianhua
> - dwc3_role_switch_in -> usb_1_dwc3_role_switch_in
> qmpphy_typec_mux_in -> usb_1_qmpphy_typec_mux_in
> Both ports/endpoints defined inside of pm8150b dtsi - Konrad
>
> I modified the name of both so that the port/endpoint would be directly
> adjacent to the containing node in the dtsi file for code locality/readbility - bod
>
> - Fixes newline indicated "arm64: dts: qcom: qrb5165-rb5: Switch on TCPM usb-role-switching for usb_1" - Jianhua, Konrad
> - Fixes newline indicated "arm64: dts: qcom: qrb5165-rb5: Switch on TCPM orientation-switch for usb_1_qmpphy" - Jianhua, Konrad
>
> - connector
> I have left the connector defintion and its ports/endpoints in the platform dts
>
> The reason for this
> a) Prior art e.g. arch/arm64/boot/dts/qcom/sc8280xp*
> b) The connector is really a non-SoC/PMIC component its something that is defined
> for your platform.
>
> I'm open to further debate on this topic:
> Link: https://imgflip.com/i/7kw6ck
>
> - port@1 -> port@1 "arm64: dts: qcom: qrb5165-rb5: Switch on TCPM orientation-switch for usb_1_qmpphy" - Jianhua
>
> - OF: graph: no port node found in /soc@0/spmi@c440000/pmic@2/typec@1500
>
> I left this as-is since the DT model we want is to connect the connector directly to
> the PHY for orientation or controller for data-role switching
>
> I similarly didn't put this hack in place to remove the warning but "it would work"
>
> V6:
> - I'm dropping the previous V1-V6 log because the text is getting too long
> here's a link to the previous cover letter instead
> Link: https://lore.kernel.org/linux-arm-msm/20230501121111.1058190-1-bryan.odonoghue@linaro.org/
>
>
> Bryan O'Donoghue (11):
> dt-bindings: regulator: qcom,usb-vbus-regulator: Mark reg as required
> dt-bindings: regulator: qcom,usb-vbus-regulator: Mark
> regulator-*-microamp required
> dt-bindings: phy: qcom,sc7180-qmp-usb3-dp-phy: Add orientation-switch
> as optional
> dt-bindings: phy: qcom,sc7180-qmp-usb3-dp-phy: Add input and output
> ports
> dt-bindings: mfd: qcom,spmi-pmic: Add typec to SPMI device types
> arm64: dts: qcom: sm8250: Define ports for qmpphy
> orientation-switching
> arm64: dts: qcom: pm8150b: Add a TCPM description
> arm64: dts: qcom: qrb5165-rb5: Switch on Type-C VBUS boost
> arm64: dts: qcom: qrb5165-rb5: Switch on basic TCPM
> arm64: dts: qcom: qrb5165-rb5: Switch on TCPM usb-role-switching for
> usb_1
> arm64: dts: qcom: qrb5165-rb5: Switch on TCPM orientation-switch for
> usb_1_qmpphy
>
> .../bindings/mfd/qcom,spmi-pmic.yaml | 4 ++
> .../phy/qcom,sc7180-qmp-usb3-dp-phy.yaml | 44 +++++++++++++++
> .../regulator/qcom,usb-vbus-regulator.yaml | 10 +++-
> arch/arm64/boot/dts/qcom/pm8150b.dtsi | 40 +++++++++++++
> arch/arm64/boot/dts/qcom/qrb5165-rb5.dts | 56 ++++++++++++++++++-
> arch/arm64/boot/dts/qcom/sm8250.dtsi | 18 ++++++
> 6 files changed, 170 insertions(+), 2 deletions(-)
Tested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH v8 08/11] arm64: dts: qcom: qrb5165-rb5: Switch on Type-C VBUS boost
2023-05-15 13:36 ` [PATCH v8 08/11] arm64: dts: qcom: qrb5165-rb5: Switch on Type-C VBUS boost Bryan O'Donoghue
@ 2023-07-09 0:17 ` Dmitry Baryshkov
0 siblings, 0 replies; 20+ messages in thread
From: Dmitry Baryshkov @ 2023-07-09 0:17 UTC (permalink / raw)
To: Bryan O'Donoghue, linux, heikki.krogerus, gregkh, andersson,
robh+dt, krzysztof.kozlowski+dt, luca.weiss, lujianhua000,
linux-usb, linux-arm-msm, devicetree
Cc: konrad.dybcio, caleb.connolly, subbaram, jackp, robertom
On 15/05/2023 16:36, Bryan O'Donoghue wrote:
> Switch on VBUS for the Type-C port. We need to support a higher amperage
> than the bootloader set 2 Amps.
>
> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> ---
> arch/arm64/boot/dts/qcom/qrb5165-rb5.dts | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts b/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts
> index dd924331b0eea..b326bdeeb7742 100644
> --- a/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts
> +++ b/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts
> @@ -1338,3 +1338,9 @@ &qup_spi0_data_clk {
> drive-strength = <6>;
> bias-disable;
> };
> +
> +&pm8150b_vbus {
> + regulator-min-microamp = <500000>;
> + regulator-max-microamp = <3000000>;
> + status = "okay";
> +};
Note, you are placing this declaration (and further changes in the next
patches) at the end of the file, in the pinctrl area. Please move them
up into a correct place.
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH v8 04/11] dt-bindings: phy: qcom,sc7180-qmp-usb3-dp-phy: Add input and output ports
2023-05-15 19:59 ` Bjorn Andersson
2023-05-16 10:15 ` Bryan O'Donoghue
@ 2023-07-18 6:09 ` Dmitry Baryshkov
1 sibling, 0 replies; 20+ messages in thread
From: Dmitry Baryshkov @ 2023-07-18 6:09 UTC (permalink / raw)
To: Bjorn Andersson, Bryan O'Donoghue
Cc: linux, heikki.krogerus, gregkh, robh+dt, krzysztof.kozlowski+dt,
luca.weiss, lujianhua000, linux-usb, linux-arm-msm, devicetree,
konrad.dybcio, caleb.connolly, subbaram, jackp, robertom,
Krzysztof Kozlowski
On 15/05/2023 22:59, Bjorn Andersson wrote:
> On Mon, May 15, 2023 at 02:36:36PM +0100, Bryan O'Donoghue wrote:
>> Add a ports declaration which is optional containing two port@
>> declarations.
>>
>> port@0 to receive an orientation-switch message from the Type-C port or
>> redriver
>>
>> port@1 to subsequently transmit the orientation-switch on once the PHY has
>> finished doing its orientation turn-around.
>>
>> If ports is declared the input port port@0 is mandatory but the output
>> port@1 is optional.
>>
>> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
>> ---
>> .../phy/qcom,sc7180-qmp-usb3-dp-phy.yaml | 38 +++++++++++++++++++
>> 1 file changed, 38 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/phy/qcom,sc7180-qmp-usb3-dp-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,sc7180-qmp-usb3-dp-phy.yaml
>> index d307343388888..c370b9cd58c2e 100644
>> --- a/Documentation/devicetree/bindings/phy/qcom,sc7180-qmp-usb3-dp-phy.yaml
>> +++ b/Documentation/devicetree/bindings/phy/qcom,sc7180-qmp-usb3-dp-phy.yaml
>> @@ -65,6 +65,25 @@ properties:
>> description: Flag the port as possible handler of orientation switching
>> type: boolean
>>
>> + ports:
>> + $ref: /schemas/graph.yaml#/properties/ports
>> + description: OF graph bindings that model incoming orientation-switch and
>> + outgoing orientation-switch messages. An example of an incoming
>> + orientation-switch message might come form a Type-C connector or a USB
>> + redriver. An example of an output would be a DisplayPort controller.
>
> Orientation switching is just one of the uses of this graph, and each
> port is both input and output of different signals (orientation switch,
> altmode switch, hot plug signals, signal path).
>
>
> How about aligning this version of the QMP binding with the proposed
> binding for 8280xp here:
> https://lore.kernel.org/linux-arm-msm/20230515032743.400170-2-quic_bjorande@quicinc.com/
>
> Perhaps we could put some of this in a separate yaml and include that?
We are slowly moving towards removal of sc7180-qmp-usb3-dp-phy.yaml.
Once that is done, this extra include file becomes included from a
single source. So I'd suggest putting necessary properties into the main
schema even if that looks like duplication.
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 20+ messages in thread
end of thread, other threads:[~2023-07-18 6:09 UTC | newest]
Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-15 13:36 [PATCH v8 00/11] Add Qualcomm PMIC TPCM support Bryan O'Donoghue
2023-05-15 13:36 ` [PATCH v8 01/11] dt-bindings: regulator: qcom,usb-vbus-regulator: Mark reg as required Bryan O'Donoghue
2023-05-15 13:36 ` [PATCH v8 02/11] dt-bindings: regulator: qcom,usb-vbus-regulator: Mark regulator-*-microamp required Bryan O'Donoghue
2023-05-15 13:36 ` [PATCH v8 03/11] dt-bindings: phy: qcom,sc7180-qmp-usb3-dp-phy: Add orientation-switch as optional Bryan O'Donoghue
2023-05-15 13:36 ` [PATCH v8 04/11] dt-bindings: phy: qcom,sc7180-qmp-usb3-dp-phy: Add input and output ports Bryan O'Donoghue
2023-05-15 19:59 ` Bjorn Andersson
2023-05-16 10:15 ` Bryan O'Donoghue
2023-07-18 6:09 ` Dmitry Baryshkov
2023-05-15 13:36 ` [PATCH v8 05/11] dt-bindings: mfd: qcom,spmi-pmic: Add typec to SPMI device types Bryan O'Donoghue
2023-05-15 13:36 ` [PATCH v8 06/11] arm64: dts: qcom: sm8250: Define ports for qmpphy orientation-switching Bryan O'Donoghue
2023-05-15 13:36 ` [PATCH v8 07/11] arm64: dts: qcom: pm8150b: Add a TCPM description Bryan O'Donoghue
2023-05-18 10:01 ` Konrad Dybcio
2023-05-15 13:36 ` [PATCH v8 08/11] arm64: dts: qcom: qrb5165-rb5: Switch on Type-C VBUS boost Bryan O'Donoghue
2023-07-09 0:17 ` Dmitry Baryshkov
2023-05-15 13:36 ` [PATCH v8 09/11] arm64: dts: qcom: qrb5165-rb5: Switch on basic TCPM Bryan O'Donoghue
2023-05-15 13:36 ` [PATCH v8 10/11] arm64: dts: qcom: qrb5165-rb5: Switch on TCPM usb-role-switching for usb_1 Bryan O'Donoghue
2023-07-08 23:48 ` Dmitry Baryshkov
2023-05-15 13:36 ` [PATCH v8 11/11] arm64: dts: qcom: qrb5165-rb5: Switch on TCPM orientation-switch for usb_1_qmpphy Bryan O'Donoghue
2023-07-08 23:48 ` Dmitry Baryshkov
2023-07-08 23:49 ` [PATCH v8 00/11] Add Qualcomm PMIC TPCM support Dmitry Baryshkov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).