From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
To: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>,
Vinod Koul <vkoul@kernel.org>,
Kishon Vijay Abraham I <kishon@kernel.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>,
Luca Weiss <luca.weiss@fairphone.com>,
Abel Vesa <abel.vesa@linaro.org>,
Neil Armstrong <neil.armstrong@linaro.org>,
Johan Hovold <johan+linaro@kernel.org>,
Pengyu Luo <mitltlatltl@gmail.com>
Cc: linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] phy: qualcomm: phy-qcom-eusb2-repeater: Add squelch detect param update
Date: Wed, 3 Dec 2025 12:15:00 +0100 [thread overview]
Message-ID: <fe15827d-c15c-4b4e-973e-3cc379714467@oss.qualcomm.com> (raw)
In-Reply-To: <20251203083629.2395451-3-krishna.kurapati@oss.qualcomm.com>
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
next prev parent reply other threads:[~2025-12-03 11:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fe15827d-c15c-4b4e-973e-3cc379714467@oss.qualcomm.com \
--to=konrad.dybcio@oss.qualcomm.com \
--cc=abel.vesa@linaro.org \
--cc=andersson@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=johan+linaro@kernel.org \
--cc=kishon@kernel.org \
--cc=konradybcio@kernel.org \
--cc=krishna.kurapati@oss.qualcomm.com \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=luca.weiss@fairphone.com \
--cc=mitltlatltl@gmail.com \
--cc=neil.armstrong@linaro.org \
--cc=robh@kernel.org \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox