From: Landen Chao <landen.chao@mediatek.com>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: "mark.rutland@arm.com" <mark.rutland@arm.com>,
"andrew@lunn.ch" <andrew@lunn.ch>,
"frank-w@public-files.de" <frank-w@public-files.de>,
Sean Wang <Sean.Wang@mediatek.com>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"vivien.didelot@savoirfairelinux.com"
<vivien.didelot@savoirfairelinux.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"opensource@vdorst.com" <opensource@vdorst.com>,
"robh+dt@kernel.org" <robh+dt@kernel.org>,
"linux-mediatek@lists.infradead.org"
<linux-mediatek@lists.infradead.org>,
"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
"davem@davemloft.net" <davem@davemloft.net>
Subject: Re: [PATCH net-next 2/6] net: dsa: mt7530: Extend device data ready for adding a new hardware
Date: Thu, 12 Dec 2019 23:05:22 +0800 [thread overview]
Message-ID: <1576163122.18168.2.camel@mtksdccf07> (raw)
In-Reply-To: <d77e3109-e022-3581-2ca8-02889c5ddbf4@gmail.com>
On Thu, 2019-12-12 at 11:45 +0800, Florian Fainelli wrote:
>
> On 12/10/2019 12:14 AM, Landen Chao wrote:
> > Add a structure holding required operations for each device such as device
> > initialization, PHY port read or write, a checker whether PHY interface is
> > supported on a certain port, MAC port setup for either bus pad or a
> > specific PHY interface.
> >
> > The patch is done for ready adding a new hardware MT7531.
> >
> > Signed-off-by: Landen Chao <landen.chao@mediatek.com>
> > Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> > ---
> [snip]
>
> > diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
> > index ed1ec10ec62b..9a648d1f5d09 100644
> > --- a/drivers/net/dsa/mt7530.c
> > +++ b/drivers/net/dsa/mt7530.c
> > @@ -425,7 +425,7 @@ mt7530_fdb_write(struct mt7530_priv *priv, u16 vid,
> > }
> >
> > static int
> > -mt7530_pad_clk_setup(struct dsa_switch *ds, int mode)
> > +mt7530_pad_clk_setup(struct dsa_switch *ds, phy_interface_t mode)
>
> Here you pass a phy_interface_t argument but not in mt7632_pad_clk_setup().
>
> > +static int
> > +mt7530_pad_setup(struct dsa_switch *ds, const struct phylink_link_state *state)
> > +{
> > + struct mt7530_priv *priv = ds->priv;
> > +
> > + /* Setup TX circuit incluing relevant PAD and driving */
> > + mt7530_pad_clk_setup(ds, state->interface);
> > +
> > + if (priv->id == ID_MT7530) {
> > + /* Setup RX circuit, relevant PAD and driving on the
> > + * host which must be placed after the setup on the
> > + * device side is all finished.
> > + */
> > + mt7623_pad_clk_setup(ds);
>
> Would not it make sense to pass it down here as well for consistency?
mt7623_pad_clk() contains the setting for PHY_INTERFACE_MODE_TRGMII. It
is really better to pass phy_interface_t for error handling.
>
> [snip]
>
> > @@ -1660,8 +1768,19 @@ mt7530_probe(struct mdio_device *mdiodev)
> > /* Get the hardware identifier from the devicetree node.
> > * We will need it for some of the clock and regulator setup.
> > */
> > - priv->id = (unsigned int)(unsigned long)
> > - of_device_get_match_data(&mdiodev->dev);
> > + priv->info = of_device_get_match_data(&mdiodev->dev);
> > + if (!priv->info)
> > + return -EINVAL;
> > +
> > + /* Sanity check if these required device operstaions are filled
> > + * properly.
>
> Typo: operations.
Oops, sorry. I'll correct it.
Landen
>
> Other than that, this looks okay to me.
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
WARNING: multiple messages have this Message-ID (diff)
From: Landen Chao <landen.chao@mediatek.com>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: "andrew@lunn.ch" <andrew@lunn.ch>,
"vivien.didelot@savoirfairelinux.com"
<vivien.didelot@savoirfairelinux.com>,
"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
"robh+dt@kernel.org" <robh+dt@kernel.org>,
"mark.rutland@arm.com" <mark.rutland@arm.com>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-mediatek@lists.infradead.org"
<linux-mediatek@lists.infradead.org>,
"davem@davemloft.net" <davem@davemloft.net>,
Sean Wang <Sean.Wang@mediatek.com>,
"opensource@vdorst.com" <opensource@vdorst.com>,
"frank-w@public-files.de" <frank-w@public-files.de>
Subject: Re: [PATCH net-next 2/6] net: dsa: mt7530: Extend device data ready for adding a new hardware
Date: Thu, 12 Dec 2019 23:05:22 +0800 [thread overview]
Message-ID: <1576163122.18168.2.camel@mtksdccf07> (raw)
In-Reply-To: <d77e3109-e022-3581-2ca8-02889c5ddbf4@gmail.com>
On Thu, 2019-12-12 at 11:45 +0800, Florian Fainelli wrote:
>
> On 12/10/2019 12:14 AM, Landen Chao wrote:
> > Add a structure holding required operations for each device such as device
> > initialization, PHY port read or write, a checker whether PHY interface is
> > supported on a certain port, MAC port setup for either bus pad or a
> > specific PHY interface.
> >
> > The patch is done for ready adding a new hardware MT7531.
> >
> > Signed-off-by: Landen Chao <landen.chao@mediatek.com>
> > Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> > ---
> [snip]
>
> > diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
> > index ed1ec10ec62b..9a648d1f5d09 100644
> > --- a/drivers/net/dsa/mt7530.c
> > +++ b/drivers/net/dsa/mt7530.c
> > @@ -425,7 +425,7 @@ mt7530_fdb_write(struct mt7530_priv *priv, u16 vid,
> > }
> >
> > static int
> > -mt7530_pad_clk_setup(struct dsa_switch *ds, int mode)
> > +mt7530_pad_clk_setup(struct dsa_switch *ds, phy_interface_t mode)
>
> Here you pass a phy_interface_t argument but not in mt7632_pad_clk_setup().
>
> > +static int
> > +mt7530_pad_setup(struct dsa_switch *ds, const struct phylink_link_state *state)
> > +{
> > + struct mt7530_priv *priv = ds->priv;
> > +
> > + /* Setup TX circuit incluing relevant PAD and driving */
> > + mt7530_pad_clk_setup(ds, state->interface);
> > +
> > + if (priv->id == ID_MT7530) {
> > + /* Setup RX circuit, relevant PAD and driving on the
> > + * host which must be placed after the setup on the
> > + * device side is all finished.
> > + */
> > + mt7623_pad_clk_setup(ds);
>
> Would not it make sense to pass it down here as well for consistency?
mt7623_pad_clk() contains the setting for PHY_INTERFACE_MODE_TRGMII. It
is really better to pass phy_interface_t for error handling.
>
> [snip]
>
> > @@ -1660,8 +1768,19 @@ mt7530_probe(struct mdio_device *mdiodev)
> > /* Get the hardware identifier from the devicetree node.
> > * We will need it for some of the clock and regulator setup.
> > */
> > - priv->id = (unsigned int)(unsigned long)
> > - of_device_get_match_data(&mdiodev->dev);
> > + priv->info = of_device_get_match_data(&mdiodev->dev);
> > + if (!priv->info)
> > + return -EINVAL;
> > +
> > + /* Sanity check if these required device operstaions are filled
> > + * properly.
>
> Typo: operations.
Oops, sorry. I'll correct it.
Landen
>
> Other than that, this looks okay to me.
next prev parent reply other threads:[~2019-12-12 15:05 UTC|newest]
Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-10 8:14 [PATCH net-next 0/6] net-next: dsa: mt7530: add support for MT7531 Landen Chao
2019-12-10 8:14 ` Landen Chao
2019-12-10 8:14 ` [PATCH net-next 1/6] net: dsa: mt7530: Refine message in Kconfig Landen Chao
2019-12-10 8:14 ` Landen Chao
2019-12-12 3:41 ` Florian Fainelli
2019-12-12 3:41 ` Florian Fainelli
2019-12-10 8:14 ` [PATCH net-next 2/6] net: dsa: mt7530: Extend device data ready for adding a new hardware Landen Chao
2019-12-10 8:14 ` Landen Chao
2019-12-12 3:45 ` Florian Fainelli
2019-12-12 3:45 ` Florian Fainelli
2019-12-12 15:03 ` Landen Chao
2019-12-12 15:03 ` Landen Chao
2019-12-12 15:05 ` Landen Chao [this message]
2019-12-12 15:05 ` Landen Chao
2019-12-10 8:14 ` [PATCH net-next 3/6] dt-bindings: net: dsa: add new MT7531 binding to support MT7531 Landen Chao
2019-12-10 8:14 ` Landen Chao
2019-12-10 16:20 ` Andrew Lunn
2019-12-10 16:20 ` Andrew Lunn
2019-12-11 14:10 ` Landen Chao
2019-12-11 14:10 ` Landen Chao
2019-12-12 3:46 ` Florian Fainelli
2019-12-12 3:46 ` Florian Fainelli
2019-12-10 8:14 ` [PATCH net-next 4/6] net: dsa: mt7530: Add the support of MT7531 switch Landen Chao
2019-12-10 8:14 ` Landen Chao
2019-12-10 16:35 ` Andrew Lunn
2019-12-10 16:35 ` Andrew Lunn
2019-12-10 17:05 ` Vladimir Oltean
2019-12-10 17:05 ` Vladimir Oltean
2019-12-10 20:33 ` Marek Behun
2019-12-10 20:33 ` Marek Behun
2019-12-10 22:02 ` Andrew Lunn
2019-12-10 22:02 ` Andrew Lunn
2019-12-11 17:35 ` Landen Chao
2019-12-11 17:35 ` Landen Chao
2019-12-10 16:44 ` Andrew Lunn
2019-12-10 16:44 ` Andrew Lunn
2019-12-11 18:18 ` Landen Chao
2019-12-11 18:18 ` Landen Chao
2019-12-11 19:27 ` Andrew Lunn
2019-12-11 19:27 ` Andrew Lunn
2019-12-12 15:04 ` Landen Chao
2019-12-12 15:04 ` Landen Chao
2019-12-10 16:48 ` Andrew Lunn
2019-12-10 16:48 ` Andrew Lunn
2019-12-11 17:48 ` Landen Chao
2019-12-11 17:48 ` Landen Chao
2019-12-12 3:57 ` Florian Fainelli
2019-12-12 3:57 ` Florian Fainelli
2019-12-12 16:24 ` Landen Chao
2019-12-12 16:24 ` Landen Chao
2019-12-10 8:14 ` [PATCH net-next 5/6] arm64: dts: mt7622: add mt7531 dsa to mt7622-rfb1 board Landen Chao
2019-12-10 8:14 ` Landen Chao
2019-12-10 16:51 ` Andrew Lunn
2019-12-10 16:51 ` Andrew Lunn
2019-12-11 18:27 ` Landen Chao
2019-12-11 18:27 ` Landen Chao
2019-12-10 8:14 ` [PATCH net-next 6/6] arm64: dts: mt7622: add mt7531 dsa to bananapi-bpi-r64 board Landen Chao
2019-12-10 8:14 ` Landen Chao
2019-12-10 11:37 ` Aw: [PATCH net-next 0/6] net-next: dsa: mt7530: add support for MT7531 Frank Wunderlich
2019-12-10 11:37 ` Frank Wunderlich
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=1576163122.18168.2.camel@mtksdccf07 \
--to=landen.chao@mediatek.com \
--cc=Sean.Wang@mediatek.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=f.fainelli@gmail.com \
--cc=frank-w@public-files.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=mark.rutland@arm.com \
--cc=matthias.bgg@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=opensource@vdorst.com \
--cc=robh+dt@kernel.org \
--cc=vivien.didelot@savoirfairelinux.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.