All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: imx: Init anatop regmap in imx_init_revision_from_anatop
@ 2019-08-22 18:41 Leonard Crestez
  0 siblings, 0 replies; only message in thread
From: Leonard Crestez @ 2019-08-22 18:41 UTC (permalink / raw)
  To: Andrey Smirnov, Shawn Guo, Fabio Estevam
  Cc: Dong Aisheng, linux-imx, kernel, linux-arm-kernel

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(-)

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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-08-22 18:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-22 18:41 [PATCH] ARM: imx: Init anatop regmap in imx_init_revision_from_anatop Leonard Crestez

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.