2024-01-30 19:34:58

by Dmitry Baryshkov

[permalink] [raw]
Subject: [PATCH v3 0/6] usb: typec: qcom-pmic-typec: enable support for PMI632 PMIC

The Qualcomm PMI632 PMIC (found on Qualcomm Robotics RB2 platform)
doesn't support USB Power Delivery. However this PMIC still supports
handling of the Type-C port (orientation detection, etc). Reuse exiting
qcom-pmic-typec driver to support Type-C related functionality of this
PMIC. Use this to enable USB-C connector support on the RB2 platform.

Signed-off-by: Dmitry Baryshkov <[email protected]>
---
Changes in v3:
- Added constraints to qcom,pmic-typec / reg property (Krzysztof)
- Dropped merged TCPM and Qualcomm PHY patches
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- Split qcom_pmic_typec_pdphy_set_roles() changes to separate patch
(Konrad)
- Simplified devm_kzalloc / sizeof() argument (Konrad)
- Made start / stop callbacks mandatory (Bryan)
- Reworked Type-C port handling into a backend similar to PD PHY (Bryan)
- Made more qcom-pmic-typec data static const (Bryan)
- Squashed usbc PHY single-lane removal patch (Konrad)
- Further usbc PHY cleanup (Konrad)
- Fixed order of DT properties in pmi632.dtsi (Konrad)
- Instead of specifying bogus PDOs for the port, specify pd-disable and
typec-power-opmode properties for the connector
- Moved orientation-switch / usb-dual-role properties to sm6115.dtsi
(Konrad)
- Linked usb_dwc3_ss and usb_qmpphy_usb_ss_in
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Dmitry Baryshkov (5):
dt-bindings: regulator: qcom,usb-vbus-regulator: add support for PMI632
dt-bindings: usb: qcom,pmic-typec: add support for the PMI632 block
usb: typec: qcom-pmic-typec: add support for PMI632 PMIC
arm64: dts: qcom: pmi632: define USB-C related blocks
arm64: dts: qcom: qrb4210-rb2: enable USB-C port handling

Vladimir Zapolskiy (1):
arm64: dts: qcom: sm6115: drop pipe clock selection

.../regulator/qcom,usb-vbus-regulator.yaml | 9 ++-
.../devicetree/bindings/usb/qcom,pmic-typec.yaml | 32 ++++++++-
arch/arm64/boot/dts/qcom/pmi632.dtsi | 30 ++++++++
arch/arm64/boot/dts/qcom/qrb4210-rb2.dts | 50 +++++++++++++-
arch/arm64/boot/dts/qcom/sm6115.dtsi | 44 +++++++++++-
drivers/usb/typec/tcpm/qcom/Makefile | 3 +-
drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c | 30 ++++++--
.../usb/typec/tcpm/qcom/qcom_pmic_typec_pdphy.h | 2 +
.../typec/tcpm/qcom/qcom_pmic_typec_pdphy_stub.c | 80 ++++++++++++++++++++++
9 files changed, 266 insertions(+), 14 deletions(-)
---
base-commit: 41d66f96d0f15a0a2ad6fa2208f6bac1a66cbd52
change-id: 20240112-pmi632-typec-4c7533092387

Best regards,
--
Dmitry Baryshkov <[email protected]>



2024-01-30 19:35:16

by Dmitry Baryshkov

[permalink] [raw]
Subject: [PATCH v3 3/6] usb: typec: qcom-pmic-typec: add support for PMI632 PMIC

The PMI632 PMIC support Type-C port handling, but lacks USB
PowerDelivery support. The TCPM requires all callbacks to be provided
by the implementation. Implement a special, 'stub' Qcom PD PHY
implementation to enable the PMI632 support.

