devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/6] phy: qcom: qmp-usbc: properly handle the clamping register
@ 2024-01-17 14:04 Dmitry Baryshkov
  2024-01-17 14:04 ` [PATCH v2 1/6] dt-bindings: mfd: qcom,tcsr: Add compatibles for QCM2290 and SM6115 Dmitry Baryshkov
                   ` (7 more replies)
  0 siblings, 8 replies; 15+ messages in thread
From: Dmitry Baryshkov @ 2024-01-17 14:04 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Lee Jones, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Vinod Koul,
	Kishon Vijay Abraham I, Jeffrey Hugo
  Cc: linux-arm-msm, devicetree, linux-phy, Krzysztof Kozlowski

The USB-C PHY on the MSM8998, QCM2290, SM6115 and several other platforms
doesn't have built-in PCS_MISC_CLAMP_ENABLE register. Instead clamping
is handled separately via the register in the TCSR space. Make the new
phy-qcom-qmp-usbc driver correctly handle the clamp register.

For backwards compatibility the driver treats these registers as
optional. They are only required for the PHY suspend/resume. However the
schema declares corresponding property as required, it should be present
on all relevant platforms.

At this point I'm not sure whether having a single TCSR-based register
will be enough or whether we will have to add more TCSR registers in
future. In order to avoid repeating TCSR handle (and having multiple
instances of TCSR regmap in the driver) use qcom,tcsr-reg property
rather than someting more exact like qcom,vls-clamp-reg.

Dependecies: PHY-related changes of [1]

Note for the backporters: if the patch is packported to the kernel
before the phy-qocm-qmp-usbc split, the phy-qcom-qmp-usb driver needs to
handle both PCS_MISC_CLAMP_ENABLE and VLS_CLAMP registers as optional.

[1] https://lore.kernel.org/linux-arm-msm/20240113-pmi632-typec-v2-0-182d9aa0a5b3@linaro.org/

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
Changes in v2:
- Fixed the TCSR region definitions (Konrad, Bjorn)
- Link to v1: https://lore.kernel.org/r/20240116-usbc-phy-vls-clamp-v1-0-73b2da7691c5@linaro.org

---
Dmitry Baryshkov (6):
      dt-bindings: mfd: qcom,tcsr: Add compatibles for QCM2290 and SM6115
      dt-bindings: phy: qcom,msm8998-qmp-usb3-phy: add TCSR registers
      phy: qcom: qmp-usbc: handle CLAMP register in a correct way
      arm64: dts: qcom: msm8998: declare VLS CLAMP register for USB3 PHY
      arm64: dts: qcom: qcm2290: declare VLS CLAMP register for USB3 PHY
      arm64: dts: qcom: sm6115: declare VLS CLAMP register for USB3 PHY

 .../devicetree/bindings/mfd/qcom,tcsr.yaml         |  2 +
 .../bindings/phy/qcom,msm8998-qmp-usb3-phy.yaml    | 11 +++++
 arch/arm64/boot/dts/qcom/msm8998.dtsi              |  7 ++++
 arch/arm64/boot/dts/qcom/qcm2290.dtsi              |  7 ++++
 arch/arm64/boot/dts/qcom/sm6115.dtsi               |  7 ++++
 drivers/phy/qualcomm/phy-qcom-qmp-usbc.c           | 48 +++++++++++++++++-----
 6 files changed, 71 insertions(+), 11 deletions(-)
---
base-commit: 3cbd23fa6ef85801574a4b0d3f81fb365e06b2d2
change-id: 20240116-usbc-phy-vls-clamp-10189efdcf12

Best regards,
-- 
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>


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

* [PATCH v2 1/6] dt-bindings: mfd: qcom,tcsr: Add compatibles for QCM2290 and SM6115
  2024-01-17 14:04 [PATCH v2 0/6] phy: qcom: qmp-usbc: properly handle the clamping register Dmitry Baryshkov
@ 2024-01-17 14:04 ` Dmitry Baryshkov
  2024-01-17 14:04 ` [PATCH v2 2/6] dt-bindings: phy: qcom,msm8998-qmp-usb3-phy: add TCSR registers Dmitry Baryshkov
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 15+ messages in thread
From: Dmitry Baryshkov @ 2024-01-17 14:04 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Lee Jones, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Vinod Koul,
	Kishon Vijay Abraham I, Jeffrey Hugo
  Cc: linux-arm-msm, devicetree, linux-phy, Krzysztof Kozlowski

Add qcom,qcm2290-tcsr and qcom,sm6115-tcsr, compatibles for TCSR blocks
on the corresponding platforms.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 Documentation/devicetree/bindings/mfd/qcom,tcsr.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/mfd/qcom,tcsr.yaml b/Documentation/devicetree/bindings/mfd/qcom,tcsr.yaml
index 798705ab6a46..b97d77015335 100644
--- a/Documentation/devicetree/bindings/mfd/qcom,tcsr.yaml
+++ b/Documentation/devicetree/bindings/mfd/qcom,tcsr.yaml
@@ -19,6 +19,7 @@ properties:
       - enum:
           - qcom,msm8976-tcsr
           - qcom,msm8998-tcsr
