OSDN Git Service

net: stmmac: dwmac-sun8i: Allow getting syscon regmap from external device
authorChen-Yu Tsai <wens@csie.org>
Sun, 13 May 2018 19:14:23 +0000 (03:14 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 14 May 2018 19:06:54 +0000 (15:06 -0400)
commit49a06cae6e7ceb77f17914c4617309e038c24c4d
tree7da54aac7b13aeab02e335037f04371a539c0690
parent25ae15fb0ecda594306937ebf9ea65b7d0c4f592
net: stmmac: dwmac-sun8i: Allow getting syscon regmap from external device

On the Allwinner R40 SoC, the "GMAC clock" register is in the CCU
address space. Using a standard syscon to access it provides no
coordination with the CCU driver for register access. Neither does
it prevent this and other drivers from accessing other, maybe critical,
clock control registers. On other SoCs, the register is in the "system
control" address space, which might also contain controls for mapping
SRAM to devices or the CPU. This hardware has the same issues.

Instead, for these types of setups, we let the device containing the
control register create a regmap tied to it. We can then get the device
from the existing syscon phandle, and retrieve the regmap with
dev_get_regmap().

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