Acked-by: Bryan O'Donoghue <[email protected]>
Acked-by: Heikki Krogerus <[email protected]>
Tested-by: Luca Weiss <[email protected]> # sdm632-fairphone-fp3
Signed-off-by: Dmitry Baryshkov <[email protected]>
---
drivers/usb/typec/tcpm/qcom/Makefile | 3 +-
drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c | 30 ++++++--
.../usb/typec/tcpm/qcom/qcom_pmic_typec_pdphy.h | 2 +
.../typec/tcpm/qcom/qcom_pmic_typec_pdphy_stub.c | 80 ++++++++++++++++++++++
4 files changed, 107 insertions(+), 8 deletions(-)

diff --git a/drivers/usb/typec/tcpm/qcom/Makefile b/drivers/usb/typec/tcpm/qcom/Makefile
index dc1e8832e197..cc23042b9487 100644
--- a/drivers/usb/typec/tcpm/qcom/Makefile
+++ b/drivers/usb/typec/tcpm/qcom/Makefile
@@ -3,4 +3,5 @@
obj-$(CONFIG_TYPEC_QCOM_PMIC) += qcom_pmic_tcpm.o
qcom_pmic_tcpm-y += qcom_pmic_typec.o \
qcom_pmic_typec_port.o \
- qcom_pmic_typec_pdphy.o
+ qcom_pmic_typec_pdphy.o \
+ qcom_pmic_typec_pdphy_stub.o \
diff --git a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c
index 82e3f59ea471..e48412cdcb0f 100644
--- a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c
+++ b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c
@@ -42,7 +42,7 @@ static int qcom_pmic_typec_probe(struct platform_device *pdev)
const struct pmic_typec_resources *res;
struct regmap *regmap;
struct device *bridge_dev;
- u32 base[2];
+ u32 base;
int ret;

res = of_device_get_match_data(dev);
@@ -62,19 +62,29 @@ static int qcom_pmic_typec_probe(struct platform_device *pdev)
return -ENODEV;
}

- ret = of_property_read_u32_array(np, "reg", base, 2);
+ ret = of_property_read_u32_index(np, "reg", 0, &base);
if (ret)
return ret;

ret = qcom_pmic_typec_port_probe(pdev, tcpm,
- res->port_res, regmap, base[0]);
+ res->port_res, regmap, base);
if (ret)
return ret;

- ret = qcom_pmic_typec_pdphy_probe(pdev, tcpm,
- res->pdphy_res, regmap, base[1]);
- if (ret)
- return ret;
+ if (res->pdphy_res) {
+ ret = of_property_read_u32_index(np, "reg", 1, &base);
+ if (ret)
+ return ret;
+
+ ret = qcom_pmic_typec_pdphy_probe(pdev, tcpm,
+ res->pdphy_res, regmap, base);
+ if (ret)
+ return ret;
+ } else {
+ ret = qcom_pmic_typec_pdphy_stub_probe(pdev, tcpm);
+ if (ret)
+ return ret;
+ }

platform_set_drvdata(pdev, tcpm);

@@ -123,8 +133,14 @@ static const struct pmic_typec_resources pm8150b_typec_res = {
.port_res = &pm8150b_port_res,
};

+static const struct pmic_typec_resources pmi632_typec_res = {
+ /* PD PHY not present */
+ .port_res = &pm8150b_port_res,
+};
+
static const struct of_device_id qcom_pmic_typec_table[] = {
{ .compatible = "qcom,pm8150b-typec", .data = &pm8150b_typec_res },
+ { .compatible = "qcom,pmi632-typec", .data = &pmi632_typec_res },
{ }
};
MODULE_DEVICE_TABLE(of, qcom_pmic_typec_table);
diff --git a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_pdphy.h b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_pdphy.h
index 5f428e67ccfe..04dee20293cf 100644
--- a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_pdphy.h
+++ b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_pdphy.h
@@ -31,5 +31,7 @@ int qcom_pmic_typec_pdphy_probe(struct platform_device *pdev,
const struct pmic_typec_pdphy_resources *res,
struct regmap *regmap,
u32 base);
+int qcom_pmic_typec_pdphy_stub_probe(struct platform_device *pdev,
+ struct pmic_typec *tcpm);