+          - qcom,qcm2290-tcsr
           - qcom,qcs404-tcsr
           - qcom,sc7180-tcsr
           - qcom,sc7280-tcsr
@@ -28,6 +29,7 @@ properties:
           - qcom,sdx55-tcsr
           - qcom,sdx65-tcsr
           - qcom,sm4450-tcsr
+          - qcom,sm6115-tcsr
           - qcom,sm8150-tcsr
           - qcom,sm8250-tcsr
           - qcom,sm8350-tcsr

-- 
2.39.2


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

* [PATCH v2 2/6] dt-bindings: phy: qcom,msm8998-qmp-usb3-phy: add TCSR registers
  2024-01-17 14:04 [PATCH v2 0/6] phy: qcom: qmp-usbc: properly handle the clamping register Dmitry Baryshkov
  2024-01-17 14:04 ` [PATCH v2 1/6] dt-bindings: mfd: qcom,tcsr: Add compatibles for QCM2290 and SM6115 Dmitry Baryshkov
@ 2024-01-17 14:04 ` Dmitry Baryshkov
  2024-01-17 14:04 ` [PATCH v2 3/6] phy: qcom: qmp-usbc: handle CLAMP register in a correct way Dmitry Baryshkov
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 15+ messages in thread
From: Dmitry Baryshkov @ 2024-01-17 14:04 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Lee Jones, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Vinod Koul,
	Kishon Vijay Abraham I, Jeffrey Hugo
  Cc: linux-arm-msm, devicetree, linux-phy, Krzysztof Kozlowski

The QMP USB PHYs on msm8998, qcm2290 and some other platforms don't have
the PCS_MISC_CLAMP_ENABLE register. Instead they need to toggle the
register in the TCSR space. Declare the registers accessible through the
TCSR space.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 .../devicetree/bindings/phy/qcom,msm8998-qmp-usb3-phy.yaml    | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/Documentation/devicetree/bindings/phy/qcom,msm8998-qmp-usb3-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,msm8998-qmp-usb3-phy.yaml
index da5d4cbca24c..140843347d1e 100644
--- a/Documentation/devicetree/bindings/phy/qcom,msm8998-qmp-usb3-phy.yaml
+++ b/Documentation/devicetree/bindings/phy/qcom,msm8998-qmp-usb3-phy.yaml
@@ -55,6 +55,14 @@ properties:
       Flag the PHY as possible handler of USB Type-C orientation switching
     type: boolean
 
+  qcom,tcsr-reg:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+    items:
+      - items:
+          - description: phandle to TCSR hardware block
+          - description: offset of the VLS CLAMP register
+    description: Clamp register present in the TCSR
+
   ports:
     $ref: /schemas/graph.yaml#/properties/ports
     properties:
@@ -78,6 +86,7 @@ required:
   - "#clock-cells"
   - clock-output-names
   - "#phy-cells"
+  - qcom,tcsr-reg
 
 allOf:
   - if:
@@ -148,6 +157,8 @@ examples:
 
       orientation-switch;
 
+      qcom,tcsr-reg = <&tcsr_regs_1 0x6b244>;
+
       ports {
         #address-cells = <1>;
         #size-cells = <0>;

-- 
2.39.2


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

* [PATCH v2 3/6] phy: qcom: qmp-usbc: handle CLAMP register in a correct way
  2024-01-17 14:04 [PATCH v2 0/6] phy: qcom: qmp-usbc: properly handle the clamping register Dmitry Baryshkov
  2024-01-17 14:04 ` [PATCH v2 1/6] dt-bindings: mfd: qcom,tcsr: Add compatibles for QCM2290 and SM6115 Dmitry Baryshkov
  2024-01-17 14:04 ` [PATCH v2 2/6] dt-bindings: phy: qcom,msm8998-qmp-usb3-phy: add TCSR registers Dmitry Baryshkov
@ 2024-01-17 14:04 ` Dmitry Baryshkov
  2024-01-18 11:23   ` Konrad Dybcio
  2024-01-26 17:30   ` Jeffrey Hugo
  2024-01-17 14:04 ` [PATCH v2 4/6] arm64: dts: qcom: msm8998: declare VLS CLAMP register for USB3 PHY Dmitry Baryshkov
                   ` (4 subsequent siblings)
  7 siblings, 2 replies; 15+ messages in thread
From: Dmitry Baryshkov @ 2024-01-17 14:04 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Lee Jones, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Vinod Koul,
	Kishon Vijay Abraham I, Jeffrey Hugo
  Cc: linux-arm-msm, devicetree, linux-phy

