Skip to content

Commit 8eec6e7

Browse files
Russell King (Oracle)vireshk
authored andcommitted
cpufreq: armada-8k: add ap807 support
Add support for the Armada AP807 die to armada-8k. This uses a different compatible for the CPU clock which needs to be added to the cpufreq driver. This commit takes a different approach to the WindRiver patch "cpufreq: armada: enable ap807-cpu-clk" in that rather than calling of_find_compatible_node() for each compatible, we use a table of IDs instead. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
1 parent 3b062a0 commit 8eec6e7

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

drivers/cpufreq/armada-8k-cpufreq.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@
2121
#include <linux/pm_opp.h>
2222
#include <linux/slab.h>
2323

24+
static const struct of_device_id __maybe_unused armada_8k_cpufreq_of_match[] = {
25+
{ .compatible = "marvell,ap806-cpu-clock" },
26+
{ .compatible = "marvell,ap807-cpu-clock" },
27+
{ },
28+
};
29+
MODULE_DEVICE_TABLE(of, armada_8k_cpufreq_of_match);
30+
2431
/*
2532
* Setup the opps list with the divider for the max frequency, that
2633
* will be filled at runtime.
@@ -127,7 +134,8 @@ static int __init armada_8k_cpufreq_init(void)
127134
struct device_node *node;
128135
struct cpumask cpus;
129136

130-
node = of_find_compatible_node(NULL, NULL, "marvell,ap806-cpu-clock");
137+
node = of_find_matching_node_and_match(NULL, armada_8k_cpufreq_of_match,
138+
NULL);
131139
if (!node || !of_device_is_available(node)) {
132140
of_node_put(node);
133141
return -ENODEV;
@@ -204,12 +212,6 @@ static void __exit armada_8k_cpufreq_exit(void)
204212
}
205213
module_exit(armada_8k_cpufreq_exit);
206214

207-
static const struct of_device_id __maybe_unused armada_8k_cpufreq_of_match[] = {
208-
{ .compatible = "marvell,ap806-cpu-clock" },
209-
{ },
210-
};
211-
MODULE_DEVICE_TABLE(of, armada_8k_cpufreq_of_match);
212-
213215
MODULE_AUTHOR("Gregory Clement <gregory.clement@bootlin.com>");
214216
MODULE_DESCRIPTION("Armada 8K cpufreq driver");
215217
MODULE_LICENSE("GPL");

0 commit comments

Comments
 (0)