lkml.org 
[lkml]   [2023]   [Mar]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH net-next v3 14/15] net: dsa: mt7530: introduce driver for MT7988 built-in switch
On Wed, Mar 29, 2023 at 06:57:54PM +0200, Andrew Lunn wrote:
> > @@ -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.

Afaik no devices with different built-in switches are in the pipe at
this time, so this should be fine for a while.

\
 
 \ /
  Last update: 2023-03-29 21:06    [W:0.036 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site