Commit 14730145 authored by Sudeep Holla's avatar Sudeep Holla Committed by Rafael J. Wysocki

cpufreq: arm_big_little: remove compile-time dependency on BIG_LITTLE

With the addition of switcher code, there's compile-time dependency on
BIG_LITTLE to get arm_big_little driver compiling on ARM64. Since ARM64
will never add support for bL switcher, it's better to remove the
dependency so that the driver can be reused on ARM64 platforms.

This patch adds stubs to remove BIG_LITTLE dependency in the driver.
Signed-off-by: default avatarSudeep Holla <sudeep.holla@arm.com>
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 0dd23f94
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
# big LITTLE core layer and glue drivers # big LITTLE core layer and glue drivers
config ARM_BIG_LITTLE_CPUFREQ config ARM_BIG_LITTLE_CPUFREQ
tristate "Generic ARM big LITTLE CPUfreq driver" tristate "Generic ARM big LITTLE CPUfreq driver"
depends on ARM && BIG_LITTLE && ARM_CPU_TOPOLOGY && HAVE_CLK depends on (ARM_CPU_TOPOLOGY || ARM64) && HAVE_CLK
select PM_OPP select PM_OPP
help help
This enables the Generic CPUfreq driver for ARM big.LITTLE platforms. This enables the Generic CPUfreq driver for ARM big.LITTLE platforms.
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/topology.h> #include <linux/topology.h>
#include <linux/types.h> #include <linux/types.h>
#include <asm/bL_switcher.h>
#include "arm_big_little.h" #include "arm_big_little.h"
...@@ -41,12 +40,16 @@ ...@@ -41,12 +40,16 @@
#define MAX_CLUSTERS 2 #define MAX_CLUSTERS 2
#ifdef CONFIG_BL_SWITCHER #ifdef CONFIG_BL_SWITCHER
#include <asm/bL_switcher.h>
static bool bL_switching_enabled; static bool bL_switching_enabled;
#define is_bL_switching_enabled() bL_switching_enabled #define is_bL_switching_enabled() bL_switching_enabled
#define set_switching_enabled(x) (bL_switching_enabled = (x)) #define set_switching_enabled(x) (bL_switching_enabled = (x))
#else #else
#define is_bL_switching_enabled() false #define is_bL_switching_enabled() false
#define set_switching_enabled(x) do { } while (0) #define set_switching_enabled(x) do { } while (0)
#define bL_switch_request(...) do { } while (0)
#define bL_switcher_put_enabled() do { } while (0)
#define bL_switcher_get_enabled() do { } while (0)
#endif #endif
#define ACTUAL_FREQ(cluster, freq) ((cluster == A7_CLUSTER) ? freq << 1 : freq) #define ACTUAL_FREQ(cluster, freq) ((cluster == A7_CLUSTER) ? freq << 1 : freq)
...@@ -513,6 +516,7 @@ static struct cpufreq_driver bL_cpufreq_driver = { ...@@ -513,6 +516,7 @@ static struct cpufreq_driver bL_cpufreq_driver = {
.attr = cpufreq_generic_attr, .attr = cpufreq_generic_attr,
}; };
#ifdef CONFIG_BL_SWITCHER
static int bL_cpufreq_switcher_notifier(struct notifier_block *nfb, static int bL_cpufreq_switcher_notifier(struct notifier_block *nfb,
unsigned long action, void *_arg) unsigned long action, void *_arg)
{ {
...@@ -545,6 +549,20 @@ static struct notifier_block bL_switcher_notifier = { ...@@ -545,6 +549,20 @@ static struct notifier_block bL_switcher_notifier = {
.notifier_call = bL_cpufreq_switcher_notifier, .notifier_call = bL_cpufreq_switcher_notifier,
}; };
static int __bLs_register_notifier(void)
{
return bL_switcher_register_notifier(&bL_switcher_notifier);
}
static int __bLs_unregister_notifier(void)
{
return bL_switcher_unregister_notifier(&bL_switcher_notifier);
}
#else
static int __bLs_register_notifier(void) { return 0; }
static int __bLs_unregister_notifier(void) { return 0; }
#endif
int bL_cpufreq_register(struct cpufreq_arm_bL_ops *ops) int bL_cpufreq_register(struct cpufreq_arm_bL_ops *ops)
{ {
int ret, i; int ret, i;
...@@ -562,8 +580,7 @@ int bL_cpufreq_register(struct cpufreq_arm_bL_ops *ops) ...@@ -562,8 +580,7 @@ int bL_cpufreq_register(struct cpufreq_arm_bL_ops *ops)
arm_bL_ops = ops; arm_bL_ops = ops;
ret = bL_switcher_get_enabled(); set_switching_enabled(bL_switcher_get_enabled());
set_switching_enabled(ret);
for (i = 0; i < MAX_CLUSTERS; i++) for (i = 0; i < MAX_CLUSTERS; i++)
mutex_init(&cluster_lock[i]); mutex_init(&cluster_lock[i]);
...@@ -574,7 +591,7 @@ int bL_cpufreq_register(struct cpufreq_arm_bL_ops *ops) ...@@ -574,7 +591,7 @@ int bL_cpufreq_register(struct cpufreq_arm_bL_ops *ops)
__func__, ops->name, ret); __func__, ops->name, ret);
arm_bL_ops = NULL; arm_bL_ops = NULL;
} else { } else {
ret = bL_switcher_register_notifier(&bL_switcher_notifier); ret = __bLs_register_notifier();
if (ret) { if (ret) {
cpufreq_unregister_driver(&bL_cpufreq_driver); cpufreq_unregister_driver(&bL_cpufreq_driver);
arm_bL_ops = NULL; arm_bL_ops = NULL;
...@@ -598,7 +615,7 @@ void bL_cpufreq_unregister(struct cpufreq_arm_bL_ops *ops) ...@@ -598,7 +615,7 @@ void bL_cpufreq_unregister(struct cpufreq_arm_bL_ops *ops)
} }
bL_switcher_get_enabled(); bL_switcher_get_enabled();
bL_switcher_unregister_notifier(&bL_switcher_notifier); __bLs_unregister_notifier();
cpufreq_unregister_driver(&bL_cpufreq_driver); cpufreq_unregister_driver(&bL_cpufreq_driver);
bL_switcher_put_enabled(); bL_switcher_put_enabled();
pr_info("%s: Un-registered platform driver: %s\n", __func__, pr_info("%s: Un-registered platform driver: %s\n", __func__,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment