@@ -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.
*/
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 <leonard.crestez@nxp.com> --- This should be squashed into c901cfe5ada0 arch/arm/mach-imx/anatop.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)