#endif /* __QCOM_PMIC_TYPEC_PDPHY_H__ */
diff --git a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_pdphy_stub.c b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_pdphy_stub.c
new file mode 100644
index 000000000000..df79059cda67
--- /dev/null
+++ b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_pdphy_stub.c
@@ -0,0 +1,80 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2024, Linaro Ltd. All rights reserved.
+ */
+
+#include <linux/err.h>
+#include <linux/interrupt.h>
+#include <linux/kernel.h>
+#include <linux/mod_devicetable.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/regmap.h>
+#include <linux/regulator/consumer.h>
+#include <linux/slab.h>
+#include <linux/usb/pd.h>
+#include <linux/usb/tcpm.h>
+#include "qcom_pmic_typec.h"
+#include "qcom_pmic_typec_pdphy.h"
+
+static int qcom_pmic_typec_pdphy_stub_pd_transmit(struct tcpc_dev *tcpc,
+ enum tcpm_transmit_type type,
+ const struct pd_message *msg,
+ unsigned int negotiated_rev)
+{
+ struct pmic_typec *tcpm = tcpc_to_tcpm(tcpc);
+ struct device *dev = tcpm->dev;
+
+ dev_dbg(dev, "pdphy_transmit: type=%d\n", type);
+
+ tcpm_pd_transmit_complete(tcpm->tcpm_port,
+ TCPC_TX_SUCCESS);
+
+ return 0;
+}
+
+static int qcom_pmic_typec_pdphy_stub_set_pd_rx(struct tcpc_dev *tcpc, bool on)
+{
+ struct pmic_typec *tcpm = tcpc_to_tcpm(tcpc);
+ struct device *dev = tcpm->dev;
+
+ dev_dbg(dev, "set_pd_rx: %s\n", on ? "on" : "off");
+
+ return 0;
+}
+
+static int qcom_pmic_typec_pdphy_stub_set_roles(struct tcpc_dev *tcpc, bool attached,
+ enum typec_role power_role,
+ enum typec_data_role data_role)
+{
+ struct pmic_typec *tcpm = tcpc_to_tcpm(tcpc);
+ struct device *dev = tcpm->dev;
+
+ dev_dbg(dev, "pdphy_set_roles: data_role_host=%d power_role_src=%d\n",
+ data_role, power_role);
+
+ return 0;
+}
+
+static int qcom_pmic_typec_pdphy_stub_start(struct pmic_typec *tcpm,
+ struct tcpm_port *tcpm_port)
+{
+ return 0;
+}
+
+static void qcom_pmic_typec_pdphy_stub_stop(struct pmic_typec *tcpm)
+{
+}
+
+int qcom_pmic_typec_pdphy_stub_probe(struct platform_device *pdev,
+ struct pmic_typec *tcpm)
+{
+ tcpm->tcpc.set_pd_rx = qcom_pmic_typec_pdphy_stub_set_pd_rx;
+ tcpm->tcpc.set_roles = qcom_pmic_typec_pdphy_stub_set_roles;
+ tcpm->tcpc.pd_transmit = qcom_pmic_typec_pdphy_stub_pd_transmit;
+
+ tcpm->pdphy_start = qcom_pmic_typec_pdphy_stub_start;
+ tcpm->pdphy_stop = qcom_pmic_typec_pdphy_stub_stop;
+
+ return 0;
+}

--
2.39.2


2024-01-30 19:35:19

by Dmitry Baryshkov

[permalink] [raw]
Subject: [PATCH v3 6/6] arm64: dts: qcom: qrb4210-rb2: enable USB-C port handling

Plug in USB-C related bits and pieces to enable USB role switching and
USB-C orientation handling for the Qualcomm RB2 board.

