The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH 0/3] Add eusb2 repeater squelch detect parameter override
@ 2025-12-03  8:36 Krishna Kurapati
  2025-12-03  8:36 ` [PATCH 1/3] dt-bindings: phy: qcom,snps-eusb2-repeater: Add squelch param update Krishna Kurapati
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Krishna Kurapati @ 2025-12-03  8:36 UTC (permalink / raw)
  To: Vinod Koul, Kishon Vijay Abraham I, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson, Konrad Dybcio,
	Luca Weiss, Abel Vesa, Neil Armstrong, Johan Hovold, Pengyu Luo
  Cc: linux-arm-msm, linux-phy, devicetree, linux-kernel,
	Krishna Kurapati

Add support for eusb2 repeater squelch detect parameter override via DT.

Squelch detect parameter adjusts the voltage level for the threshold used
to detect valid high-speed data.

Krishna Kurapati (3):
  dt-bindings: phy: qcom,snps-eusb2-repeater: Add squelch param update
  phy: qualcomm: phy-qcom-eusb2-repeater: Add squelch detect param
    update
  arm64: dts: qcom: sm8750-mtp: Add eusb2 repeater tuning parameters

 .../phy/qcom,snps-eusb2-repeater.yaml         |  7 +++++++
 arch/arm64/boot/dts/qcom/sm8750-mtp.dts       |  4 ++++
 .../phy/qualcomm/phy-qcom-eusb2-repeater.c    | 21 +++++++++++++++++++
 3 files changed, 32 insertions(+)

-- 
2.34.1


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

* [PATCH 1/3] dt-bindings: phy: qcom,snps-eusb2-repeater: Add squelch param update
  2025-12-03  8:36 [PATCH 0/3] Add eusb2 repeater squelch detect parameter override Krishna Kurapati
@ 2025-12-03  8:36 ` Krishna Kurapati
  2025-12-03 11:16   ` Konrad Dybcio
  2025-12-03  8:36 ` [PATCH 2/3] phy: qualcomm: phy-qcom-eusb2-repeater: Add squelch detect " Krishna Kurapati
  2025-12-03  8:36 ` [PATCH 3/3] arm64: dts: qcom: sm8750-mtp: Add eusb2 repeater tuning parameters Krishna Kurapati
  2 siblings, 1 reply; 7+ messages in thread
From: Krishna Kurapati @ 2025-12-03  8:36 UTC (permalink / raw)
  To: Vinod Koul, Kishon Vijay Abraham I, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson, Konrad Dybcio,
	Luca Weiss, Abel Vesa, Neil Armstrong, Johan Hovold, Pengyu Luo
  Cc: linux-arm-msm, linux-phy, devicetree, linux-kernel,
	Krishna Kurapati

Add squelch detect parameter update for synopsys eusb2 repeater.

Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
---
 .../devicetree/bindings/phy/qcom,snps-eusb2-repeater.yaml  | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/Documentation/devicetree/bindings/phy/qcom,snps-eusb2-repeater.yaml b/Documentation/devicetree/bindings/phy/qcom,snps-eusb2-repeater.yaml
index 5bf0d6c9c025..8a9251ba3b54 100644
--- a/Documentation/devicetree/bindings/phy/qcom,snps-eusb2-repeater.yaml
+++ b/Documentation/devicetree/bindings/phy/qcom,snps-eusb2-repeater.yaml
@@ -59,6 +59,13 @@ properties:
     minimum: 0
     maximum: 7
 
+  qcom,squelch-detector-bp:
+    description:
+      This adjusts the voltage level for the threshold used to detect valid
+      high-speed data.
+    minimum: -6000
+    maximum: 1000
+
 required:
   - compatible
   - reg
-- 
2.34.1


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

* [PATCH 2/3] phy: qualcomm: phy-qcom-eusb2-repeater: Add squelch detect param update
  2025-12-03  8:36 [PATCH 0/3] Add eusb2 repeater squelch detect parameter override Krishna Kurapati
  2025-12-03  8:36 ` [PATCH 1/3] dt-bindings: phy: qcom,snps-eusb2-repeater: Add squelch param update Krishna Kurapati
