linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Abel Vesa <abel.vesa@linaro.org>
To: Dmitry Baryshkov <dmitry.baryshkov@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>,
	"vkoul@kernel.org" <vkoul@kernel.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
Subject: Re: [RFC v3 4/7] phy: qcom: Add QCOM SNPS eUSB2 repeater driver
Date: Tue, 7 Feb 2023 14:25:38 +0200	[thread overview]
Message-ID: <Y+JDQt/T7pXh2/P7@linaro.org> (raw)
In-Reply-To: <6f326ed7-6799-b965-fe3a-1f046546ed44@linaro.org>

On 23-02-03 18:51:13, Dmitry Baryshkov wrote:
> On 02/02/2023 15:38, Abel Vesa wrote:
> > PM8550B contains a eUSB2 repeater used for making the eUSB2 from
> > SM8550 USB 2.0 compliant. This can be modelled SW-wise as a Phy.
> > So add a new phy driver for it.
> > 
> > Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
> > ---
> >   drivers/phy/qualcomm/Kconfig                  |   9 +
> >   drivers/phy/qualcomm/Makefile                 |   1 +
> >   .../phy/qualcomm/phy-qcom-eusb2-repeater.c    | 278 ++++++++++++++++++
> >   3 files changed, 288 insertions(+)
> >   create mode 100644 drivers/phy/qualcomm/phy-qcom-eusb2-repeater.c
> > 

[ ... ]

> > +
> > +static int eusb2_repeater_init(struct phy *phy)
> > +{
> > +	struct eusb2_repeater *rptr = phy_get_drvdata(phy);
> > +	const struct eusb2_repeater_init_tbl *init_tbl = rptr->cfg->init_tbl;
> > +	int num = rptr->cfg->init_tbl_num;
> > +	int ret = 0;
> > +	u32 val;
> > +	int i;
> > +
> > +	ret = regulator_bulk_enable(rptr->cfg->num_vregs, rptr->vregs);
> > +	if (ret)
> > +		return ret;
> > +
> > +	regmap_update_bits(rptr->regmap, rptr->base + EUSB2_EN_CTL1,
> > +				EUSB2_RPTR_EN, EUSB2_RPTR_EN);
> > +
> > +	for (i = 0; i < num; i++)
> > +		regmap_update_bits(rptr->regmap,
> > +					rptr->base + init_tbl[i].offset,
> > +					init_tbl[i].val, init_tbl[i].val);
> 
> I'd move this to a separate function. Then you can use it in the set_mode()
> too.
> 

I don't think this is necessary in set_mode.

> > +
> > +	ret = regmap_read_poll_timeout(rptr->regmap,
> > +					rptr->base + EUSB2_RPTR_STATUS, val,
> > +					val & RPTR_OK, 10, 5);
> > +	if (ret)
> > +		dev_err(rptr->dev, "initialization timed-out\n");
> > +
> > +	return ret;
> > +}
> > +

[ ... ]

  reply	other threads:[~2023-02-07 12:25 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 [this message]
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
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=Y+JDQt/T7pXh2/P7@linaro.org \
    --to=abel.vesa@linaro.org \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.baryshkov@linaro.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=robh+dt@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;
as well as URLs for NNTP newsgroup(s).