[PATCH v2] net: phy: add driver for MotorComm PHY
Yegor Yefremov
yegorslists at googlemail.com
Thu Jun 8 03:48:47 PDT 2023
Hi Sascha,
On Tue, Jun 6, 2023 at 11:58 AM Sascha Hauer <sha at pengutronix.de> wrote:
>
> Hi Yegor,
>
> On Tue, Jun 06, 2023 at 10:21:39AM +0200, Yegor Yefremov wrote:
> > Hi Sascha,
> >
> >
> > > + ret = phy_modify(phydev, YT8511_PAGE, YT8511_DELAY_FE_TX_EN, fe);
> > > + if (ret < 0)
> > > + goto err_restore_page;
> > > +
> > > + /* leave pll enabled in sleep */
> > > + ret = phy_write(phydev, YT8511_PAGE_SELECT, YT8511_EXT_SLEEP_CTRL);
> > > + if (ret < 0)
> > > + goto err_restore_page;
> > > +
> > > + ret = phy_modify(phydev, YT8511_PAGE, 0, YT8511_PLLON_SLP);
> > > + if (ret < 0)
> > > + goto err_restore_page;
> > > +
> > > +err_restore_page:
> > > + return phy_restore_page(phydev, oldpage, ret);
> >
> > As for this approach, it is also used by some other drivers in the Linux kernel:
> >
> > drivers/net/phy/realtek.c
> > drivers/net/phy/icplus.c
>
> It's ok like this. I didn't realize phy_restore_page() takes ret as
> argument and returns it.
The driver doesn't use a phy_id_mask for now and it causes problems
that unknown PHY will be assigned to MotorComm. What mask should I
use? 0xfffffff or 0x00000fff?
Regards,
Yegor
More information about the barebox
mailing list