The QMP USB PHYs on msm8998, qcm2290 and some other platforms don't have
the PCS_MISC_CLAMP_ENABLE register. Instead they need to toggle the
register in the TCSR space. Make the new phy-qcom-qmp-usbc driver
correctly handle the clamp register.

Fixes: a51969fafc82 ("phy: qcom-qmp: Add QMP V3 USB3 PHY support for msm8998")
Fixes: 8abe5e778b2c ("phy: qcom-qmp: Add QCM2290 USB3 PHY support")
Cc: Jeffrey Hugo <quic_jhugo@quicinc.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/phy/qualcomm/phy-qcom-qmp-usbc.c | 48 ++++++++++++++++++++++++--------
 1 file changed, 37 insertions(+), 11 deletions(-)

diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-usbc.c b/drivers/phy/qualcomm/phy-qcom-qmp-usbc.c
index 214cf4203de4..3a4b4849db0f 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp-usbc.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp-usbc.c
@@ -10,11 +10,13 @@
 #include <linux/io.h>
 #include <linux/iopoll.h>
 #include <linux/kernel.h>
+#include <linux/mfd/syscon.h>
 #include <linux/module.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/phy/phy.h>
 #include <linux/platform_device.h>
+#include <linux/regmap.h>
 #include <linux/regulator/consumer.h>
 #include <linux/reset.h>
 #include <linux/slab.h>
@@ -56,9 +58,6 @@
 /* QPHY_PCS_LFPS_RXTERM_IRQ_CLEAR register bits */
 #define IRQ_CLEAR				BIT(0)
 
