forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 748e4f3d702def1a4bff191e0cf93b6a05340f01
kernel/arch/arm/mach-imx/pm-imx27.c
....@@ -7,6 +7,7 @@
77 * modify it under the terms of the GNU General Public License.
88 */
99
10
+#include <linux/of_address.h>
1011 #include <linux/kernel.h>
1112 #include <linux/suspend.h>
1213 #include <linux/io.h>
....@@ -15,13 +16,20 @@
1516
1617 static int mx27_suspend_enter(suspend_state_t state)
1718 {
19
+ void __iomem *ccm_base;
20
+ struct device_node *np;
1821 u32 cscr;
22
+
23
+ np = of_find_compatible_node(NULL, NULL, "fsl,imx27-ccm");
24
+ ccm_base = of_iomap(np, 0);
25
+ BUG_ON(!ccm_base);
26
+
1927 switch (state) {
2028 case PM_SUSPEND_MEM:
2129 /* Clear MPEN and SPEN to disable MPLL/SPLL */
22
- cscr = imx_readl(MX27_IO_ADDRESS(MX27_CCM_BASE_ADDR));
30
+ cscr = imx_readl(ccm_base);
2331 cscr &= 0xFFFFFFFC;
24
- imx_writel(cscr, MX27_IO_ADDRESS(MX27_CCM_BASE_ADDR));
32
+ imx_writel(cscr, ccm_base);
2533 /* Executes WFI */
2634 cpu_do_idle();
2735 break;