netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Golle <daniel@makrotopia.org>
To: "Arınç ÜNAL" <arinc.unal@arinc9.com>
Cc: netdev@vger.kernel.org, linux-mediatek@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	"Russell King" <linux@armlinux.org.uk>,
	"Heiner Kallweit" <hkallweit1@gmail.com>,
	"Lorenzo Bianconi" <lorenzo@kernel.org>,
	"Mark Lee" <Mark-MC.Lee@mediatek.com>,
	"John Crispin" <john@phrozen.org>, "Felix Fietkau" <nbd@nbd.name>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"DENG Qingfang" <dqfext@gmail.com>,
	"Landen Chao" <Landen.Chao@mediatek.com>,
	"Sean Wang" <sean.wang@mediatek.com>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Eric Dumazet" <edumazet@google.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Vladimir Oltean" <olteanv@gmail.com>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"Andrew Lunn" <andrew@lunn.ch>,
	"Vladimir Oltean" <vladimir.oltean@nxp.com>,
	"Bjørn Mork" <bjorn@mork.no>,
	"Frank Wunderlich" <frank-w@public-files.de>,
	"Alexander Couzens" <lynxis@fe80.eu>
Subject: Re: [PATCH net-next v13 11/16] net: dsa: mt7530: use external PCS driver
Date: Tue, 14 Mar 2023 17:45:13 +0000	[thread overview]
Message-ID: <ZBCyqdfaeF/q8oZr@makrotopia.org> (raw)
In-Reply-To: <e99cc7d1-554d-5d4d-e69a-a38ded02bb08@arinc9.com>

