mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] phy: qcom: qmp-combo: Add polarity inversion support for SAR2130P
@ 2025-10-17 20:34 Krishna Kurapati
  2025-10-17 20:55 ` Dmitry Baryshkov
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Krishna Kurapati @ 2025-10-17 20:34 UTC (permalink / raw)
  To: Vinod Koul, Kishon Vijay Abraham I, Dmitry Baryshkov,
	Neil Armstrong, Konrad Dybcio, Krzysztof Kozlowski
  Cc: linux-arm-msm, linux-phy, linux-kernel, Krishna Kurapati

On SAR2130P QXR Platform, the CC Lines are inverted and the lane
programming is to be done reverse compared to other targets.

As per the HW specifics, Bit-2 of TYPEC_CTRL register indicates
port select polarity. This bit is to be set for SAR2130P.

Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
---
 drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
index 7b5af30f1d02..813c88f0a16f 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
@@ -60,6 +60,7 @@
 /* QPHY_V3_DP_COM_TYPEC_CTRL register bits */
 #define SW_PORTSELECT_VAL			BIT(0)
 #define SW_PORTSELECT_MUX			BIT(1)
+#define INVERT_CC_POLARITY			BIT(2)
 
 #define PHY_INIT_COMPLETE_TIMEOUT		10000
 
@@ -1820,6 +1821,7 @@ struct qmp_phy_cfg {
 	/* Offset from PCS to PCS_USB region */
 	unsigned int pcs_usb_offset;
 
+	bool invert_cc_polarity;
 };
 
 struct qmp_combo {
@@ -2010,6 +2012,7 @@ static const struct qmp_phy_cfg sar2130p_usb3dpphy_cfg = {
 	.num_resets		= ARRAY_SIZE(msm8996_usb3phy_reset_l),
 	.vreg_list		= qmp_phy_vreg_l,
 	.num_vregs		= ARRAY_SIZE(qmp_phy_vreg_l),
+	.invert_cc_polarity     = true,
 };
 
 static const struct qmp_phy_cfg sc7180_usb3dpphy_cfg = {
@@ -3046,6 +3049,10 @@ static int qmp_combo_com_init(struct qmp_combo *qmp, bool force)
 	val = SW_PORTSELECT_MUX;
 	if (qmp->orientation == TYPEC_ORIENTATION_REVERSE)
 		val |= SW_PORTSELECT_VAL;
+
+	if (cfg->invert_cc_polarity)
+		val |= INVERT_CC_POLARITY;
+
 	writel(val, com + QPHY_V3_DP_COM_TYPEC_CTRL);
 
 	switch (qmp->qmpphy_mode) {
-- 
2.34.1


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

* Re: [PATCH] phy: qcom: qmp-combo: Add polarity inversion support for SAR2130P
  2025-10-17 20:34 [PATCH] phy: qcom: qmp-combo: Add polarity inversion support for SAR2130P Krishna Kurapati
@ 2025-10-17 20:55 ` Dmitry Baryshkov
  2025-10-20  7:53 ` Konrad Dybcio
  2026-01-14 14:01 ` Vinod Koul
  2 siblings, 0 replies; 5+ messages in thread
From: Dmitry Baryshkov @ 2025-10-17 20:55 UTC (permalink / raw)
  To: Krishna Kurapati
  Cc: Vinod Koul, Kishon Vijay Abraham I, Dmitry Baryshkov,
	Neil Armstrong, Konrad Dybcio, Krzysztof Kozlowski,
	linux-arm-msm, linux-phy, linux-kernel

On Sat, Oct 18, 2025 at 02:04:38AM +0530, Krishna Kurapati wrote:
> On SAR2130P QXR Platform, the CC Lines are inverted and the lane
> programming is to be done reverse compared to other targets.
> 
> As per the HW specifics, Bit-2 of TYPEC_CTRL register indicates
> port select polarity. This bit is to be set for SAR2130P.
> 
> Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
> ---
>  drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>

I wasn't able to test USB 3 while I had the device, but this seems to be
correct.

-- 
With best wishes
Dmitry

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

