summaryrefslogtreecommitdiff
path: root/arch/arm/mach-imx/pm-vf610.c
diff options
context:
space:
mode:
authorBhuvanchandra DV <bhuvanchandra.dv@toradex.com>2016-10-22 01:03:13 +0530
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2017-01-11 15:43:47 +0100
commit3816bd77aad30bee3904358faa286b32c2b35b92 (patch)
treef7a1ba2834ce81cfc055f4b1f7d5574c4625c3ae /arch/arm/mach-imx/pm-vf610.c
parent7ccb5e5585c937a86b4f42ee38d310d1b8bba15c (diff)
ARM: vf610: PM: register power_off function
By registering a power_off command the kernel does not go to halt state but instead tries to power off. Our power off function sets the SoC in a low power stop mode, which essentially turns itself off almost completely. Code snippet is taken from 3.0 kernel: http://git.toradex.com/cgit/linux-toradex.git/commit/?h=colibri&id=28fc68ba39c7a2210f2bb11f866f20731f0918bd Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com> Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Diffstat (limited to 'arch/arm/mach-imx/pm-vf610.c')
-rw-r--r--arch/arm/mach-imx/pm-vf610.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/pm-vf610.c b/arch/arm/mach-imx/pm-vf610.c
index 7cadee2ffb95..f5c54abd8ccc 100644
--- a/arch/arm/mach-imx/pm-vf610.c
+++ b/arch/arm/mach-imx/pm-vf610.c
@@ -466,6 +466,22 @@ put_node:
}
#endif
+static void vf610_power_off(void)
+{
+ void __iomem *gpc_base = pm_info->gpc_base.vbase;
+ u32 gpc_pgcr;
+
+ /*
+ * Power gate Power Domain 1
+ */
+ gpc_pgcr = readl_relaxed(gpc_base + GPC_PGCR);
+ gpc_pgcr |= BM_PGCR_PG_PD1;
+ writel_relaxed(gpc_pgcr, gpc_base + GPC_PGCR);
+
+ /* Set low power mode */
+ vf610_set_lpm(VF610_STOP);
+}
+
static int __init vf610_suspend_mem_init(const struct vf610_pm_socdata *socdata)
{
struct device_node *node;
@@ -675,6 +691,8 @@ void __init vf610_pm_init(void)
if (ret)
pr_warn("%s: No DDR LPM support with suspend %d!\n",
__func__, ret);
+
+ pm_power_off = vf610_power_off;
}
}