public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: Minda Chen <minda.chen@starfivetech.com>,
	Tom Rini <trini@konsulko.com>, Roger Quadros <rogerq@kernel.org>,
	Rick Chen <rick@andestech.com>, Leo <ycliang@andestech.com>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Alexey Romanov <avromanov@salutedevices.com>,
	Sumit Garg <sumit.garg@linaro.org>,
	Mark Kettenis <kettenis@openbsd.org>, Nishanth Menon <nm@ti.com>
Cc: u-boot@lists.denx.de, Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Simon Glass <sjg@chromium.org>, E Shattow <lucent@gmail.com>
Subject: Re: [PATCH v4 3/9] phy: starfive: Add Starfive JH7110 PCIe 2.0 PHY driver
Date: Fri, 30 Aug 2024 03:17:58 +0200	[thread overview]
Message-ID: <801768ea-1bca-4e5a-b9d0-d4fbbdb140b5@denx.de> (raw)
In-Reply-To: <20240829013058.6178-4-minda.chen@starfivetech.com>

On 8/29/24 3:30 AM, Minda Chen wrote:

[...]

> +static int phy_pcie_mode_set(struct jh7110_pcie_phy *data, bool usb_mode)
> +{
> +	unsigned int phy_mode, width, usb3_phy, ss_mode, split;
> +
> +	/* default is PCIe mode */
> +	if (!data->stg_syscon || !data->sys_syscon) {
> +		if (usb_mode) {
> +			dev_err(data->phy->dev, "doesn't support usb3 mode\n");

USB3 in capitals , USB is an abbreviation.

[...]

> +static int jh7110_pcie_phy_set_mode(struct phy *_phy,

Use plain 'phy' variable name, drop the leading underscore .

> +				    enum phy_mode mode, int submode)
> +{
> +	struct udevice *dev = _phy->dev;
> +	struct jh7110_pcie_phy *phy = dev_get_priv(dev);
> +	int ret;
> +
> +	if (mode == phy->mode)
> +		return 0;
> +
> +	switch (mode) {
> +	case PHY_MODE_USB_HOST:
> +	case PHY_MODE_USB_DEVICE:
> +	case PHY_MODE_USB_OTG:
> +		ret = phy_pcie_mode_set(phy, 1);
> +		if (ret)
> +			return ret;
> +		break;
> +	case PHY_MODE_PCIE:
> +		phy_pcie_mode_set(phy, 0);
> +		break;
> +	default:
> +		return -EINVAL;
> +	}
> +
> +	dev_dbg(_phy->dev, "Changing phy mode to %d\n", mode);

PHY in capitals.

> +	phy->mode = mode;
> +
> +	return 0;
> +}
Looks pretty good, thanks !

  reply	other threads:[~2024-08-30  1:27 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-29  1:30 [PATCH v4 0/9] Add Starfive JH7110 Cadence USB driver Minda Chen
2024-08-29  1:30 ` [PATCH v4 1/9] usb: cdns3: Set USB PHY mode in cdns3_drd_update_mode() Minda Chen
2024-08-30  1:11   ` Marek Vasut
2024-08-29  1:30 ` [PATCH v4 2/9] phy: starfive: Add Starfive JH7110 USB 2.0 PHY driver Minda Chen
2024-08-30  1:15   ` Marek Vasut
2024-09-06  8:08     ` Minda Chen
2024-09-06 17:23       ` Marek Vasut
2024-08-29  1:30 ` [PATCH v4 3/9] phy: starfive: Add Starfive JH7110 PCIe " Minda Chen
2024-08-30  1:17   ` Marek Vasut [this message]
2024-08-29  1:30 ` [PATCH v4 4/9] usb: cdns: starfive: Add cdns USB driver Minda Chen
2024-08-30  1:20   ` Marek Vasut
2024-08-29  1:30 ` [PATCH v4 5/9] spl: starfive: visionfive2: Disable USB overcurrent pin by default Minda Chen
2024-10-26 16:23   ` E Shattow
2024-08-29  1:30 ` [PATCH v4 6/9] configs: starfive: Add visionfive2 cadence USB configuration Minda Chen
2024-08-29  1:30 ` [PATCH v4 7/9] dts: starfive: Add JH7110 Cadence USB dts node Minda Chen
2024-08-29  4:47   ` Sumit Garg
2024-08-29  4:57     ` E Shattow
2024-08-30  5:52       ` Minda Chen
2024-08-29  1:30 ` [PATCH v4 8/9] spl: starfive: star64: Setup USB fdt fixup function Minda Chen
2024-08-30  3:30   ` E Shattow
2024-08-29  1:30 ` [PATCH v4 9/9] MAINTAINERS: Update Starfive visionfive2 maintain files Minda Chen

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=801768ea-1bca-4e5a-b9d0-d4fbbdb140b5@denx.de \
    --to=marex@denx.de \
    --cc=avromanov@salutedevices.com \
    --cc=kettenis@openbsd.org \
    --cc=lucent@gmail.com \
    --cc=minda.chen@starfivetech.com \
    --cc=neil.armstrong@linaro.org \
    --cc=nm@ti.com \
    --cc=rick@andestech.com \
    --cc=rogerq@kernel.org \
    --cc=sjg@chromium.org \
    --cc=sumit.garg@linaro.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    --cc=ycliang@andestech.com \
    /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