Merge tag 'armsoc-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc
[sfrench/cifs-2.6.git] / arch / arm / mach-imx / pm-imx27.c
index d943535566c84146b7877a790bb2718cf8672d45..020e6deb67c8c6e9de192905d839b84ec994837d 100644 (file)
@@ -7,6 +7,7 @@
  * modify it under the terms of the GNU General Public License.
  */
 
+#include <linux/of_address.h>
 #include <linux/kernel.h>
 #include <linux/suspend.h>
 #include <linux/io.h>
 
 static int mx27_suspend_enter(suspend_state_t state)
 {
+       void __iomem *ccm_base;
+       struct device_node *np;
        u32 cscr;
+
+       np = of_find_compatible_node(NULL, NULL, "fsl,imx27-ccm");
+       ccm_base = of_iomap(np, 0);
+       BUG_ON(!ccm_base);
+
        switch (state) {
        case PM_SUSPEND_MEM:
                /* Clear MPEN and SPEN to disable MPLL/SPLL */
-               cscr = imx_readl(MX27_IO_ADDRESS(MX27_CCM_BASE_ADDR));
+               cscr = imx_readl(ccm_base);
                cscr &= 0xFFFFFFFC;
-               imx_writel(cscr, MX27_IO_ADDRESS(MX27_CCM_BASE_ADDR));
+               imx_writel(cscr, ccm_base);
                /* Executes WFI */
                cpu_do_idle();
                break;