[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8fe9c1b6-a533-4ad9-8a23-4f16547476ed@lunn.ch>
Date: Wed, 29 Mar 2023 18:57:54 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Daniel Golle <daniel@...rotopia.org>
Cc: netdev@...r.kernel.org, linux-mediatek@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
Florian Fainelli <f.fainelli@...il.com>,
Vladimir Oltean <olteanv@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>,
Sean Wang <sean.wang@...iatek.com>,
Landen Chao <Landen.Chao@...iatek.com>,
DENG Qingfang <dqfext@...il.com>,
Philipp Zabel <p.zabel@...gutronix.de>,
Sam Shih <Sam.Shih@...iatek.com>,
Lorenzo Bianconi <lorenzo@...nel.org>,
John Crispin <john@...ozen.org>, Felix Fietkau <nbd@....name>
Subject: Re: [RFC PATCH net-next v3 14/15] net: dsa: mt7530: introduce driver
for MT7988 built-in switch
> @@ -18,6 +18,7 @@ enum mt753x_id {
> ID_MT7530 = 0,
> ID_MT7621 = 1,
> ID_MT7531 = 2,
> + ID_MT7988 = 3,
> };
>
> #define NUM_TRGMII_CTRL 5
> @@ -54,11 +55,11 @@ enum mt753x_id {
> #define MT7531_MIRROR_PORT_SET(x) (((x) & MIRROR_MASK) << 16)
> #define MT7531_CPU_PMAP_MASK GENMASK(7, 0)
>
> -#define MT753X_MIRROR_REG(id) (((id) == ID_MT7531) ? \
> +#define MT753X_MIRROR_REG(id) ((((id) == ID_MT7531) || ((id) == ID_MT7988)) ? \
> MT7531_CFC : MT7530_MFC)
> -#define MT753X_MIRROR_EN(id) (((id) == ID_MT7531) ? \
> +#define MT753X_MIRROR_EN(id) ((((id) == ID_MT7531) || ((id) == ID_MT7988)) ? \
> MT7531_MIRROR_EN : MIRROR_EN)
> -#define MT753X_MIRROR_MASK(id) (((id) == ID_MT7531) ? \
> +#define MT753X_MIRROR_MASK(id) ((((id) == ID_MT7531) || ((id) == ID_MT7988)) ? \
> MT7531_MIRROR_MASK : MIRROR_MASK)
Are there more devices coming soon? I'm just wondering if these should
change into static inline functions with a switch statement? The
current code is not going to scale too much more.
Andrew
Powered by blists - more mailing lists