net: dsa: mt7530: move MT753X_MTRAP operations for MT7530
authorArınç ÜNAL <arinc.unal@arinc9.com>
Mon, 22 Apr 2024 07:15:14 +0000 (10:15 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 24 Apr 2024 10:57:02 +0000 (11:57 +0100)
commit377174c5760cd23322f23f999f8a104d8133a72a
tree6a5e7c1c0c15be9d89f2a9835fd54a1149097774
parent7c8d14029dffaa1e9d2bb0bb9226469e00e95f9f
net: dsa: mt7530: move MT753X_MTRAP operations for MT7530

On MT7530, the media-independent interfaces of port 5 and 6 are controlled
by the MT7530_P5_DIS and MT7530_P6_DIS bits of the hardware trap. Deal with
these bits only when the relevant port is being enabled or disabled. This
ensures that these ports will be disabled when they are not in use.

Do not set MT7530_CHG_TRAP on mt7530_setup_port5() as that's already being
done on mt7530_setup().

Instead of globally setting MT7530_P5_MAC_SEL, clear it, then set it only
on the appropriate case.

If PHY muxing is detected, clear MT7530_P5_DIS before calling
mt7530_setup_port5().

Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/mt7530.c