[PATCH] ARM: imx: Init anatop regmap in imx_init_revision_from_anatop
From: Leonard Crestez <hidden>
Date: 2019-08-22 18:41:26
Subsystem:
arm port, the rest · Maintainers:
Russell King, Linus Torvalds
Restore initialization of the global "anatop" regmap because it's used
from suspend/resume code.
While we're at it use regmap to read digprog as well
Fixes: c901cfe5ada0 ("ARM: imx: Drop imx_anatop_init()")
Signed-off-by: Leonard Crestez <redacted>
---
This should be squashed into c901cfe5ada0
arch/arm/mach-imx/anatop.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-imx/anatop.c b/arch/arm/mach-imx/anatop.c
index f2c9fe14198a..7f2246b44c53 100644
--- a/arch/arm/mach-imx/anatop.c
+++ b/arch/arm/mach-imx/anatop.c@@ -93,25 +93,25 @@ void imx_anatop_post_resume(void) } void __init imx_init_revision_from_anatop(void) { struct device_node *np; - void __iomem *anatop_base; unsigned int revision; u32 digprog; u16 offset = ANADIG_DIGPROG; u8 major_part, minor_part; np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-anatop"); - anatop_base = of_iomap(np, 0); - WARN_ON(!anatop_base); + WARN_ON(!np); + anatop = syscon_regmap_lookup_by_compatible("fsl,imx6q-anatop"); + WARN_ON(!IS_ERR_OR_NULL(anatop)); + if (of_device_is_compatible(np, "fsl,imx6sl-anatop")) offset = ANADIG_DIGPROG_IMX6SL; if (of_device_is_compatible(np, "fsl,imx7d-anatop")) offset = ANADIG_DIGPROG_IMX7D; - digprog = readl_relaxed(anatop_base + offset); - iounmap(anatop_base); + regmap_read(anatop, offset, &digprog); /* * On i.MX7D digprog value match linux version format, so * it needn't map again and we can use register value directly. */
--
2.17.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel