summaryrefslogtreecommitdiff
path: root/drivers/soc
diff options
context:
space:
mode:
authorJunjie Wu <junjiew@codeaurora.org>2015-11-17 11:36:00 -0800
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 21:10:44 -0700
commitf4c9a4a1f9c87a103b811efb15c6fdda9a9e17fc (patch)
tree63ab67ae5b11817a71c212d244514c089dc0a56a /drivers/soc
parentbcbb9ead971f558d28063b9e357ebb0fd511bcb8 (diff)
qcom: core_ctl_helper: Add wrapper for CPU hotplug
Different kernel version needs to use different kernel APIs for hotplug. Add wrapper for CPU hotplug so that external module can be used across different kernel releases. Use device_online/offline() API for CPU hotplug. Change-Id: Id21855f4ddc62bc9e9e6b45a856c245fd18d1514 Signed-off-by: Junjie Wu <junjiew@codeaurora.org>
Diffstat (limited to 'drivers/soc')
-rw-r--r--drivers/soc/qcom/core_ctl_helper.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/soc/qcom/core_ctl_helper.c b/drivers/soc/qcom/core_ctl_helper.c
index 3b25d9811cf7..7f674229f1f8 100644
--- a/drivers/soc/qcom/core_ctl_helper.c
+++ b/drivers/soc/qcom/core_ctl_helper.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -57,6 +57,22 @@ EXPORT_SYMBOL(core_ctl_find_cpu_device);
int __ref core_ctl_online_core(unsigned int cpu)
{
- return cpu_up(cpu);
+ int ret;
+
+ lock_device_hotplug();
+ ret = device_online(get_cpu_device(cpu));
+ unlock_device_hotplug();
+ return ret;
}
EXPORT_SYMBOL(core_ctl_online_core);
+
+int __ref core_ctl_offline_core(unsigned int cpu)
+{
+ int ret;
+
+ lock_device_hotplug();
+ ret = device_offline(get_cpu_device(cpu));
+ unlock_device_hotplug();
+ return ret;
+}
+EXPORT_SYMBOL(core_ctl_offline_core);