From d6e56a4f37a96707f17081b2e2d8095a22b872b8 Mon Sep 17 00:00:00 2001 From: Junjie Wu Date: Tue, 17 Nov 2015 11:36:00 -0800 Subject: [PATCH] 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 cpu_up/cpu_down() API for CPU hotplug. Change-Id: Ib36a875027f67b96e2d108de8b7d902978e50005 Signed-off-by: Junjie Wu --- drivers/soc/qcom/core_ctl_helper.c | 8 +++++++- include/soc/qcom/core_ctl.h | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/soc/qcom/core_ctl_helper.c b/drivers/soc/qcom/core_ctl_helper.c index 3b25d9811cf7..832de4b903fa 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 @@ -60,3 +60,9 @@ int __ref core_ctl_online_core(unsigned int cpu) return cpu_up(cpu); } EXPORT_SYMBOL(core_ctl_online_core); + +int __ref core_ctl_offline_core(unsigned int cpu) +{ + return cpu_down(cpu); +} +EXPORT_SYMBOL(core_ctl_offline_core); diff --git a/include/soc/qcom/core_ctl.h b/include/soc/qcom/core_ctl.h index 01f55e53cd47..39bce9fc8fdd 100644 --- a/include/soc/qcom/core_ctl.h +++ b/include/soc/qcom/core_ctl.h @@ -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 @@ -21,5 +21,6 @@ extern struct cpufreq_policy *core_ctl_get_policy(int cpu); extern void core_ctl_put_policy(struct cpufreq_policy *policy); extern struct device *core_ctl_find_cpu_device(unsigned cpu); extern int core_ctl_online_core(unsigned int cpu); +extern int core_ctl_offline_core(unsigned int cpu); #endif