* Re: [PATCH] phy: qcom: qmp-combo: Add polarity inversion support for SAR2130P
  2025-10-17 20:34 [PATCH] phy: qcom: qmp-combo: Add polarity inversion support for SAR2130P Krishna Kurapati
  2025-10-17 20:55 ` Dmitry Baryshkov
@ 2025-10-20  7:53 ` Konrad Dybcio
  2026-01-12 15:10   ` Krishna Kurapati PSSNV
  2026-01-14 14:01 ` Vinod Koul
  2 siblings, 1 reply; 5+ messages in thread
From: Konrad Dybcio @ 2025-10-20  7:53 UTC (permalink / raw)
  To: Krishna Kurapati, Vinod Koul, Kishon Vijay Abraham I,
	Dmitry Baryshkov, Neil Armstrong, Krzysztof Kozlowski
  Cc: linux-arm-msm, linux-phy, linux-kernel

On 10/17/25 10:34 PM, Krishna Kurapati wrote:
> On SAR2130P QXR Platform, the CC Lines are inverted and the lane
> programming is to be done reverse compared to other targets.
> 
> As per the HW specifics, Bit-2 of TYPEC_CTRL register indicates
> port select polarity. This bit is to be set for SAR2130P.
> 
> Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
> ---

The downstream kernel for this platform corrobates this

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

Konrad

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

* Re: [PATCH] phy: qcom: qmp-combo: Add polarity inversion support for SAR2130P
  2025-10-20  7:53 ` Konrad Dybcio
@ 2026-01-12 15:10   ` Krishna Kurapati PSSNV
  0 siblings, 0 replies; 5+ messages in thread
From: Krishna Kurapati PSSNV @ 2026-01-12 15:10 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Kishon Vijay Abraham I, Dmitry Baryshkov, Neil Armstrong,
	Krzysztof Kozlowski, Konrad Dybcio, linux-arm-msm, linux-phy,
	linux-kernel

On Mon, Oct 20, 2025 at 1:24 PM Konrad Dybcio
<konrad.dybcio@oss.qualcomm.com> wrote:
>
> On 10/17/25 10:34 PM, Krishna Kurapati wrote:
> > On SAR2130P QXR Platform, the CC Lines are inverted and the lane
> > programming is to be done reverse compared to other targets.
> >
> > As per the HW specifics, Bit-2 of TYPEC_CTRL register indicates
> > port select polarity. This bit is to be set for SAR2130P.
> >
> > Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
> > ---
>
> The downstream kernel for this platform corrobates this
>
> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
>

Hi Vinod,

 Can you help pick this change.

Regards,
Krishna,

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

* Re: [PATCH] phy: qcom: qmp-combo: Add polarity inversion support for SAR2130P
  2025-10-17 20:34 [PATCH] phy: qcom: qmp-combo: Add polarity inversion support for SAR2130P Krishna Kurapati
  2025-10-17 20:55 ` Dmitry Baryshkov
  2025-10-20  7:53 ` Konrad Dybcio
@ 2026-01-14 14:01 ` Vinod Koul
  2 siblings, 0 replies; 5+ messages in thread
From: Vinod Koul @ 2026-01-14 14:01 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Dmitry Baryshkov, Neil Armstrong,
	Konrad Dybcio, Krzysztof Kozlowski, Krishna Kurapati
  Cc: linux-arm-msm, linux-phy, linux-kernel


On Sat, 18 Oct 2025 02:04:38 +0530, Krishna Kurapati wrote:
> On SAR2130P QXR Platform, the CC Lines are inverted and the lane
> programming is to be done reverse compared to other targets.
> 
> As per the HW specifics, Bit-2 of TYPEC_CTRL register indicates
> port select polarity. This bit is to be set for SAR2130P.
> 
> 
> [...]

Applied, thanks!

[1/1] phy: qcom: qmp-combo: Add polarity inversion support for SAR2130P
      commit: 24991bfbbd84d68d5710e1563752047914db941a

Best regards,
-- 
~Vinod



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

end of thread, other threads:[~2026-01-14 14:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-17 20:34 [PATCH] phy: qcom: qmp-combo: Add polarity inversion support for SAR2130P Krishna Kurapati
2025-10-17 20:55 ` Dmitry Baryshkov
2025-10-20  7:53 ` Konrad Dybcio
2026-01-12 15:10   ` Krishna Kurapati PSSNV
2026-01-14 14:01 ` Vinod Koul

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

all inboxes | Powered by JetHome®