summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrishna Kurapati <krishna.kurapati@oss.qualcomm.com>2025-12-19 20:31:07 +0300
committerVinod Koul <vkoul@kernel.org>2025-12-24 10:03:05 +0300
commit5c87da0308f9395700fd3072fcc45b43234366fb (patch)
treee8e2ecb11abf9aef117119b08a0cc75414336666
parenta590c0f935349b9f3ae72d9fdec002689915519d (diff)
downloadlinux-5c87da0308f9395700fd3072fcc45b43234366fb.tar.xz
phy: qualcomm: phy-qcom-eusb2-repeater: Add squelch detect param update
Add support for overriding Squelch Detect parameter. Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com> Reviewed-by: Abel Vesa <abel.vesa@oss.qualcomm.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Link: https://patch.msgid.link/20251219173108.2119296-3-krishna.kurapati@oss.qualcomm.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
-rw-r--r--drivers/phy/qualcomm/phy-qcom-eusb2-repeater.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/phy/qualcomm/phy-qcom-eusb2-repeater.c b/drivers/phy/qualcomm/phy-qcom-eusb2-repeater.c
index 441996480a67..efeec4709a15 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;
@@ -134,7 +145,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);
@@ -161,6 +174,15 @@ 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 < ARRAY_SIZE(squelch_detector); i++) {
+ if (squelch_detector[i] == dt_val) {
+ regmap_write(regmap, base + EUSB2_TUNE_SQUELCH_U, i);
+ break;
+ }
+ }
+ }
+
/* Wait for status OK */
ret = regmap_read_poll_timeout(regmap, base + EUSB2_RPTR_STATUS, poll_val,
poll_val & RPTR_OK, 10, 5);