From: Kory Maincent <kory.maincent@bootlin.com>
To: Kyle Hendry <kylehendrydev@gmail.com>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Heiner Kallweit <hkallweit1@gmail.com>,
Russell King <linux@armlinux.org.uk>,
Florian Fainelli <florian.fainelli@broadcom.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@broadcom.com>,
Philipp Zabel <p.zabel@pengutronix.de>,
noltari@gmail.com, jonas.gorski@gmail.com,
netdev@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/3] net: phy: bcm63xx: add support for BCM63268 GPHY
Date: Fri, 28 Feb 2025 10:34:11 +0100 [thread overview]
Message-ID: <20250228103411.4c203261@kmaincent-XPS-13-7390> (raw)
In-Reply-To: <20250228002722.5619-2-kylehendrydev@gmail.com>
On Thu, 27 Feb 2025 16:27:15 -0800
Kyle Hendry <kylehendrydev@gmail.com> wrote:
> Add support for the internal gigabit PHY on the BCM63268 SoC.
> Some of the PHY functionality is configured out of band through
> memory mapped registers. The GPHY control register contains bits
> which need to be written to enable/disable low power mode. The
> register is part of the SoC's GPIO controller, so accessing it
> is done through a phandle to that syscon.
...
> +static int bcm63268_gphy_resume(struct phy_device *phydev)
> +{
> + int ret;
> +
> + ret = bcm63268_gphy_set(phydev, true);
> + if (ret)
> + return ret;
> +
> + ret = genphy_resume(phydev);
> + if (ret)
> + return ret;
> +
> + return 0;
No need for the last check. You can simply do this:
return genphy_resume(phydev);
> +}
> +
> +static int bcm63268_gphy_suspend(struct phy_device *phydev)
> +{
> + int ret;
> +
> + ret = genphy_suspend(phydev);
> + if (ret)
> + return ret;
> +
> + ret = bcm63268_gphy_set(phydev, false);
> + if (ret)
> + return ret;
> +
> + return 0;
Same here.
> +}
> +
> +static int bcm63268_gphy_probe(struct phy_device *phydev)
> +{
> + struct mdio_device *mdio = &phydev->mdio;
> + struct device *dev = &mdio->dev;
> + struct reset_control *reset;
> + struct bcm_gphy_priv *priv;
> + struct regmap *regmap;
> + int ret;
> +
> + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
> + if (!priv)
> + return -ENOMEM;
> +
> + phydev->priv = priv;
> +
> + regmap = syscon_regmap_lookup_by_phandle(dev->of_node,
> "brcm,gpio-ctrl");
> + if (IS_ERR(regmap))
> + return PTR_ERR(regmap);
> +
> + priv->gpio_ctrl = regmap;
> +
> + reset = devm_reset_control_get_optional_exclusive(dev, NULL);
> + if (IS_ERR(reset))
> + return PTR_ERR(reset);
> +
> + ret = reset_control_reset(reset);
> + if (ret)
> + return ret;
> +
> + return 0;
Same here.
--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2025-02-28 9:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-28 0:27 [PATCH v3 0/3] net: phy: bcm63xx: add support for BCM63268 GPHY Kyle Hendry
2025-02-28 0:27 ` [PATCH v3 1/3] " Kyle Hendry
2025-02-28 9:34 ` Kory Maincent [this message]
2025-02-28 0:27 ` [PATCH v3 2/3] net: phy: enable bcm63xx on bmips Kyle Hendry
2025-02-28 0:27 ` [PATCH v3 3/3] dt-bindings: net: phy: add BCM63268 GPHY Kyle Hendry
2025-02-28 1:25 ` Rob Herring (Arm)
2025-02-28 9:25 ` [PATCH v3 0/3] net: phy: bcm63xx: add support for " Kory Maincent
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=20250228103411.4c203261@kmaincent-XPS-13-7390 \
--to=kory.maincent@bootlin.com \
--cc=andrew+netdev@lunn.ch \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=florian.fainelli@broadcom.com \
--cc=hkallweit1@gmail.com \
--cc=jonas.gorski@gmail.com \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=kylehendrydev@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=noltari@gmail.com \
--cc=p.zabel@pengutronix.de \
--cc=pabeni@redhat.com \
--cc=robh@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