Tested-by: Luca Weiss <[email protected]> # sdm632-fairphone-fp3
Signed-off-by: Dmitry Baryshkov <[email protected]>
---
arch/arm64/boot/dts/qcom/qrb4210-rb2.dts | 50 ++++++++++++++++++++++++++++++++
arch/arm64/boot/dts/qcom/sm6115.dtsi | 43 +++++++++++++++++++++++++++
2 files changed, 93 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts b/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts
index 52f31f3166c2..696d6d43c56b 100644
--- a/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts
+++ b/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts
@@ -6,8 +6,10 @@
/dts-v1/;

#include <dt-bindings/leds/common.h>
+#include <dt-bindings/usb/pd.h>
#include "sm4250.dtsi"
#include "pm6125.dtsi"
+#include "pmi632.dtsi"

/ {
model = "Qualcomm Technologies, Inc. QRB4210 RB2";
@@ -256,6 +258,46 @@ kypd_vol_up_n: kypd-vol-up-n-state {
};
};

+&pmi632_typec {
+ status = "okay";
+
+ connector {
+ compatible = "usb-c-connector";
+
+ power-role = "dual";
+ data-role = "dual";
+ self-powered;
+
+ typec-power-opmode = "default";
+ pd-disable;
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+ pmi632_hs_in: endpoint {
+ remote-endpoint = <&usb_dwc3_hs>;
+ };
+ };
+
+ port@1 {
+ reg = <1>;
+ pmi632_ss_in: endpoint {
+ remote-endpoint = <&usb_qmpphy_out>;
+ };
+ };
+ };
+ };
+};
+
+&pmi632_vbus {
+ regulator-min-microamp = <500000>;
+ regulator-max-microamp = <3000000>;
+ status = "okay";
+};
+
&pon_pwrkey {
status = "okay";
};
@@ -607,6 +649,10 @@ &usb {
status = "okay";
};

+&usb_dwc3_hs {
+ remote-endpoint = <&pmi632_hs_in>;
+};
+
&usb_hsphy {
vdd-supply = <&vreg_l4a_0p9>;
vdda-pll-supply = <&vreg_l12a_1p8>;
@@ -622,6 +668,10 @@ &usb_qmpphy {
status = "okay";
};

+&usb_qmpphy_out {
+ remote-endpoint = <&pmi632_ss_in>;
+};
+
&wifi {
vdd-0.8-cx-mx-supply = <&vreg_l8a_0p664>;
vdd-1.8-xo-supply = <&vreg_l16a_1p3>;
diff --git a/arch/arm64/boot/dts/qcom/sm6115.dtsi b/arch/arm64/boot/dts/qcom/sm6115.dtsi
index e151b874eaf3..dd3d97ef5cc7 100644
--- a/arch/arm64/boot/dts/qcom/sm6115.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm6115.dtsi
@@ -879,8 +879,29 @@ usb_qmpphy: phy@1615000 {
clock-output-names = "usb3_phy_pipe_clk_src";

#phy-cells = <0>;
+ orientation-switch;

status = "disabled";
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+
+ usb_qmpphy_out: endpoint {
+ };
+ };
+
+ port@1 {
+ reg = <1>;
+
+ usb_qmpphy_usb_ss_in: endpoint {
+ remote-endpoint = <&usb_dwc3_ss>;
+ };
+ };
+ };
};

system_noc: interconnect@1880000 {
@@ -1620,6 +1641,28 @@ usb_dwc3: usb@4e00000 {
snps,has-lpm-erratum;
snps,hird-threshold = /bits/ 8 <0x10>;
snps,usb3_lpm_capable;
+
+ usb-role-switch;
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+
+ usb_dwc3_hs: endpoint {
+ };
+ };
+
+ port@1 {
+ reg = <1>;
+
+ usb_dwc3_ss: endpoint {
+ remote-endpoint = <&usb_qmpphy_usb_ss_in>;
+ };
+ };
+ };
};
};


--
2.39.2


2024-01-30 19:35:28

by Dmitry Baryshkov

[permalink] [raw]
Subject: [PATCH v3 4/6] arm64: dts: qcom: pmi632: define USB-C related blocks

