summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBhuvanchandra DV <bhuvanchandra.dv@toradex.com>2017-05-02 13:02:06 +0530
committerStefan Agner <stefan.agner@toradex.com>2017-06-06 13:36:57 -0700
commitf37e832b9814df334bb09374e2f21c88d35ec61c (patch)
treee8763739311d3caf71d9eeab10af32122525775c
parent3348e452f7710844f083bdb1f55f4c983612e89b (diff)
ARM: vf610: PM: Use device tree property to register power_off function
Only register power_off function when device tree property _/soc/fsl,use-lpm-poweroff_ is set. Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com> Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
-rw-r--r--arch/arm/boot/dts/vf-colibri.dtsi4
-rw-r--r--arch/arm/mach-imx/pm-vf610.c10
2 files changed, 12 insertions, 2 deletions
diff --git a/arch/arm/boot/dts/vf-colibri.dtsi b/arch/arm/boot/dts/vf-colibri.dtsi
index 1a1a80499e5a..de1b1cb33f1a 100644
--- a/arch/arm/boot/dts/vf-colibri.dtsi
+++ b/arch/arm/boot/dts/vf-colibri.dtsi
@@ -32,6 +32,10 @@
regulator-max-microvolt = <3300000>;
regulator-always-on;
};
+
+ soc {
+ fsl,use-lpm-poweroff;
+ };
};
&adc0 {
diff --git a/arch/arm/mach-imx/pm-vf610.c b/arch/arm/mach-imx/pm-vf610.c
index f5c54abd8ccc..5a3df0caf23a 100644
--- a/arch/arm/mach-imx/pm-vf610.c
+++ b/arch/arm/mach-imx/pm-vf610.c
@@ -601,6 +601,7 @@ put_node:
static int __init vf610_suspend_init(const struct vf610_pm_socdata *socdata)
{
int ret;
+ struct device_node *soc_node;
#ifdef DEBUG
ret = vf610_uart_init();
@@ -608,6 +609,13 @@ static int __init vf610_suspend_init(const struct vf610_pm_socdata *socdata)
return ret;
#endif
+ soc_node = of_find_node_by_path("/soc");
+ if (soc_node == NULL)
+ return -ENODEV;
+
+ if (of_property_read_bool(soc_node, "fsl,use-lpm-poweroff"))
+ pm_power_off = vf610_power_off;
+
if (vf610_suspend_mem_init(socdata)) {
/*
* Suspend to memory for some reason not available, use DDR
@@ -691,8 +699,6 @@ 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;
}
}