aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/kernel/psci.c
diff options
context:
space:
mode:
authorAchin Gupta <achin.gupta@arm.com>2012-12-16 23:11:32 +0000
committerJon Medhurst <tixy@linaro.org>2013-04-29 09:43:17 +0100
commit165e90de39107bc42493facb88aeab90d56b917e (patch)
tree7b0fd1a2ec430cef9324de134bb63e36e79926a5 /arch/arm/kernel/psci.c
parent4085cd73587287185684f16cae616b115290347d (diff)
ARM: psci: add probe function to discover presence of a psci implementation
This patch adds a probe function to check if the secure firmware has an implementation of the Power State Coordination Interface. 'bL_platform_power_ops' will be implemented by: a. a native backend when Linux runs in secure world b. a psci backend which relies on the secure firmware to implement the power ops presence of b. will be indicated by the psci device node in the device tree. The device node is expected to be populated by the secure firmware if it supports psci. If the native backend detects a psci node then it bails out allowing the psci backend to be registered. Also a dummy 'psci_probe' function is added for the case when psci support is not included. This prevents the build from breaking for tc2 and the rtsm platforms. Signed-off-by: Achin Gupta <achin.gupta@arm.com> Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
Diffstat (limited to 'arch/arm/kernel/psci.c')
-rw-r--r--arch/arm/kernel/psci.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/arm/kernel/psci.c b/arch/arm/kernel/psci.c
index 5211f18cd2b..03c10f65add 100644
--- a/arch/arm/kernel/psci.c
+++ b/arch/arm/kernel/psci.c
@@ -212,3 +212,16 @@ out_put_node:
return 0;
}
early_initcall(psci_init);
+
+int __init psci_probe(void)
+{
+ struct device_node *np;
+ int ret = -ENODEV;
+
+ np = of_find_matching_node(NULL, psci_of_match);
+ if (np)
+ ret = 0;
+
+ of_node_put(np);
+ return ret;
+}