From: Sascha Hauer <sha@pengutronix.de>
To: Yegor Yefremov <yegorslists@googlemail.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH v2] net: phy: add driver for MotorComm PHY
Date: Fri, 9 Jun 2023 08:15:21 +0200 [thread overview]
Message-ID: <20230609061521.GK18491@pengutronix.de> (raw)
In-Reply-To: <CAGm1_ku-9qaGMZsEO0ME90rd3dnf5Q12XwjfUpYeXwciNmYvnw@mail.gmail.com>
On Thu, Jun 08, 2023 at 12:48:47PM +0200, Yegor Yefremov wrote:
> Hi Sascha,
>
> On Tue, Jun 6, 2023 at 11:58 AM Sascha Hauer <sha@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?
It is PHY_ID_MATCH_EXACT() in the kernel, so should be 0xffffffff.
Sascha
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2023-06-09 6:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-06 8:17 yegorslists
2023-06-06 8:21 ` Yegor Yefremov
2023-06-06 9:58 ` Sascha Hauer
2023-06-08 10:48 ` Yegor Yefremov
2023-06-09 6:15 ` Sascha Hauer [this message]
2023-06-09 6:17 ` Sascha Hauer
2023-06-06 9:57 ` Sascha Hauer
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=20230609061521.GK18491@pengutronix.de \
--to=sha@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=yegorslists@googlemail.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