On Tue, Mar 14, 2023 at 08:16:35PM +0300, Arınç ÜNAL wrote:
> On 9.03.2023 13:57, Daniel Golle wrote:
> > [...]
> > +static int mt7530_regmap_read(void *context, unsigned int reg, unsigned int *val)
> > +{
> > +	struct mt7530_priv *priv = context;
> > +
> > +	*val = mt7530_read(priv, reg);
> > +	return 0;
> > +};
> > +
> > +static int mt7530_regmap_write(void *context, unsigned int reg, unsigned int val)
> > +{
> > +	struct mt7530_priv *priv = context;
> > +
> > +	mt7530_write(priv, reg, val);
> > +	return 0;
> > +};
> > +
> > +static int mt7530_regmap_update_bits(void *context, unsigned int reg,
> > +				     unsigned int mask, unsigned int val)
> > +{
> > +	struct mt7530_priv *priv = context;
> > +
> > +	mt7530_rmw(priv, reg, mask, val);
> > +	return 0;
> > +};
> > +
> > +static const struct regmap_bus mt7531_regmap_bus = {
> > +	.reg_write = mt7530_regmap_write,
> > +	.reg_read = mt7530_regmap_read,
> > +	.reg_update_bits = mt7530_regmap_update_bits,
> 
> These new functions can be used for both switches, mt7530 and mt7531,
> correct?

In theory, yes, they could be used on all switch ICs supported by the
mt7530.c driver. In practise they are used on MT7531 only because MT7530
and MT7621 don't have any SGMII/SerDes ports, but only MT7531 does.


> If so, I believe they are supposed to be called mt753x since
> 88bdef8be9f6 ("net: dsa: mt7530: Extend device data ready for adding a new
> hardware").
> 
> mt753x: functions that can be used for mt7530 and mt7531 switches.
> mt7530: functions specific to mt7530 switch.
> mt7531: functions specific to mt7531 switch.

Good catch, so mt7530_* is for sure not accurate. I used that naming
due to existing function names mt7530_read, mt7530_write and mt7530_rmw.

Given the situation I've explained above I think that mt753x_* would
be the best and I will change that for v14.

Thank you for reviewing!


Daniel

  reply	other threads:[~2023-03-14 17:45 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-09 10:54 [PATCH net-next v13 00/16] net: ethernet: mtk_eth_soc: various enhancements Daniel Golle
2023-03-09 10:54 ` [PATCH net-next v13 01/16] net: ethernet: mtk_eth_soc: add support for MT7981 SoC Daniel Golle
2023-03-09 10:55 ` [PATCH net-next v13 02/16] dt-bindings: net: mediatek,net: add mt7981-eth binding Daniel Golle
2023-03-09 10:55 ` [PATCH net-next v13 03/16] dt-bindings: arm: mediatek: sgmiisys: Convert to DT schema Daniel Golle
2023-03-09 10:55 ` [PATCH net-next v13 04/16] dt-bindings: arm: mediatek: sgmiisys: add MT7981 SoC Daniel Golle
2023-03-09 10:56 ` [PATCH net-next v13 05/16] net: ethernet: mtk_eth_soc: set MDIO bus clock frequency Daniel Golle
2023-03-09 10:56 ` [PATCH net-next v13 06/16] net: ethernet: mtk_eth_soc: reset PCS state Daniel Golle
2023-03-09 10:56 ` [PATCH net-next v13 07/16] net: ethernet: mtk_eth_soc: only write values if needed Daniel Golle
2023-03-09 10:56 ` [PATCH net-next v13 08/16] net: ethernet: mtk_eth_soc: ppe: add support for flow accounting Daniel Golle
2023-03-09 10:57 ` [PATCH net-next v13 09/16] net: pcs: add driver for MediaTek SGMII PCS Daniel Golle
2023-03-09 10:57 ` [PATCH net-next v13 10/16] net: ethernet: mtk_eth_soc: switch to external PCS driver Daniel Golle
2023-03-10 11:10   ` Aw: " Frank Wunderlich
2023-03-09 10:57 ` [PATCH net-next v13 11/16] net: dsa: mt7530: use " Daniel Golle
2023-03-10 11:08   ` Aw: " Frank Wunderlich
2023-03-14 17:16   ` Arınç ÜNAL
2023-03-14 17:45     ` Daniel Golle [this message]
2023-03-14 18:21       ` Arınç ÜNAL
2023-03-14 19:53         ` Vladimir Oltean
2023-03-14 20:59           ` Arınç ÜNAL
2023-03-14 22:34             ` Vladimir Oltean
2023-03-14 23:11               ` Russell King (Oracle)
2023-03-15  9:31               ` Arınç ÜNAL
2023-03-09 10:58 ` [PATCH net-next v13 12/16] net: ethernet: mtk_eth_soc: add MTK_NETSYS_V1 capability bit Daniel Golle
2023-03-09 10:58 ` [PATCH net-next v13 13/16] net: ethernet: mtk_eth_soc: move MAX_DEVS in mtk_soc_data Daniel Golle
2023-03-09 10:58 ` [PATCH net-next v13 14/16] net: ethernet: mtk_eth_soc: rely on num_devs and remove MTK_MAC_COUNT Daniel Golle
2023-03-09 10:58 ` [PATCH net-next v13 15/16] net: ethernet: mtk_eth_soc: add MTK_NETSYS_V3 capability bit Daniel Golle
2023-03-09 10:58 ` [PATCH net-next v13 16/16] net: ethernet: mtk_eth_soc: convert caps in mtk_soc_data struct to u64 Daniel Golle
2023-03-13 23:53   ` Jakub Kicinski
2023-03-13 23:51 ` [PATCH net-next v13 00/16] net: ethernet: mtk_eth_soc: various enhancements Jakub Kicinski

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=ZBCyqdfaeF/q8oZr@makrotopia.org \
    --to=daniel@makrotopia.org \
    --cc=Landen.Chao@mediatek.com \
    --cc=Mark-MC.Lee@mediatek.com \
    --cc=andrew@lunn.ch \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=arinc.unal@arinc9.com \
    --cc=bjorn@mork.no \
    --cc=davem@davemloft.net \
    --cc=dqfext@gmail.com \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=frank-w@public-files.de \
    --cc=hkallweit1@gmail.com \
    --cc=john@phrozen.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=lorenzo@kernel.org \
    --cc=lynxis@fe80.eu \
    --cc=matthias.bgg@gmail.com \
    --cc=nbd@nbd.name \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=sean.wang@mediatek.com \
    --cc=vladimir.oltean@nxp.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).