1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- #include <linux/cpu.h>
- #include <linux/cpufreq.h>
- #include <linux/module.h>
- #include <linux/platform_device.h>
- #include <linux/pm_opp.h>
- #include <linux/types.h>
- #include "arm_big_little.h"
- static int ve_spc_init_opp_table(const struct cpumask *cpumask)
- {
- struct device *cpu_dev = get_cpu_device(cpumask_first(cpumask));
-
- return dev_pm_opp_get_opp_count(cpu_dev) <= 0;
- }
- static int ve_spc_get_transition_latency(struct device *cpu_dev)
- {
- return 1000000;
- }
- static struct cpufreq_arm_bL_ops ve_spc_cpufreq_ops = {
- .name = "vexpress-spc",
- .get_transition_latency = ve_spc_get_transition_latency,
- .init_opp_table = ve_spc_init_opp_table,
- };
- static int ve_spc_cpufreq_probe(struct platform_device *pdev)
- {
- return bL_cpufreq_register(&ve_spc_cpufreq_ops);
- }
- static int ve_spc_cpufreq_remove(struct platform_device *pdev)
- {
- bL_cpufreq_unregister(&ve_spc_cpufreq_ops);
- return 0;
- }
- static struct platform_driver ve_spc_cpufreq_platdrv = {
- .driver = {
- .name = "vexpress-spc-cpufreq",
- },
- .probe = ve_spc_cpufreq_probe,
- .remove = ve_spc_cpufreq_remove,
- };
- module_platform_driver(ve_spc_cpufreq_platdrv);
- MODULE_LICENSE("GPL");
|