@ 2025-12-03  8:36 ` Krishna Kurapati
  2025-12-03 11:15   ` Konrad Dybcio
  2025-12-03  8:36 ` [PATCH 3/3] arm64: dts: qcom: sm8750-mtp: Add eusb2 repeater tuning parameters Krishna Kurapati
  2 siblings, 1 reply; 7+ messages in thread
From: Krishna Kurapati @ 2025-12-03  8:36 UTC (permalink / raw)
  To: Vinod Koul, Kishon Vijay Abraham I, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson, Konrad Dybcio,
	Luca Weiss, Abel Vesa, Neil Armstrong, Johan Hovold, Pengyu Luo
  Cc: linux-arm-msm, linux-phy, devicetree, linux-kernel,
	Krishna Kurapati

Add support for overriding Squelch Detect parameter.

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

diff --git a/drivers/phy/qualcomm/phy-qcom-eusb2-repeater.c b/drivers/phy/qualcomm/phy-qcom-eusb2-repeater.c
index 651a12b59bc8..e5812626a871 100644
--- a/drivers/phy/qualcomm/phy-qcom-eusb2-repeater.c
+++ b/drivers/phy/qualcomm/phy-qcom-eusb2-repeater.c
@@ -37,6 +37,17 @@
 #define EUSB2_TUNE_EUSB_EQU		0x5A
 #define EUSB2_TUNE_EUSB_HS_COMP_CUR	0x5B
 
+static const int squelch_detector[] = {
+	[0] = -6000,
+	[1] = -5000,
+	[2] = -4000,
+	[3] = -3000,
+	[4] = -2000,
+	[5] = -1000,
+	[6] = 0,
+	[7] = 1000,
+};
+
 struct eusb2_repeater_init_tbl_reg {
 	unsigned int reg;
 	unsigned int value;
@@ -120,7 +131,9 @@ static int eusb2_repeater_init(struct phy *phy)
 	struct regmap *regmap = rptr->regmap;
 	u32 base = rptr->base;
 	u32 poll_val;
+	s32 dt_val;
 	int ret;
+	int i;
 	u8 val;
 
 	ret = regulator_bulk_enable(rptr->cfg->num_vregs, rptr->vregs);
@@ -147,6 +160,14 @@ static int eusb2_repeater_init(struct phy *phy)
 	if (!of_property_read_u8(np, "qcom,tune-res-fsdif", &val))
 		regmap_write(regmap, base + EUSB2_TUNE_RES_FSDIF, val);
 
+	if (!of_property_read_s32(np, "qcom,squelch-detector-bp", &dt_val)) {
+		for (i = 0; i < 8; i++) {
+			if (squelch_detector[i] == dt_val)
+				val = i;
+		}
+		regmap_write(regmap, base + EUSB2_TUNE_SQUELCH_U, val);
+	}
+
 	/* Wait for status OK */
 	ret = regmap_read_poll_timeout(regmap, base + EUSB2_RPTR_STATUS, poll_val,
 				       poll_val & RPTR_OK, 10, 5);
-- 
2.34.1


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

* [PATCH 3/3] arm64: dts: qcom: sm8750-mtp: Add eusb2 repeater tuning parameters
  2025-12-03  8:36 [PATCH 0/3] Add eusb2 repeater squelch detect parameter override Krishna Kurapati
  2025-12-03  8:36 ` [PATCH 1/3] dt-bindings: phy: qcom,snps-eusb2-repeater: Add squelch param update Krishna Kurapati
  2025-12-03  8:36 ` [PATCH 2/3] phy: qualcomm: phy-qcom-eusb2-repeater: Add squelch detect " Krishna Kurapati
@ 2025-12-03  8:36 ` Krishna Kurapati
  2 siblings, 0 replies; 7+ messages in thread
From: Krishna Kurapati @ 2025-12-03  8:36 UTC (permalink / raw)
  To: Vinod Koul, Kishon Vijay Abraham I, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson, Konrad Dybcio,
	Luca Weiss, Abel Vesa, Neil Armstrong, Johan Hovold, Pengyu Luo
  Cc: linux-arm-msm, linux-phy, devicetree, linux-kernel,
	Krishna Kurapati

Add eusb2 repeater tuning parameters for MTP platform.

Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
---
 arch/arm64/boot/dts/qcom/sm8750-mtp.dts | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sm8750-mtp.dts b/arch/arm64/boot/dts/qcom/sm8750-mtp.dts
