From: Florian Fainelli <f.fainelli@gmail.com>
To: Landen Chao <landen.chao@mediatek.com>,
andrew@lunn.ch, vivien.didelot@savoirfairelinux.com,
matthias.bgg@gmail.com, robh+dt@kernel.org, mark.rutland@arm.com
Cc: devicetree@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
davem@davemloft.net, sean.wang@mediatek.com,
opensource@vdorst.com, 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: Wed, 11 Dec 2019 19:45:51 -0800 [thread overview]
Message-ID: <d77e3109-e022-3581-2ca8-02889c5ddbf4@gmail.com> (raw)
In-Reply-To: <2d546d6bb15ff8b4b75af2220e20db4e634f4145.1575914275.git.landen.chao@mediatek.com>
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?
[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.
Other than that, this looks okay to me.
--
Florian
next prev parent reply other threads:[~2019-12-12 3:46 UTC|newest]
Thread overview: 30+ 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 ` [PATCH net-next 1/6] net: dsa: mt7530: Refine message in Kconfig Landen Chao
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-12 3:45 ` Florian Fainelli [this message]
2019-12-12 15:03 ` Landen Chao
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 16:20 ` Andrew Lunn
2019-12-11 14:10 ` Landen Chao
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 16:35 ` Andrew Lunn
2019-12-10 17:05 ` Vladimir Oltean
2019-12-10 20:33 ` Marek Behun
2019-12-10 22:02 ` Andrew Lunn
2019-12-11 17:35 ` Landen Chao
2019-12-10 16:44 ` Andrew Lunn
2019-12-11 18:18 ` Landen Chao
2019-12-11 19:27 ` Andrew Lunn
2019-12-12 15:04 ` Landen Chao
2019-12-10 16:48 ` Andrew Lunn
2019-12-11 17:48 ` Landen Chao
2019-12-12 3:57 ` Florian Fainelli
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 16:51 ` Andrew Lunn
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 11:37 ` Aw: [PATCH net-next 0/6] net-next: dsa: mt7530: add support for MT7531 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=d77e3109-e022-3581-2ca8-02889c5ddbf4@gmail.com \
--to=f.fainelli@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=frank-w@public-files.de \
--cc=landen.chao@mediatek.com \
--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=sean.wang@mediatek.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).