.. | .. |
---|
7 | 7 | * modify it under the terms of the GNU General Public License. |
---|
8 | 8 | */ |
---|
9 | 9 | |
---|
| 10 | +#include <linux/of_address.h> |
---|
10 | 11 | #include <linux/kernel.h> |
---|
11 | 12 | #include <linux/suspend.h> |
---|
12 | 13 | #include <linux/io.h> |
---|
.. | .. |
---|
15 | 16 | |
---|
16 | 17 | static int mx27_suspend_enter(suspend_state_t state) |
---|
17 | 18 | { |
---|
| 19 | + void __iomem *ccm_base; |
---|
| 20 | + struct device_node *np; |
---|
18 | 21 | 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 | + |
---|
19 | 27 | switch (state) { |
---|
20 | 28 | case PM_SUSPEND_MEM: |
---|
21 | 29 | /* 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); |
---|
23 | 31 | cscr &= 0xFFFFFFFC; |
---|
24 | | - imx_writel(cscr, MX27_IO_ADDRESS(MX27_CCM_BASE_ADDR)); |
---|
| 32 | + imx_writel(cscr, ccm_base); |
---|
25 | 33 | /* Executes WFI */ |
---|
26 | 34 | cpu_do_idle(); |
---|
27 | 35 | break; |
---|