]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commite6c8699fd862f5b4d8142488ecb22ff3cfbd54bd
tree7da54aac7b13aeab02e335037f04371a539c0690
parentbeaa2051834983e47aaf39075ebc815d780516b3
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