soc: imx8m: Cleanup with adding imx8m_soc_[un]prepare
authorPeng Fan <peng.fan@nxp.com>
Wed, 23 Apr 2025 14:37:04 +0000 (22:37 +0800)
committerShawn Guo <shawnguo@kernel.org>
Fri, 9 May 2025 10:16:28 +0000 (18:16 +0800)
commit390c01073f5d0bd64db37926ddb232f33b83620d
treeaf9595d7036e75855d75f32be1a51949347a6e61
parent0af2f6be1b4281385b618cb86ad946eded089ac8
soc: imx8m: Cleanup with adding imx8m_soc_[un]prepare

There is a common flow to i.MX8M family, map OCOTP register base and
enable ocotp clk first before read Unique ID from OCOTP.

So introduce imx8m_soc_prepare to do ioremap and enable the ocotp clk,
and introduce imx8m_soc_unprepare to disable the clk and do iounmap.

With this patch, no need to spread the ioremap and clk handling in
each soc_revision hook.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
drivers/soc/imx/soc-imx8m.c