index c8cb521b4c26..b9a4d1c99816 100644
--- a/arch/arm64/boot/dts/qcom/sm8750-mtp.dts
+++ b/arch/arm64/boot/dts/qcom/sm8750-mtp.dts
@@ -1041,6 +1041,10 @@ wifi@0 {
 &pmih0108_eusb2_repeater {
 	status = "okay";
 
+	qcom,tune-usb2-preem = /bits/ 8 <0x3>;
+	qcom,tune-usb2-amplitude = /bits/ 8 <0xa>;
+	qcom,squelch-detector-bp = <(-2000)>;
+
 	vdd18-supply = <&vreg_l15b_1p8>;
 	vdd3-supply = <&vreg_l5b_3p1>;
 };
-- 
2.34.1


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

* Re: [PATCH 2/3] phy: qualcomm: phy-qcom-eusb2-repeater: Add squelch detect param update
  2025-12-03  8:36 ` [PATCH 2/3] phy: qualcomm: phy-qcom-eusb2-repeater: Add squelch detect " Krishna Kurapati
@ 2025-12-03 11:15   ` Konrad Dybcio
  2025-12-03 11:25     ` Krishna Kurapati PSSNV
  0 siblings, 1 reply; 7+ messages in thread
From: Konrad Dybcio @ 2025-12-03 11:15 UTC (permalink / raw)
  To: Krishna Kurapati, Vinod Koul, Kishon Vijay Abraham I, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson, Konrad Dybcio,
	Luca Weiss, Abel Vesa, Neil Armstrong, Johan Hovold, Pengyu Luo
  Cc: linux-arm-msm, linux-phy, devicetree, linux-kernel

On 12/3/25 9:36 AM, Krishna Kurapati wrote:
> Add support for overriding Squelch Detect parameter.
> 
> Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
> ---

[...]

>  struct eusb2_repeater_init_tbl_reg {
>  	unsigned int reg;
>  	unsigned int value;
> @@ -120,7 +131,9 @@ static int eusb2_repeater_init(struct phy *phy)
>  	struct regmap *regmap = rptr->regmap;
>  	u32 base = rptr->base;
>  	u32 poll_val;
> +	s32 dt_val;
>  	int ret;
> +	int i;
>  	u8 val;
>  
>  	ret = regulator_bulk_enable(rptr->cfg->num_vregs, rptr->vregs);
> @@ -147,6 +160,14 @@ static int eusb2_repeater_init(struct phy *phy)
>  	if (!of_property_read_u8(np, "qcom,tune-res-fsdif", &val))
>  		regmap_write(regmap, base + EUSB2_TUNE_RES_FSDIF, val);
>  
> +	if (!of_property_read_s32(np, "qcom,squelch-detector-bp", &dt_val)) {
> +		for (i = 0; i < 8; i++) {
> +			if (squelch_detector[i] == dt_val)
> +				val = i;
> +		}
> +		regmap_write(regmap, base + EUSB2_TUNE_SQUELCH_U, val);


How about:

if (!of_property..) {
	for (i = 0; i < ARRAY_SIZE(squelch_detector); i++) {
		if (squelch_detector[i] == dt_val) {
			regmap_write()
			break;
		}
	}
}

We could also validate the value (if none found but property present, error
out), but the dt checker already lists all the available values so that may
not be necessary

Konrad

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

* Re: [PATCH 1/3] dt-bindings: phy: qcom,snps-eusb2-repeater: Add squelch param update
  2025-12-03  8:36 ` [PATCH 1/3] dt-bindings: phy: qcom,snps-eusb2-repeater: Add squelch param update Krishna Kurapati
@ 2025-12-03 11:16   ` Konrad Dybcio
  0 siblings, 0 replies; 7+ messages in thread
From: Konrad Dybcio @ 2025-12-03 11:16 UTC (permalink / raw)
  To: Krishna Kurapati, Vinod Koul, Kishon Vijay Abraham I, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson, Konrad Dybcio,
	Luca Weiss, Abel Vesa, Neil Armstrong, Johan Hovold, Pengyu Luo
  Cc: linux-arm-msm, linux-phy, devicetree, linux-kernel

On 12/3/25 9:36 AM, Krishna Kurapati wrote:
> Add squelch detect parameter update for synopsys eusb2 repeater.
> 
> Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
> ---
>  .../devicetree/bindings/phy/qcom,snps-eusb2-repeater.yaml  | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/phy/qcom,snps-eusb2-repeater.yaml b/Documentation/devicetree/bindings/phy/qcom,snps-eusb2-repeater.yaml
> index 5bf0d6c9c025..8a9251ba3b54 100644
> --- a/Documentation/devicetree/bindings/phy/qcom,snps-eusb2-repeater.yaml
> +++ b/Documentation/devicetree/bindings/phy/qcom,snps-eusb2-repeater.yaml
> @@ -59,6 +59,13 @@ properties:
>      minimum: 0
>      maximum: 7
>  
> +  qcom,squelch-detector-bp:
> +    description:
> +      This adjusts the voltage level for the threshold used to detect valid
> +      high-speed data.
> +    minimum: -6000
> +    maximum: 1000

multipleOf: 1000

Konrad

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

* Re: [PATCH 2/3] phy: qualcomm: phy-qcom-eusb2-repeater: Add squelch detect param update
  2025-12-03 11:15   ` Konrad Dybcio
@ 2025-12-03 11:25     ` Krishna Kurapati PSSNV
  0 siblings, 0 replies; 7+ messages in thread
From: Krishna Kurapati PSSNV @ 2025-12-03 11:25 UTC (permalink / raw)
  To: Konrad Dybcio, Vinod Koul, Kishon Vijay Abraham I, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson, Konrad Dybcio,
	Luca Weiss, Neil Armstrong, Johan Hovold, Pengyu Luo
  Cc: linux-arm-msm, linux-phy, devicetree, linux-kernel



On 12/3/2025 4:45 PM, Konrad Dybcio wrote:
> On 12/3/25 9:36 AM, Krishna Kurapati wrote:
>> Add support for overriding Squelch Detect parameter.
>>
>> Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
>> ---
> 
> [...]
> 
>>   struct eusb2_repeater_init_tbl_reg {
>>   	unsigned int reg;
>>   	unsigned int value;
>> @@ -120,7 +131,9 @@ static int eusb2_repeater_init(struct phy *phy)
>>   	struct regmap *regmap = rptr->regmap;
>>   	u32 base = rptr->base;
>>   	u32 poll_val;
>> +	s32 dt_val;
>>   	int ret;
>> +	int i;
>>   	u8 val;
>>   
>>   	ret = regulator_bulk_enable(rptr->cfg->num_vregs, rptr->vregs);
>> @@ -147,6 +160,14 @@ static int eusb2_repeater_init(struct phy *phy)
>>   	if (!of_property_read_u8(np, "qcom,tune-res-fsdif", &val))
>>   		regmap_write(regmap, base + EUSB2_TUNE_RES_FSDIF, val);
>>   
>> +	if (!of_property_read_s32(np, "qcom,squelch-detector-bp", &dt_val)) {
>> +		for (i = 0; i < 8; i++) {
>> +			if (squelch_detector[i] == dt_val)
>> +				val = i;
>> +		}
>> +		regmap_write(regmap, base + EUSB2_TUNE_SQUELCH_U, val);
> 
> 
> How about:
> 
> if (!of_property..) {
> 	for (i = 0; i < ARRAY_SIZE(squelch_detector); i++) {
> 		if (squelch_detector[i] == dt_val) {
> 			regmap_write()
> 			break;
> 		}
> 	}
> }
> 
> We could also validate the value (if none found but property present, error
> out), but the dt checker already lists all the available values so that may
> not be necessary
> 

Thanks for the review Konrad.

Will make changes accordingly.

Regards,
Krishna,

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

end of thread, other threads:[~2025-12-03 11:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-03  8:36 [PATCH 0/3] Add eusb2 repeater squelch detect parameter override Krishna Kurapati
2025-12-03  8:36 ` [PATCH 1/3] dt-bindings: phy: qcom,snps-eusb2-repeater: Add squelch param update Krishna Kurapati
2025-12-03 11:16   ` Konrad Dybcio
2025-12-03  8:36 ` [PATCH 2/3] phy: qualcomm: phy-qcom-eusb2-repeater: Add squelch detect " Krishna Kurapati
2025-12-03 11:15   ` Konrad Dybcio
2025-12-03 11:25     ` Krishna Kurapati PSSNV
2025-12-03  8:36 ` [PATCH 3/3] arm64: dts: qcom: sm8750-mtp: Add eusb2 repeater tuning parameters Krishna Kurapati

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