diff options
author | John Crispin <blogic@openwrt.org> | 2015-01-17 14:24:56 +0000 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2015-01-17 14:24:56 +0000 |
commit | fc1b97243345202d7be48b908f21b3bb984f206d (patch) | |
tree | 3533fa891e28cfb7be1645bd34bdb9bf7ebb08a0 /target | |
parent | 940391d4d6970017c99a129d915b39ac5ff60ff8 (diff) | |
download | upstream-fc1b97243345202d7be48b908f21b3bb984f206d.tar.gz upstream-fc1b97243345202d7be48b908f21b3bb984f206d.tar.bz2 upstream-fc1b97243345202d7be48b908f21b3bb984f206d.zip |
ar8216: introduce ar8xxx_reg_clear complementing ar8xxx_reg_set
Introduce ar8xxx_reg_clear complementing ar8xxx_reg_set.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@44004 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
-rw-r--r-- | target/linux/generic/files/drivers/net/phy/ar8216.c | 10 | ||||
-rw-r--r-- | target/linux/generic/files/drivers/net/phy/ar8216.h | 6 | ||||
-rw-r--r-- | target/linux/generic/files/drivers/net/phy/ar8327.c | 10 |
3 files changed, 14 insertions, 12 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c b/target/linux/generic/files/drivers/net/phy/ar8216.c index 76dfcf4c01..2fd44253c8 100644 --- a/target/linux/generic/files/drivers/net/phy/ar8216.c +++ b/target/linux/generic/files/drivers/net/phy/ar8216.c @@ -957,13 +957,11 @@ ar8216_set_mirror_regs(struct ar8xxx_priv *priv) AR8216_GLOBAL_CPUPORT_MIRROR_PORT, (0xF << AR8216_GLOBAL_CPUPORT_MIRROR_PORT_S)); for (port = 0; port < AR8216_NUM_PORTS; port++) { - ar8xxx_rmw(priv, AR8216_REG_PORT_CTRL(port), - AR8216_PORT_CTRL_MIRROR_RX, - 0); + ar8xxx_reg_clear(priv, AR8216_REG_PORT_CTRL(port), + AR8216_PORT_CTRL_MIRROR_RX); - ar8xxx_rmw(priv, AR8216_REG_PORT_CTRL(port), - AR8216_PORT_CTRL_MIRROR_TX, - 0); + ar8xxx_reg_clear(priv, AR8216_REG_PORT_CTRL(port), + AR8216_PORT_CTRL_MIRROR_TX); } /* now enable mirroring if necessary */ diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.h b/target/linux/generic/files/drivers/net/phy/ar8216.h index 50f225258f..d3d044324e 100644 --- a/target/linux/generic/files/drivers/net/phy/ar8216.h +++ b/target/linux/generic/files/drivers/net/phy/ar8216.h @@ -536,4 +536,10 @@ ar8xxx_reg_set(struct ar8xxx_priv *priv, int reg, u32 val) ar8xxx_rmw(priv, reg, 0, val); } +static inline void +ar8xxx_reg_clear(struct ar8xxx_priv *priv, int reg, u32 val) +{ + ar8xxx_rmw(priv, reg, val, 0); +} + #endif diff --git a/target/linux/generic/files/drivers/net/phy/ar8327.c b/target/linux/generic/files/drivers/net/phy/ar8327.c index b69c33b123..f6d07c1982 100644 --- a/target/linux/generic/files/drivers/net/phy/ar8327.c +++ b/target/linux/generic/files/drivers/net/phy/ar8327.c @@ -865,13 +865,11 @@ ar8327_set_mirror_regs(struct ar8xxx_priv *priv) AR8327_FWD_CTRL0_MIRROR_PORT, (0xF << AR8327_FWD_CTRL0_MIRROR_PORT_S)); for (port = 0; port < AR8327_NUM_PORTS; port++) { - ar8xxx_rmw(priv, AR8327_REG_PORT_LOOKUP(port), - AR8327_PORT_LOOKUP_ING_MIRROR_EN, - 0); + ar8xxx_reg_clear(priv, AR8327_REG_PORT_LOOKUP(port), + AR8327_PORT_LOOKUP_ING_MIRROR_EN); - ar8xxx_rmw(priv, AR8327_REG_PORT_HOL_CTRL1(port), - AR8327_PORT_HOL_CTRL1_EG_MIRROR_EN, - 0); + ar8xxx_reg_clear(priv, AR8327_REG_PORT_HOL_CTRL1(port), + AR8327_PORT_HOL_CTRL1_EG_MIRROR_EN); } /* now enable mirroring if necessary */ |