public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vkoul@kernel.org>
To: Abel Vesa <abel.vesa@linaro.org>
Cc: Andy Gross <agross@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Lee Jones <lee@kernel.org>, Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Kishon Vijay Abraham I <kishon@kernel.org>,
	linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-phy@lists.infradead.org,
	Neil Armstrong <neil.armstrong@linaro.org>
Subject: Re: [RFC v3 5/7] phy: qcom: phy-qcom-snps-eusb2: Add support for eUSB2 repeater
Date: Fri, 3 Feb 2023 19:19:22 +0530	[thread overview]
Message-ID: <Y90Q4rDYw9kcXmCQ@matsya> (raw)
In-Reply-To: <20230202133816.4026990-6-abel.vesa@linaro.org>

On 02-02-23, 15:38, Abel Vesa wrote:
> From: Neil Armstrong <neil.armstrong@linaro.org>
> 
> For USB 2.0 compliance, eUSB2 needs a repeater. The PHY needs to
> initialize and reset it. So add repeater support
> 
> Co-developed-by: Abel Vesa <abel.vesa@linaro.org>
> Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
> ---
>  drivers/phy/qualcomm/phy-qcom-snps-eusb2.c | 18 +++++++++++++++++-
>  1 file changed, 17 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/phy/qualcomm/phy-qcom-snps-eusb2.c b/drivers/phy/qualcomm/phy-qcom-snps-eusb2.c
> index 23ec162cc3bd..8d972d49732b 100644
> --- a/drivers/phy/qualcomm/phy-qcom-snps-eusb2.c
> +++ b/drivers/phy/qualcomm/phy-qcom-snps-eusb2.c
> @@ -128,6 +128,8 @@ struct qcom_snps_eusb2_hsphy {
>  	struct regulator_bulk_data vregs[EUSB2_NUM_VREGS];
>  
>  	enum phy_mode mode;
> +
> +	struct phy *repeater;
>  };
>  
>  static int qcom_snps_eusb2_hsphy_set_mode(struct phy *p, enum phy_mode mode, int submode)
> @@ -136,7 +138,7 @@ static int qcom_snps_eusb2_hsphy_set_mode(struct phy *p, enum phy_mode mode, int
>  
>  	phy->mode = mode;
>  
> -	return 0;
> +	return phy_set_mode_ext(phy->repeater, mode, submode);
>  }
>  
>  static void qcom_snps_eusb2_hsphy_write_mask(void __iomem *base, u32 offset,
> @@ -235,6 +237,12 @@ static int qcom_snps_eusb2_hsphy_init(struct phy *p)
>  	if (ret)
>  		return ret;
>  
> +	ret = phy_init(phy->repeater);
> +	if (ret) {
> +		dev_err(&p->dev, "repeater init failed. %d\n", ret);
> +		goto disable_vreg;
> +	}
> +
>  	ret = clk_prepare_enable(phy->ref_clk);
>  	if (ret) {
>  		dev_err(&p->dev, "failed to enable ref clock, %d\n", ret);
> @@ -342,6 +350,8 @@ static int qcom_snps_eusb2_hsphy_exit(struct phy *p)
>  
>  	regulator_bulk_disable(ARRAY_SIZE(phy->vregs), phy->vregs);
>  
> +	phy_exit(phy->repeater);
> +
>  	return 0;
>  }
>  
> @@ -386,6 +396,12 @@ static int qcom_snps_eusb2_hsphy_probe(struct platform_device *pdev)
>  	if (ret)
>  		return dev_err_probe(dev, ret,
>  				     "failed to get regulator supplies\n");
> +
> +	phy->repeater = devm_phy_get(dev, "eusb2-repeater");
> +	if (IS_ERR(phy->repeater))
> +		return dev_err_probe(dev, PTR_ERR(phy->repeater),
> +				     "failed to get repeater\n");

That implies repeater is assumed to be there for all designs, how about
older devices, they may not have a repeater?

> +
>  	generic_phy = devm_phy_create(dev, NULL, &qcom_snps_eusb2_hsphy_ops);
>  	if (IS_ERR(generic_phy)) {
>  		dev_err(dev, "failed to create phy %d\n", ret);
> -- 
> 2.34.1

-- 
~Vinod

  reply	other threads:[~2023-02-03 13:49 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-02 13:38 [RFC v3 0/7] sm8550: Add support for eUSB2 repeater Abel Vesa
2023-02-02 13:38 ` [RFC v3 1/7] dt-bindings: mfd: qcom,spmi-pmic: Add pattern property for phy Abel Vesa
2023-02-02 15:03   ` Rob Herring
2023-02-02 17:00   ` Krzysztof Kozlowski
2023-02-02 13:38 ` [RFC v3 2/7] dt-bindings: phy: Add qcom,snps-eusb2-repeater schema file Abel Vesa
2023-02-02 15:03   ` Rob Herring
2023-02-02 13:38 ` [RFC v3 3/7] dt-bindings: phy: qcom,snps-eusb2-repeater: Add phy related properties Abel Vesa
2023-02-03 16:37   ` Dmitry Baryshkov
2023-02-02 13:38 ` [RFC v3 4/7] phy: qcom: Add QCOM SNPS eUSB2 repeater driver Abel Vesa
2023-02-03 13:48   ` Vinod Koul
2023-02-03 16:51   ` Dmitry Baryshkov
2023-02-07 12:25     ` Abel Vesa
2023-02-07 13:03       ` Dmitry Baryshkov
2023-02-07 13:10         ` Abel Vesa
2023-02-02 13:38 ` [RFC v3 5/7] phy: qcom: phy-qcom-snps-eusb2: Add support for eUSB2 repeater Abel Vesa
2023-02-03 13:49   ` Vinod Koul [this message]
2023-02-07  7:11     ` Abel Vesa
2023-02-02 13:38 ` [RFC v3 6/7] arm64: dts: qcom: pm8550b: Add eUSB2 repeater node Abel Vesa
2023-02-02 13:38 ` [RFC v3 7/7] arm64: dts: qcom: sm8550-mtp: " Abel Vesa

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=Y90Q4rDYw9kcXmCQ@matsya \
    --to=vkoul@kernel.org \
    --cc=abel.vesa@linaro.org \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=kishon@kernel.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lee@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=neil.armstrong@linaro.org \
    --cc=robh+dt@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