Define VBUS regulator and the Type-C handling block as present on the
Quacomm PMI632 PMIC.

Reviewed-by: Bryan O'Donoghue <[email protected]>
Reviewed-by: Konrad Dybcio <[email protected]>
Tested-by: Luca Weiss <[email protected]> # sdm632-fairphone-fp3
Signed-off-by: Dmitry Baryshkov <[email protected]>
---
arch/arm64/boot/dts/qcom/pmi632.dtsi | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/pmi632.dtsi b/arch/arm64/boot/dts/qcom/pmi632.dtsi
index 4eb79e0ce40a..d6832f0b7b80 100644
--- a/arch/arm64/boot/dts/qcom/pmi632.dtsi
+++ b/arch/arm64/boot/dts/qcom/pmi632.dtsi
@@ -45,6 +45,36 @@ pmic@2 {
#address-cells = <1>;
#size-cells = <0>;

+ pmi632_vbus: usb-vbus-regulator@1100 {
+ compatible = "qcom,pmi632-vbus-reg", "qcom,pm8150b-vbus-reg";
+ reg = <0x1100>;
+ status = "disabled";
+ };
+
+ pmi632_typec: typec@1500 {
+ compatible = "qcom,pmi632-typec";
+ reg = <0x1500>;
+ 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>;
+ interrupt-names = "or-rid-detect-change",
+ "vpd-detect",
+ "cc-state-change",
+ "vconn-oc",
+ "vbus-change",
+ "attach-detach",
+ "legacy-cable-detect",
+ "try-snk-src-detect";
+ vdd-vbus-supply = <&pmi632_vbus>;
+
+ status = "disabled";
+ };
+
pmi632_temp: temp-alarm@2400 {
compatible = "qcom,spmi-temp-alarm";
reg = <0x2400>;

--
2.39.2


2024-01-31 07:49:32

by Luca Weiss

[permalink] [raw]
Subject: Re: [PATCH v3 0/6] usb: typec: qcom-pmic-typec: enable support for PMI632 PMIC

On Tue Jan 30, 2024 at 8:32 PM CET, Dmitry Baryshkov wrote:
> The Qualcomm PMI632 PMIC (found on Qualcomm Robotics RB2 platform)
> doesn't support USB Power Delivery. However this PMIC still supports
> handling of the Type-C port (orientation detection, etc). Reuse exiting
> qcom-pmic-typec driver to support Type-C related functionality of this
> PMIC. Use this to enable USB-C connector support on the RB2 platform.

Hi Dmitry,

In case you send a new revision you can drop my Tested-by on the RB2
patches since it's a different platform, and the tag on the dt-bindings
patches also don't make too much sense I think?

Thanks!

Regards
Luca

>
> Signed-off-by: Dmitry Baryshkov <[email protected]>
> ---
> Changes in v3:
> - Added constraints to qcom,pmic-typec / reg property (Krzysztof)
> - Dropped merged TCPM and Qualcomm PHY patches
> - Link to v2: https://lore.kernel.org/r/[email protected]
>
> Changes in v2:
> - Split qcom_pmic_typec_pdphy_set_roles() changes to separate patch
> (Konrad)
> - Simplified devm_kzalloc / sizeof() argument (Konrad)
> - Made start / stop callbacks mandatory (Bryan)
> - Reworked Type-C port handling into a backend similar to PD PHY (Bryan)
> - Made more qcom-pmic-typec data static const (Bryan)
> - Squashed usbc PHY single-lane removal patch (Konrad)
> - Further usbc PHY cleanup (Konrad)
> - Fixed order of DT properties in pmi632.dtsi (Konrad)
> - Instead of specifying bogus PDOs for the port, specify pd-disable and
> typec-power-opmode properties for the connector
> - Moved orientation-switch / usb-dual-role properties to sm6115.dtsi
> (Konrad)
> - Linked usb_dwc3_ss and usb_qmpphy_usb_ss_in
> - Link to v1: https://lore.kernel.org/r/[email protected]
>
> ---
> Dmitry Baryshkov (5):
> dt-bindings: regulator: qcom,usb-vbus-regulator: add support for PMI632
> dt-bindings: usb: qcom,pmic-typec: add support for the PMI632 block
> usb: typec: qcom-pmic-typec: add support for PMI632 PMIC
> arm64: dts: qcom: pmi632: define USB-C related blocks
> arm64: dts: qcom: qrb4210-rb2: enable USB-C port handling
>
> Vladimir Zapolskiy (1):
> arm64: dts: qcom: sm6115: drop pipe clock selection
>
> .../regulator/qcom,usb-vbus-regulator.yaml | 9 ++-
> .../devicetree/bindings/usb/qcom,pmic-typec.yaml | 32 ++++++++-
> arch/arm64/boot/dts/qcom/pmi632.dtsi | 30 ++++++++
> arch/arm64/boot/dts/qcom/qrb4210-rb2.dts | 50 +++++++++++++-
> arch/arm64/boot/dts/qcom/sm6115.dtsi | 44 +++++++++++-
> drivers/usb/typec/tcpm/qcom/Makefile | 3 +-
> drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c | 30 ++++++--
> .../usb/typec/tcpm/qcom/qcom_pmic_typec_pdphy.h | 2 +
> .../typec/tcpm/qcom/qcom_pmic_typec_pdphy_stub.c | 80 ++++++++++++++++++++++
> 9 files changed, 266 insertions(+), 14 deletions(-)
> ---
> base-commit: 41d66f96d0f15a0a2ad6fa2208f6bac1a66cbd52
> change-id: 20240112-pmi632-typec-4c7533092387
>
> Best regards,


2024-01-31 07:50:38

by Dmitry Baryshkov

[permalink] [raw]
Subject: Re: [PATCH v3 0/6] usb: typec: qcom-pmic-typec: enable support for PMI632 PMIC

On Wed, 31 Jan 2024 at 09:49, Luca Weiss <[email protected]> wrote:
>
> On Tue Jan 30, 2024 at 8:32 PM CET, Dmitry Baryshkov wrote:
> > The Qualcomm PMI632 PMIC (found on Qualcomm Robotics RB2 platform)
> > doesn't support USB Power Delivery. However this PMIC still supports
> > handling of the Type-C port (orientation detection, etc). Reuse exiting
> > qcom-pmic-typec driver to support Type-C related functionality of this
> > PMIC. Use this to enable USB-C connector support on the RB2 platform.
>
> Hi Dmitry,
>
> In case you send a new revision you can drop my Tested-by on the RB2
> patches since it's a different platform, and the tag on the dt-bindings
> patches also don't make too much sense I think?

Ack, I will. But I hope there will be no next revision.

>
> Thanks!
>
> Regards
> Luca
>
> >
> > Signed-off-by: Dmitry Baryshkov <[email protected]>
> > ---
> > Changes in v3:
> > - Added constraints to qcom,pmic-typec / reg property (Krzysztof)
> > - Dropped merged TCPM and Qualcomm PHY patches
> > - Link to v2: https://lore.kernel.org/r/[email protected]
> >
> > Changes in v2:
> > - Split qcom_pmic_typec_pdphy_set_roles() changes to separate patch
> > (Konrad)
> > - Simplified devm_kzalloc / sizeof() argument (Konrad)
> > - Made start / stop callbacks mandatory (Bryan)
> > - Reworked Type-C port handling into a backend similar to PD PHY (Bryan)
> > - Made more qcom-pmic-typec data static const (Bryan)
> > - Squashed usbc PHY single-lane removal patch (Konrad)
> > - Further usbc PHY cleanup (Konrad)
> > - Fixed order of DT properties in pmi632.dtsi (Konrad)
> > - Instead of specifying bogus PDOs for the port, specify pd-disable and
> > typec-power-opmode properties for the connector
> > - Moved orientation-switch / usb-dual-role properties to sm6115.dtsi
> > (Konrad)
> > - Linked usb_dwc3_ss and usb_qmpphy_usb_ss_in
> > - Link to v1: https://lore.kernel.org/r/[email protected]
> >
> > ---
> > Dmitry Baryshkov (5):
> > dt-bindings: regulator: qcom,usb-vbus-regulator: add support for PMI632
> > dt-bindings: usb: qcom,pmic-typec: add support for the PMI632 block
> > usb: typec: qcom-pmic-typec: add support for PMI632 PMIC
> > arm64: dts: qcom: pmi632: define USB-C related blocks
> > arm64: dts: qcom: qrb4210-rb2: enable USB-C port handling
> >
> > Vladimir Zapolskiy (1):
> > arm64: dts: qcom: sm6115: drop pipe clock selection
> >
> > .../regulator/qcom,usb-vbus-regulator.yaml | 9 ++-
> > .../devicetree/bindings/usb/qcom,pmic-typec.yaml | 32 ++++++++-
> > arch/arm64/boot/dts/qcom/pmi632.dtsi | 30 ++++++++
> > arch/arm64/boot/dts/qcom/qrb4210-rb2.dts | 50 +++++++++++++-
> > arch/arm64/boot/dts/qcom/sm6115.dtsi | 44 +++++++++++-
> > drivers/usb/typec/tcpm/qcom/Makefile | 3 +-
> > drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c | 30 ++++++--
> > .../usb/typec/tcpm/qcom/qcom_pmic_typec_pdphy.h | 2 +
> > .../typec/tcpm/qcom/qcom_pmic_typec_pdphy_stub.c | 80 ++++++++++++++++++++++
> > 9 files changed, 266 insertions(+), 14 deletions(-)
> > ---
> > base-commit: 41d66f96d0f15a0a2ad6fa2208f6bac1a66cbd52
> > change-id: 20240112-pmi632-typec-4c7533092387
> >
> > Best regards,
>


--
With best wishes
Dmitry

2024-02-07 09:55:20

by Dmitry Baryshkov

[permalink] [raw]
Subject: Re: [PATCH v3 3/6] usb: typec: qcom-pmic-typec: add support for PMI632 PMIC

On Tue, 30 Jan 2024 at 21:33, Dmitry Baryshkov
<[email protected]> wrote:
>
> The PMI632 PMIC support Type-C port handling, but lacks USB
> PowerDelivery support. The TCPM requires all callbacks to be provided
> by the implementation. Implement a special, 'stub' Qcom PD PHY
> implementation to enable the PMI632 support.
>
> Acked-by: Bryan O'Donoghue <[email protected]>
> Acked-by: Heikki Krogerus <[email protected]>
> Tested-by: Luca Weiss <[email protected]> # sdm632-fairphone-fp3
> Signed-off-by: Dmitry Baryshkov <[email protected]>

Heikki, Gunter, Gret, is there anything left on my side to get these patches in?

> ---
> drivers/usb/typec/tcpm/qcom/Makefile | 3 +-
> drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c | 30 ++++++--
> .../usb/typec/tcpm/qcom/qcom_pmic_typec_pdphy.h | 2 +
> .../typec/tcpm/qcom/qcom_pmic_typec_pdphy_stub.c | 80 ++++++++++++++++++++++
> 4 files changed, 107 insertions(+), 8 deletions(-)

--
With best wishes
Dmitry

2024-02-08 13:09:48

by Dmitry Baryshkov

[permalink] [raw]
Subject: Re: [PATCH v3 3/6] usb: typec: qcom-pmic-typec: add support for PMI632 PMIC

On Thu, 8 Feb 2024 at 13:54, Heikki Krogerus
<[email protected]> wrote:
>
> On Wed, Feb 07, 2024 at 11:54:50AM +0200, Dmitry Baryshkov wrote:
> > On Tue, 30 Jan 2024 at 21:33, Dmitry Baryshkov
> > <[email protected]> wrote:
> > >
> > > The PMI632 PMIC support Type-C port handling, but lacks USB
> > > PowerDelivery support. The TCPM requires all callbacks to be provided
> > > by the implementation. Implement a special, 'stub' Qcom PD PHY
> > > implementation to enable the PMI632 support.
> > >
> > > Acked-by: Bryan O'Donoghue <[email protected]>
> > > Acked-by: Heikki Krogerus <[email protected]>
> > > Tested-by: Luca Weiss <[email protected]> # sdm632-fairphone-fp3
> > > Signed-off-by: Dmitry Baryshkov <[email protected]>
> >
> > Heikki, Gunter, Gret, is there anything left on my side to get these patches in?
>
> Nothing from me. Do you want Greg to pick these?

Yes, please.

--
With best wishes
Dmitry

2024-02-08 16:43:53

by Heikki Krogerus

[permalink] [raw]
Subject: Re: [PATCH v3 3/6] usb: typec: qcom-pmic-typec: add support for PMI632 PMIC

On Wed, Feb 07, 2024 at 11:54:50AM +0200, Dmitry Baryshkov wrote:
> On Tue, 30 Jan 2024 at 21:33, Dmitry Baryshkov
> <[email protected]> wrote:
> >
> > The PMI632 PMIC support Type-C port handling, but lacks USB
> > PowerDelivery support. The TCPM requires all callbacks to be provided
> > by the implementation. Implement a special, 'stub' Qcom PD PHY
> > implementation to enable the PMI632 support.
> >
> > Acked-by: Bryan O'Donoghue <[email protected]>
> > Acked-by: Heikki Krogerus <[email protected]>
> > Tested-by: Luca Weiss <[email protected]> # sdm632-fairphone-fp3
> > Signed-off-by: Dmitry Baryshkov <[email protected]>
>
> Heikki, Gunter, Gret, is there anything left on my side to get these patches in?

Nothing from me. Do you want Greg to pick these?

thanks,

--
heikki

2024-02-09 21:25:49

by Konrad Dybcio

[permalink] [raw]
Subject: Re: [PATCH v3 6/6] arm64: dts: qcom: qrb4210-rb2: enable USB-C port handling

On 30.01.2024 20:32, Dmitry Baryshkov wrote:
> Plug in USB-C related bits and pieces to enable USB role switching and
> USB-C orientation handling for the Qualcomm RB2 board.
>
> Tested-by: Luca Weiss <[email protected]> # sdm632-fairphone-fp3
> Signed-off-by: Dmitry Baryshkov <[email protected]>
> ---

Reviewed-by: Konrad Dybcio <[email protected]>

Konrad

2024-02-09 23:25:58

by Bjorn Andersson

[permalink] [raw]
Subject: Re: (subset) [PATCH v3 0/6] usb: typec: qcom-pmic-typec: enable support for PMI632 PMIC


On Tue, 30 Jan 2024 21:32:53 +0200, Dmitry Baryshkov wrote:
> The Qualcomm PMI632 PMIC (found on Qualcomm Robotics RB2 platform)
> doesn't support USB Power Delivery. However this PMIC still supports
> handling of the Type-C port (orientation detection, etc). Reuse exiting
> qcom-pmic-typec driver to support Type-C related functionality of this
> PMIC. Use this to enable USB-C connector support on the RB2 platform.
>
>
> [...]

Applied, thanks!

[4/6] arm64: dts: qcom: pmi632: define USB-C related blocks
commit: f69b3e40f46e8cf568809eb05a2e07bfea45b672
[5/6] arm64: dts: qcom: sm6115: drop pipe clock selection
commit: 7e3a1f6470f7243c81156d2ead60f87da1184225
[6/6] arm64: dts: qcom: qrb4210-rb2: enable USB-C port handling
commit: a06a2f12f9e2fa9628a942efd916cf388b19c6ce

Best regards,
--
Bjorn Andersson <[email protected]>