OSDN Git Service

net: stmmac: dwmac-sun8i: Use regmap_field for syscon register access
authorChen-Yu Tsai <wens@csie.org>
Sun, 13 May 2018 19:14:22 +0000 (03:14 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 14 May 2018 19:06:54 +0000 (15:06 -0400)
commit25ae15fb0ecda594306937ebf9ea65b7d0c4f592
treea3993c55860a32d798c5f4c0246a32f333343e0d
parenteef8811d9219d197d158cda9233ce2f78ea0a790
net: stmmac: dwmac-sun8i: Use regmap_field for syscon register access

On the Allwinner R40, the "GMAC clock" register is located in the CCU
block, at a different register address than the other SoCs that have
it in the "system control" block.

This patch converts the use of regmap to regmap_field for mapping and
accessing the syscon register, so we can have the register address in
the variants data, and not in the actual register manipulation code.

This patch only converts regmap_read() and regmap_write() calls to
regmap_field_read() and regmap_field_write() calls. There are some
places where it might make sense to switch to regmap_field_update_bits(),
but this is not done here to keep the patch simple.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c