mvebu: add support for SolidRun ClearFog Pro
[openwrt/staging/mans0n.git] / target / linux / mvebu / patches-6.1 / 000-cpufreq-armada-8k-add-ap807-support.patch
1 From 8eec6e740b564ec5e1da59ab7070b89aa23c9973 Mon Sep 17 00:00:00 2001
2 From: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
3 Date: Fri, 16 Jun 2023 12:41:30 +0100
4 Subject: [PATCH] cpufreq: armada-8k: add ap807 support
5
6 Add support for the Armada AP807 die to armada-8k. This uses a
7 different compatible for the CPU clock which needs to be added to
8 the cpufreq driver.
9
10 This commit takes a different approach to the WindRiver patch
11 "cpufreq: armada: enable ap807-cpu-clk" in that rather than calling
12 of_find_compatible_node() for each compatible, we use a table of
13 IDs instead.
14
15 Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
16 Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
17 ---
18 drivers/cpufreq/armada-8k-cpufreq.c | 16 +++++++++-------
19 1 file changed, 9 insertions(+), 7 deletions(-)
20
21 --- a/drivers/cpufreq/armada-8k-cpufreq.c
22 +++ b/drivers/cpufreq/armada-8k-cpufreq.c
23 @@ -21,6 +21,13 @@
24 #include <linux/pm_opp.h>
25 #include <linux/slab.h>
26
27 +static const struct of_device_id __maybe_unused armada_8k_cpufreq_of_match[] = {
28 + { .compatible = "marvell,ap806-cpu-clock" },
29 + { .compatible = "marvell,ap807-cpu-clock" },
30 + { },
31 +};
32 +MODULE_DEVICE_TABLE(of, armada_8k_cpufreq_of_match);
33 +
34 /*
35 * Setup the opps list with the divider for the max frequency, that
36 * will be filled at runtime.
37 @@ -127,7 +134,8 @@ static int __init armada_8k_cpufreq_init
38 struct device_node *node;
39 struct cpumask cpus;
40
41 - node = of_find_compatible_node(NULL, NULL, "marvell,ap806-cpu-clock");
42 + node = of_find_matching_node_and_match(NULL, armada_8k_cpufreq_of_match,
43 + NULL);
44 if (!node || !of_device_is_available(node)) {
45 of_node_put(node);
46 return -ENODEV;
47 @@ -204,12 +212,6 @@ static void __exit armada_8k_cpufreq_exi
48 }
49 module_exit(armada_8k_cpufreq_exit);
50
51 -static const struct of_device_id __maybe_unused armada_8k_cpufreq_of_match[] = {
52 - { .compatible = "marvell,ap806-cpu-clock" },
53 - { },
54 -};
55 -MODULE_DEVICE_TABLE(of, armada_8k_cpufreq_of_match);
56 -
57 MODULE_AUTHOR("Gregory Clement <gregory.clement@bootlin.com>");
58 MODULE_DESCRIPTION("Armada 8K cpufreq driver");
59 MODULE_LICENSE("GPL");