Re: [PATCH v6 4/4] phy: airoha: Add support for Airoha AN7581 USB PHY

From: Christian Marangi

Date: Sat Mar 07 2026 - 05:37:34 EST


On Sat, Mar 07, 2026 at 11:32:57AM +0100, Krzysztof Kozlowski wrote:
> On Fri, Mar 06, 2026 at 08:01:53PM +0100, Christian Marangi wrote:
> > + for (index = 0; index < AIROHA_PHY_USB_MAX; index++) {
> > + enum an7581_usb_phy_instance_type phy_type;
> > + struct an7581_usb_phy_instance *instance;
> > +
> > + switch (index) {
> > + case AIROHA_PHY_USB2:
> > + phy_type = PHY_TYPE_USB2;
> > + break;
> > + case AIROHA_PHY_USB3:
> > + phy_type = PHY_TYPE_USB3;
> > + break;
> > + }
> > +
> > + if (phy_type == PHY_TYPE_USB3) {
> > + ret = of_property_read_u32(dev->of_node, "airoha,usb3-serdes",
> > + &priv->serdes_port);
> > + if (ret)
> > + return dev_err_probe(dev, ret, "missing serdes line for USB 3.0\n");
> > +
> > + priv->scu = syscon_regmap_lookup_by_compatible("airoha,en7581-scu");
>
> Nope, you need phandle to express proper device links.
>
> Don't sprinkle compatible lookups for new code which does not need to
> keep things backwards compatible. How do you manage device links
> without phandle? How do you manage device probe ordering?
>

Hi,

the phandle to SCU was present in old implementation but later dropped as it was
said that it wouldn't describe the HW.

I will readd as airoha,scu. Is it ok for you?

(I actually prefer phandle than hardcoding compatible as it makes things more
descriptive and prevent all kind of problem in the future, so I'm more than
happy than using that)

--
Ansuel