[RFC PATCH net-next v3 14/15] net: dsa: mt7530: introduce driver for MT7988 built-in switch
Andrew Lunn
andrew at lunn.ch
Wed Mar 29 09:57:54 PDT 2023
> @@ -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
More information about the linux-arm-kernel
mailing list