of: MSI: Simplify irqdomain lookup
[linux/fpc-iii.git] / drivers / cpufreq / vexpress-spc-cpufreq.c
blob433e93fd4900a7bccd474b04bf15889ff831f4bc
1 /*
2 * Versatile Express SPC CPUFreq Interface driver
4 * It provides necessary ops to arm_big_little cpufreq driver.
6 * Copyright (C) 2013 ARM Ltd.
7 * Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
13 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
14 * kind, whether express or implied; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
19 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
21 #include <linux/cpufreq.h>
22 #include <linux/module.h>
23 #include <linux/platform_device.h>
24 #include <linux/pm_opp.h>
25 #include <linux/types.h>
27 #include "arm_big_little.h"
29 static int ve_spc_init_opp_table(struct device *cpu_dev)
32 * platform specific SPC code must initialise the opp table
33 * so just check if the OPP count is non-zero
35 return dev_pm_opp_get_opp_count(cpu_dev) <= 0;
38 static int ve_spc_get_transition_latency(struct device *cpu_dev)
40 return 1000000; /* 1 ms */
43 static struct cpufreq_arm_bL_ops ve_spc_cpufreq_ops = {
44 .name = "vexpress-spc",
45 .get_transition_latency = ve_spc_get_transition_latency,
46 .init_opp_table = ve_spc_init_opp_table,
49 static int ve_spc_cpufreq_probe(struct platform_device *pdev)
51 return bL_cpufreq_register(&ve_spc_cpufreq_ops);
54 static int ve_spc_cpufreq_remove(struct platform_device *pdev)
56 bL_cpufreq_unregister(&ve_spc_cpufreq_ops);
57 return 0;
60 static struct platform_driver ve_spc_cpufreq_platdrv = {
61 .driver = {
62 .name = "vexpress-spc-cpufreq",
64 .probe = ve_spc_cpufreq_probe,
65 .remove = ve_spc_cpufreq_remove,
67 module_platform_driver(ve_spc_cpufreq_platdrv);
69 MODULE_LICENSE("GPL");