Re: [PATCH] net: phy: air_en8811h: select LED GPIO pins based on AN8811HB package variant

From: Andrew Lunn

Date: Thu Aug 27 2026 - 14:08:53 EST


On Thu, Aug 27, 2026 at 01:41:55PM +0800, Weiting Lee wrote:
> The AN8811HB comes in two package variants, AN8811HBCN and AN8811HBN,
> which use different GPIO pins to drive LED outputs. AN8811HBCN uses
> GPIOs 0, 1, and 15, while AN8811HBN uses GPIOs 3, 4, and 5. Using a
> fixed GPIO assignment causes incorrect LED behavior on one of the
> variants.
>
> Read the package variant from hardware strap register AN8811HB_HWTRAP2

Just for conformation, this is not an actually strap pin you connect a
resistor to, pull high/low, but a read only silicon bit.

Also, you called it a strap registers, yet the #define is TRAP?

> @@ -202,6 +214,7 @@ struct en8811h_priv {
> struct phy_device *phydev;
> unsigned int cko_is_enabled;
> struct mdio_device *pbusdev;
> + unsigned int pkg_sel;

bool?

Also, is_an8811hbcn would be a better name. It is hard to know what
true/false means for pkg_sel.

> + phydev_info(phydev, "%s detected\n",
> + priv->pkg_sel ? "AN8811HBCN" : "AN8811HBN");

No need to spam the log.

Andrew

---
pw-bot: cr