-/* QPHY_V3_PCS_MISC_CLAMP_ENABLE register bits */
-#define CLAMP_EN				BIT(0) /* enables i/o clamp_n */
-
 #define PHY_INIT_COMPLETE_TIMEOUT		10000
 
 struct qmp_phy_init_tbl {
@@ -94,7 +93,6 @@ enum qphy_reg_layout {
 	QPHY_PCS_AUTONOMOUS_MODE_CTRL,
 	QPHY_PCS_LFPS_RXTERM_IRQ_CLEAR,
 	QPHY_PCS_POWER_DOWN_CONTROL,
-	QPHY_PCS_MISC_CLAMP_ENABLE,
 	/* Keep last to ensure regs_layout arrays are properly initialized */
 	QPHY_LAYOUT_SIZE
 };
@@ -106,7 +104,6 @@ static const unsigned int qmp_v3_usb3phy_regs_layout[QPHY_LAYOUT_SIZE] = {
 	[QPHY_PCS_AUTONOMOUS_MODE_CTRL]	= QPHY_V3_PCS_AUTONOMOUS_MODE_CTRL,
 	[QPHY_PCS_LFPS_RXTERM_IRQ_CLEAR] = QPHY_V3_PCS_LFPS_RXTERM_IRQ_CLEAR,
 	[QPHY_PCS_POWER_DOWN_CONTROL]	= QPHY_V3_PCS_POWER_DOWN_CONTROL,
-	[QPHY_PCS_MISC_CLAMP_ENABLE]	= QPHY_V3_PCS_MISC_CLAMP_ENABLE,
 };
 
 static const unsigned int qmp_v3_usb3phy_regs_layout_qcm2290[QPHY_LAYOUT_SIZE] = {
@@ -369,6 +366,9 @@ struct qmp_usbc {
 	void __iomem *tx2;
 	void __iomem *rx2;
 
+	struct regmap *tcsr_map;
+	u32 vls_clamp_reg;
+
 	struct clk *pipe_clk;
 	struct clk_bulk_data *clks;
 	int num_clks;
@@ -691,7 +691,6 @@ static void qmp_usbc_enable_autonomous_mode(struct qmp_usbc *qmp)
 {
 	const struct qmp_phy_cfg *cfg = qmp->cfg;
 	void __iomem *pcs = qmp->pcs;
-	void __iomem *pcs_misc = qmp->pcs_misc;
 	u32 intr_mask;
 
 	if (qmp->mode == PHY_MODE_USB_HOST_SS ||
@@ -712,19 +711,18 @@ static void qmp_usbc_enable_autonomous_mode(struct qmp_usbc *qmp)
 	qphy_setbits(pcs, cfg->regs[QPHY_PCS_AUTONOMOUS_MODE_CTRL], intr_mask);
 
 	/* Enable i/o clamp_n for autonomous mode */
-	if (pcs_misc && cfg->regs[QPHY_PCS_MISC_CLAMP_ENABLE])
-		qphy_clrbits(pcs_misc, cfg->regs[QPHY_PCS_MISC_CLAMP_ENABLE], CLAMP_EN);
+	if (qmp->tcsr_map && qmp->vls_clamp_reg)
+		regmap_write(qmp->tcsr_map, qmp->vls_clamp_reg, 1);
 }
 
 static void qmp_usbc_disable_autonomous_mode(struct qmp_usbc *qmp)
 {
 	const struct qmp_phy_cfg *cfg = qmp->cfg;
 	void __iomem *pcs = qmp->pcs;
-	void __iomem *pcs_misc = qmp->pcs_misc;
 
 	/* Disable i/o clamp_n on resume for normal mode */
-	if (pcs_misc && cfg->regs[QPHY_PCS_MISC_CLAMP_ENABLE])
-		qphy_setbits(pcs_misc, cfg->regs[QPHY_PCS_MISC_CLAMP_ENABLE], CLAMP_EN);
+	if (qmp->tcsr_map && qmp->vls_clamp_reg)
+		regmap_write(qmp->tcsr_map, qmp->vls_clamp_reg, 0);
 
 	qphy_clrbits(pcs, cfg->regs[QPHY_PCS_AUTONOMOUS_MODE_CTRL],
 		     ARCVR_DTCT_EN | ARCVR_DTCT_EVENT_SEL | ALFPS_DTCT_EN);
@@ -1063,6 +1061,30 @@ static int qmp_usbc_parse_dt(struct qmp_usbc *qmp)
 	return 0;
 }
 
+static int qmp_usbc_parse_vls_clamp(struct qmp_usbc *qmp)
+{
+	struct of_phandle_args tcsr_args;
+	struct device *dev = qmp->dev;
+	int ret;
+
+	/*  for backwards compatibility ignore if there is no property */
+	ret = of_parse_phandle_with_fixed_args(dev->of_node, "qcom,tcsr-reg", 1, 0,
+					       &tcsr_args);
+	if (ret == -ENOENT)
+		return 0;
+	else if (ret < 0)
+		return dev_err_probe(dev, ret, "Failed to parse qcom,tcsr-reg\n");
+
+	qmp->tcsr_map = syscon_node_to_regmap(tcsr_args.np);
+	of_node_put(tcsr_args.np);
+	if (IS_ERR(qmp->tcsr_map))
+		return PTR_ERR(qmp->tcsr_map);
+
+	qmp->vls_clamp_reg = tcsr_args.args[0];
+
+	return 0;
+}
+
 static int qmp_usbc_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
@@ -1093,6 +1115,10 @@ static int qmp_usbc_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
+	ret = qmp_usbc_parse_vls_clamp(qmp);
+	if (ret)
+		return ret;
+
 	/* Check for legacy binding with child node. */
 	np = of_get_child_by_name(dev->of_node, "phy");
 	if (np) {

-- 
2.39.2


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

* [PATCH v2 4/6] arm64: dts: qcom: msm8998: declare VLS CLAMP register for USB3 PHY
  2024-01-17 14:04 [PATCH v2 0/6] phy: qcom: qmp-usbc: properly handle the clamping register Dmitry Baryshkov
                   ` (2 preceding siblings ...)
  2024-01-17 14:04 ` [PATCH v2 3/6] phy: qcom: qmp-usbc: handle CLAMP register in a correct way Dmitry Baryshkov
@ 2024-01-17 14:04 ` Dmitry Baryshkov
  2024-01-18 11:22   ` Konrad Dybcio
  2024-01-26 17:34   ` Jeffrey Hugo
  2024-01-17 14:04 ` [PATCH v2 5/6] arm64: dts: qcom: qcm2290: " Dmitry Baryshkov
                   ` (3 subsequent siblings)
  7 siblings, 2 replies; 15+ messages in thread
From: Dmitry Baryshkov @ 2024-01-17 14:04 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Lee Jones, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Vinod Koul,
	Kishon Vijay Abraham I, Jeffrey Hugo
  Cc: linux-arm-msm, devicetree, linux-phy

The USB3 PHY on the MSM8998 platform doesn't have built-in
PCS_MISC_CLAMP_ENABLE register. Instead clamping is handled separately
via the register in the TCSR space. Declare corresponding register.

Fixes: 026dad8f5873 ("arm64: dts: qcom: msm8998: Add USB-related nodes")
Cc: Jeffrey Hugo <quic_jhugo@quicinc.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 arch/arm64/boot/dts/qcom/msm8998.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/msm8998.dtsi b/arch/arm64/boot/dts/qcom/msm8998.dtsi
index 2793cc22d381..317a91d669f8 100644
--- a/arch/arm64/boot/dts/qcom/msm8998.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8998.dtsi
@@ -1072,6 +1072,11 @@ tcsr_regs_1: syscon@1f60000 {
 			reg = <0x01f60000 0x20000>;
 		};
 
+		tcsr_regs_2: syscon@1fc0000 {
+			compatible = "qcom,msm8998-tcsr", "syscon";
+			reg = <0x01fc0000 0x26000>;
+		};
+
 		tlmm: pinctrl@3400000 {
 			compatible = "qcom,msm8998-pinctrl";
 			reg = <0x03400000 0xc00000>;
@@ -2174,6 +2179,8 @@ usb3phy: phy@c010000 {
 			reset-names = "phy",
 				      "phy_phy";
 
+			qcom,tcsr-reg = <&tcsr_regs_2 0xb244>;
+
 			status = "disabled";
 		};
 

-- 
2.39.2


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

* [PATCH v2 5/6] arm64: dts: qcom: qcm2290: declare VLS CLAMP register for USB3 PHY
  2024-01-17 14:04 [PATCH v2 0/6] phy: qcom: qmp-usbc: properly handle the clamping register Dmitry Baryshkov
                   ` (3 preceding siblings ...)
  2024-01-17 14:04 ` [PATCH v2 4/6] arm64: dts: qcom: msm8998: declare VLS CLAMP register for USB3 PHY Dmitry Baryshkov
@ 2024-01-17 14:04 ` Dmitry Baryshkov
  2024-01-18 11:22   ` Konrad Dybcio
  2024-01-17 14:04 ` [PATCH v2 6/6] arm64: dts: qcom: sm6115: " Dmitry Baryshkov
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 15+ messages in thread
From: Dmitry Baryshkov @ 2024-01-17 14:04 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Lee Jones, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Vinod Koul,
	Kishon Vijay Abraham I, Jeffrey Hugo
  Cc: linux-arm-msm, devicetree, linux-phy

The USB3 PHY on the QCM2290 platform doesn't have built-in
PCS_MISC_CLAMP_ENABLE register. Instead clamping is handled separately
via the register in the TCSR space. Declare corresponding register.

Fixes: 0c55f6229bc3 ("arm64: dts: qcom: qcm2290: Add USB3 PHY")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 arch/arm64/boot/dts/qcom/qcm2290.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/qcm2290.dtsi b/arch/arm64/boot/dts/qcom/qcm2290.dtsi
index 0911fb08ed63..89beac833d43 100644
--- a/arch/arm64/boot/dts/qcom/qcm2290.dtsi
+++ b/arch/arm64/boot/dts/qcom/qcm2290.dtsi
@@ -442,6 +442,11 @@ tcsr_mutex: hwlock@340000 {
 			#hwlock-cells = <1>;
 		};
 
+		tcsr_regs: syscon@3c0000 {
+			compatible = "qcom,qcm2290-tcsr", "syscon";
+			reg = <0x0 0x003c0000 0x0 0x40000>;
+		};
+
 		tlmm: pinctrl@500000 {
 			compatible = "qcom,qcm2290-tlmm";
 			reg = <0x0 0x00500000 0x0 0x300000>;
@@ -690,6 +695,8 @@ usb_qmpphy: phy@1615000 {
 
 			#phy-cells = <0>;
 
+			qcom,tcsr-reg = <&tcsr_regs 0xb244>;
+
 			status = "disabled";
 		};
 

-- 
2.39.2


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

* [PATCH v2 6/6] arm64: dts: qcom: sm6115: declare VLS CLAMP register for USB3 PHY
  2024-01-17 14:04 [PATCH v2 0/6] phy: qcom: qmp-usbc: properly handle the clamping register Dmitry Baryshkov
                   ` (4 preceding siblings ...)
  2024-01-17 14:04 ` [PATCH v2 5/6] arm64: dts: qcom: qcm2290: " Dmitry Baryshkov
@ 2024-01-17 14:04 ` Dmitry Baryshkov
  2024-01-18 11:22   ` Konrad Dybcio
  2024-01-23 14:20 ` (subset) [PATCH v2 0/6] phy: qcom: qmp-usbc: properly handle the clamping register Vinod Koul
  2024-02-07  4:46 ` Bjorn Andersson
  7 siblings, 1 reply; 15+ messages in thread
From: Dmitry Baryshkov @ 2024-01-17 14:04 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Lee Jones, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Vinod Koul,
	Kishon Vijay Abraham I, Jeffrey Hugo
  Cc: linux-arm-msm, devicetree, linux-phy

The USB3 PHY on the SM6115 platform doesn't have built-in
PCS_MISC_CLAMP_ENABLE register. Instead clamping is handled separately
via the register in the TCSR space. Declare corresponding register.

Fixes: 9dd5f6dba729 ("arm64: dts: qcom: sm6115: Add USB SS qmp phy node")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 arch/arm64/boot/dts/qcom/sm6115.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sm6115.dtsi b/arch/arm64/boot/dts/qcom/sm6115.dtsi
index 160e098f1075..0c48ea444759 100644
--- a/arch/arm64/boot/dts/qcom/sm6115.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm6115.dtsi
@@ -614,6 +614,11 @@ tcsr_mutex: hwlock@340000 {
 			#hwlock-cells = <1>;
 		};
 
+		tcsr_regs: syscon@3c0000 {
+			compatible = "qcom,sm6115-tcsr", "syscon";
+			reg = <0x0 0x003c0000 0x0 0x40000>;
+		};
+
 		tlmm: pinctrl@500000 {
 			compatible = "qcom,sm6115-tlmm";
 			reg = <0x0 0x00500000 0x0 0x400000>,
@@ -879,6 +884,8 @@ usb_qmpphy: phy@1615000 {
 
 			#phy-cells = <0>;
 
+			qcom,tcsr-reg = <&tcsr_regs 0xb244>;
+
 			status = "disabled";
 		};
 

-- 
2.39.2


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

* Re: [PATCH v2 4/6] arm64: dts: qcom: msm8998: declare VLS CLAMP register for USB3 PHY
  2024-01-17 14:04 ` [PATCH v2 4/6] arm64: dts: qcom: msm8998: declare VLS CLAMP register for USB3 PHY Dmitry Baryshkov
@ 2024-01-18 11:22   ` Konrad Dybcio
  2024-01-26 17:34   ` Jeffrey Hugo
  1 sibling, 0 replies; 15+ messages in thread
From: Konrad Dybcio @ 2024-01-18 11:22 UTC (permalink / raw)
  To: Dmitry Baryshkov, Bjorn Andersson, Lee Jones, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Vinod Koul,
	Kishon Vijay Abraham I, Jeffrey Hugo
  Cc: linux-arm-msm, devicetree, linux-phy



On 1/17/24 15:04, Dmitry Baryshkov wrote:
> The USB3 PHY on the MSM8998 platform doesn't have built-in
> PCS_MISC_CLAMP_ENABLE register. Instead clamping is handled separately
> via the register in the TCSR space. Declare corresponding register.
> 
> Fixes: 026dad8f5873 ("arm64: dts: qcom: msm8998: Add USB-related nodes")
> Cc: Jeffrey Hugo <quic_jhugo@quicinc.com>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad

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

* Re: [PATCH v2 5/6] arm64: dts: qcom: qcm2290: declare VLS CLAMP register for USB3 PHY
  2024-01-17 14:04 ` [PATCH v2 5/6] arm64: dts: qcom: qcm2290: " Dmitry Baryshkov
@ 2024-01-18 11:22   ` Konrad Dybcio
  0 siblings, 0 replies; 15+ messages in thread
From: Konrad Dybcio @ 2024-01-18 11:22 UTC (permalink / raw)
  To: Dmitry Baryshkov, Bjorn Andersson, Lee Jones, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Vinod Koul,
	Kishon Vijay Abraham I, Jeffrey Hugo
  Cc: linux-arm-msm, devicetree, linux-phy



On 1/17/24 15:04, Dmitry Baryshkov wrote:
> The USB3 PHY on the QCM2290 platform doesn't have built-in
> PCS_MISC_CLAMP_ENABLE register. Instead clamping is handled separately
> via the register in the TCSR space. Declare corresponding register.
> 
> Fixes: 0c55f6229bc3 ("arm64: dts: qcom: qcm2290: Add USB3 PHY")
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad

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

* Re: [PATCH v2 6/6] arm64: dts: qcom: sm6115: declare VLS CLAMP register for USB3 PHY
  2024-01-17 14:04 ` [PATCH v2 6/6] arm64: dts: qcom: sm6115: " Dmitry Baryshkov
@ 2024-01-18 11:22   ` Konrad Dybcio
  0 siblings, 0 replies; 15+ messages in thread
From: Konrad Dybcio @ 2024-01-18 11:22 UTC (permalink / raw)
  To: Dmitry Baryshkov, Bjorn Andersson, Lee Jones, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Vinod Koul,
	Kishon Vijay Abraham I, Jeffrey Hugo
  Cc: linux-arm-msm, devicetree, linux-phy



On 1/17/24 15:04, Dmitry Baryshkov wrote:
> The USB3 PHY on the SM6115 platform doesn't have built-in
> PCS_MISC_CLAMP_ENABLE register. Instead clamping is handled separately
> via the register in the TCSR space. Declare corresponding register.
> 
> Fixes: 9dd5f6dba729 ("arm64: dts: qcom: sm6115: Add USB SS qmp phy node")
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad

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

* Re: [PATCH v2 3/6] phy: qcom: qmp-usbc: handle CLAMP register in a correct way
  2024-01-17 14:04 ` [PATCH v2 3/6] phy: qcom: qmp-usbc: handle CLAMP register in a correct way Dmitry Baryshkov
@ 2024-01-18 11:23   ` Konrad Dybcio
  2024-01-26 17:30   ` Jeffrey Hugo
  1 sibling, 0 replies; 15+ messages in thread
From: Konrad Dybcio @ 2024-01-18 11:23 UTC (permalink / raw)
  To: Dmitry Baryshkov, Bjorn Andersson, Lee Jones, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Vinod Koul,
	Kishon Vijay Abraham I, Jeffrey Hugo
  Cc: linux-arm-msm, devicetree, linux-phy



On 1/17/24 15:04, Dmitry Baryshkov wrote:
> The QMP USB PHYs on msm8998, qcm2290 and some other platforms don't have
> the PCS_MISC_CLAMP_ENABLE register. Instead they need to toggle the
> register in the TCSR space. Make the new phy-qcom-qmp-usbc driver
> correctly handle the clamp register.
> 
> Fixes: a51969fafc82 ("phy: qcom-qmp: Add QMP V3 USB3 PHY support for msm8998")
> Fixes: 8abe5e778b2c ("phy: qcom-qmp: Add QCM2290 USB3 PHY support")
> Cc: Jeffrey Hugo <quic_jhugo@quicinc.com>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---

[...]

> +
> +	/*  for backwards compatibility ignore if there is no property */

:(

Nonetheless,

Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad

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

* Re: (subset) [PATCH v2 0/6] phy: qcom: qmp-usbc: properly handle the clamping register
  2024-01-17 14:04 [PATCH v2 0/6] phy: qcom: qmp-usbc: properly handle the clamping register Dmitry Baryshkov
                   ` (5 preceding siblings ...)
  2024-01-17 14:04 ` [PATCH v2 6/6] arm64: dts: qcom: sm6115: " Dmitry Baryshkov
@ 2024-01-23 14:20 ` Vinod Koul
  2024-02-07  4:46 ` Bjorn Andersson
  7 siblings, 0 replies; 15+ messages in thread
From: Vinod Koul @ 2024-01-23 14:20 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Lee Jones, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Kishon Vijay Abraham I,
	Jeffrey Hugo, Dmitry Baryshkov
  Cc: linux-arm-msm, devicetree, linux-phy, Krzysztof Kozlowski


On Wed, 17 Jan 2024 16:04:21 +0200, Dmitry Baryshkov wrote:
> The USB-C PHY on the MSM8998, QCM2290, SM6115 and several other platforms
> doesn't have built-in PCS_MISC_CLAMP_ENABLE register. Instead clamping
> is handled separately via the register in the TCSR space. Make the new
> phy-qcom-qmp-usbc driver correctly handle the clamp register.
> 
> For backwards compatibility the driver treats these registers as
> optional. They are only required for the PHY suspend/resume. However the
> schema declares corresponding property as required, it should be present
> on all relevant platforms.
> 
> [...]

Applied, thanks!

[2/6] dt-bindings: phy: qcom,msm8998-qmp-usb3-phy: add TCSR registers
      commit: f2b2f86a8bd19feb70649abf8a63d639f4c838d8
[3/6] phy: qcom: qmp-usbc: handle CLAMP register in a correct way
      commit: 01b086ccdeffac96f107228d581e0925e1c83f87

Best regards,
-- 
~Vinod



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

* Re: [PATCH v2 3/6] phy: qcom: qmp-usbc: handle CLAMP register in a correct way
  2024-01-17 14:04 ` [PATCH v2 3/6] phy: qcom: qmp-usbc: handle CLAMP register in a correct way Dmitry Baryshkov
  2024-01-18 11:23   ` Konrad Dybcio
@ 2024-01-26 17:30   ` Jeffrey Hugo
  1 sibling, 0 replies; 15+ messages in thread
From: Jeffrey Hugo @ 2024-01-26 17:30 UTC (permalink / raw)
  To: Dmitry Baryshkov, Bjorn Andersson, Konrad Dybcio, Lee Jones,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Vinod Koul,
	Kishon Vijay Abraham I
  Cc: linux-arm-msm, devicetree, linux-phy

On 1/17/2024 7:04 AM, Dmitry Baryshkov wrote:
> The QMP USB PHYs on msm8998, qcm2290 and some other platforms don't have
> the PCS_MISC_CLAMP_ENABLE register. Instead they need to toggle the
> register in the TCSR space. Make the new phy-qcom-qmp-usbc driver
> correctly handle the clamp register.
> 
> Fixes: a51969fafc82 ("phy: qcom-qmp: Add QMP V3 USB3 PHY support for msm8998")
> Fixes: 8abe5e778b2c ("phy: qcom-qmp: Add QCM2290 USB3 PHY support")
> Cc: Jeffrey Hugo <quic_jhugo@quicinc.com>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>

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

* Re: [PATCH v2 4/6] arm64: dts: qcom: msm8998: declare VLS CLAMP register for USB3 PHY
  2024-01-17 14:04 ` [PATCH v2 4/6] arm64: dts: qcom: msm8998: declare VLS CLAMP register for USB3 PHY Dmitry Baryshkov
  2024-01-18 11:22   ` Konrad Dybcio
@ 2024-01-26 17:34   ` Jeffrey Hugo
  1 sibling, 0 replies; 15+ messages in thread
From: Jeffrey Hugo @ 2024-01-26 17:34 UTC (permalink / raw)
  To: Dmitry Baryshkov, Bjorn Andersson, Konrad Dybcio, Lee Jones,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Vinod Koul,
	Kishon Vijay Abraham I
  Cc: linux-arm-msm, devicetree, linux-phy

On 1/17/2024 7:04 AM, Dmitry Baryshkov wrote:
> The USB3 PHY on the MSM8998 platform doesn't have built-in
> PCS_MISC_CLAMP_ENABLE register. Instead clamping is handled separately
> via the register in the TCSR space. Declare corresponding register.
> 
> Fixes: 026dad8f5873 ("arm64: dts: qcom: msm8998: Add USB-related nodes")
> Cc: Jeffrey Hugo <quic_jhugo@quicinc.com>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>

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

* Re: (subset) [PATCH v2 0/6] phy: qcom: qmp-usbc: properly handle the clamping register
  2024-01-17 14:04 [PATCH v2 0/6] phy: qcom: qmp-usbc: properly handle the clamping register Dmitry Baryshkov
                   ` (6 preceding siblings ...)
  2024-01-23 14:20 ` (subset) [PATCH v2 0/6] phy: qcom: qmp-usbc: properly handle the clamping register Vinod Koul
@ 2024-02-07  4:46 ` Bjorn Andersson
  7 siblings, 0 replies; 15+ messages in thread
From: Bjorn Andersson @ 2024-02-07  4:46 UTC (permalink / raw)
  To: Konrad Dybcio, Lee Jones, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Vinod Koul, Kishon Vijay Abraham I, Jeffrey Hugo,
	Dmitry Baryshkov
  Cc: linux-arm-msm, devicetree, linux-phy, Krzysztof Kozlowski


On Wed, 17 Jan 2024 16:04:21 +0200, Dmitry Baryshkov wrote:
> The USB-C PHY on the MSM8998, QCM2290, SM6115 and several other platforms
> doesn't have built-in PCS_MISC_CLAMP_ENABLE register. Instead clamping
> is handled separately via the register in the TCSR space. Make the new
> phy-qcom-qmp-usbc driver correctly handle the clamp register.
> 
> For backwards compatibility the driver treats these registers as
> optional. They are only required for the PHY suspend/resume. However the
> schema declares corresponding property as required, it should be present
> on all relevant platforms.
> 
> [...]

Applied, thanks!

[4/6] arm64: dts: qcom: msm8998: declare VLS CLAMP register for USB3 PHY
      commit: fc835b2311d4deb85d776c1d73562338462aa7ac
[5/6] arm64: dts: qcom: qcm2290: declare VLS CLAMP register for USB3 PHY
      commit: acb94d67f5a23dbb2e0021b6c30609ed05d7d6a5
[6/6] arm64: dts: qcom: sm6115: declare VLS CLAMP register for USB3 PHY
      commit: 95d739ed962c9aaa17d77b739606dbdf31879f6e

Best regards,
-- 
Bjorn Andersson <andersson@kernel.org>

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

end of thread, other threads:[~2024-02-07  4:46 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-17 14:04 [PATCH v2 0/6] phy: qcom: qmp-usbc: properly handle the clamping register Dmitry Baryshkov
2024-01-17 14:04 ` [PATCH v2 1/6] dt-bindings: mfd: qcom,tcsr: Add compatibles for QCM2290 and SM6115 Dmitry Baryshkov
2024-01-17 14:04 ` [PATCH v2 2/6] dt-bindings: phy: qcom,msm8998-qmp-usb3-phy: add TCSR registers Dmitry Baryshkov
2024-01-17 14:04 ` [PATCH v2 3/6] phy: qcom: qmp-usbc: handle CLAMP register in a correct way Dmitry Baryshkov
2024-01-18 11:23   ` Konrad Dybcio
2024-01-26 17:30   ` Jeffrey Hugo
2024-01-17 14:04 ` [PATCH v2 4/6] arm64: dts: qcom: msm8998: declare VLS CLAMP register for USB3 PHY Dmitry Baryshkov
2024-01-18 11:22   ` Konrad Dybcio
2024-01-26 17:34   ` Jeffrey Hugo
2024-01-17 14:04 ` [PATCH v2 5/6] arm64: dts: qcom: qcm2290: " Dmitry Baryshkov
2024-01-18 11:22   ` Konrad Dybcio
2024-01-17 14:04 ` [PATCH v2 6/6] arm64: dts: qcom: sm6115: " Dmitry Baryshkov
2024-01-18 11:22   ` Konrad Dybcio
2024-01-23 14:20 ` (subset) [PATCH v2 0/6] phy: qcom: qmp-usbc: properly handle the clamping register Vinod Koul
2024-02-07  4:46 ` Bjorn Andersson

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).