From: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk> To: Andrew Lunn <andrew@lunn.ch>, Gregory Clement <gregory.clement@bootlin.com>, Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>, Viresh Kumar <viresh.kumar@linaro.org> Cc: Josua Mayer <josua@solid-run.com>, "Rafael J. Wysocki" <rafael@kernel.org>, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Subject: [PATCH] cpufreq: armada-8k: add ap807 support Date: Fri, 16 Jun 2023 12:41:30 +0100 [thread overview] Message-ID: <E1qA7pa-00EZw7-R9@rmk-PC.armlinux.org.uk> (raw) 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> --- drivers/cpufreq/armada-8k-cpufreq.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/cpufreq/armada-8k-cpufreq.c b/drivers/cpufreq/armada-8k-cpufreq.c index b0fc5e84f857..8afefdea4d80 100644 --- a/drivers/cpufreq/armada-8k-cpufreq.c +++ b/drivers/cpufreq/armada-8k-cpufreq.c @@ -21,6 +21,13 @@ #include <linux/pm_opp.h> #include <linux/slab.h> +static const struct of_device_id __maybe_unused armada_8k_cpufreq_of_match[] = { + { .compatible = "marvell,ap806-cpu-clock" }, + { .compatible = "marvell,ap807-cpu-clock" }, + { }, +}; +MODULE_DEVICE_TABLE(of, armada_8k_cpufreq_of_match); + /* * Setup the opps list with the divider for the max frequency, that * will be filled at runtime. @@ -127,7 +134,8 @@ static int __init armada_8k_cpufreq_init(void) struct device_node *node; struct cpumask cpus; - node = of_find_compatible_node(NULL, NULL, "marvell,ap806-cpu-clock"); + node = of_find_matching_node_and_match(NULL, armada_8k_cpufreq_of_match, + NULL); if (!node || !of_device_is_available(node)) { of_node_put(node); return -ENODEV; @@ -204,12 +212,6 @@ static void __exit armada_8k_cpufreq_exit(void) } module_exit(armada_8k_cpufreq_exit); -static const struct of_device_id __maybe_unused armada_8k_cpufreq_of_match[] = { - { .compatible = "marvell,ap806-cpu-clock" }, - { }, -}; -MODULE_DEVICE_TABLE(of, armada_8k_cpufreq_of_match); - MODULE_AUTHOR("Gregory Clement <gregory.clement@bootlin.com>"); MODULE_DESCRIPTION("Armada 8K cpufreq driver"); MODULE_LICENSE("GPL"); -- 2.30.2
WARNING: multiple messages have this Message-ID (diff)
From: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk> To: Andrew Lunn <andrew@lunn.ch>, Gregory Clement <gregory.clement@bootlin.com>, Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>, Viresh Kumar <viresh.kumar@linaro.org> Cc: Josua Mayer <josua@solid-run.com>, "Rafael J. Wysocki" <rafael@kernel.org>, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Subject: [PATCH] cpufreq: armada-8k: add ap807 support Date: Fri, 16 Jun 2023 12:41:30 +0100 [thread overview] Message-ID: <E1qA7pa-00EZw7-R9@rmk-PC.armlinux.org.uk> (raw) 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> --- drivers/cpufreq/armada-8k-cpufreq.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/cpufreq/armada-8k-cpufreq.c b/drivers/cpufreq/armada-8k-cpufreq.c index b0fc5e84f857..8afefdea4d80 100644 --- a/drivers/cpufreq/armada-8k-cpufreq.c +++ b/drivers/cpufreq/armada-8k-cpufreq.c @@ -21,6 +21,13 @@ #include <linux/pm_opp.h> #include <linux/slab.h> +static const struct of_device_id __maybe_unused armada_8k_cpufreq_of_match[] = { + { .compatible = "marvell,ap806-cpu-clock" }, + { .compatible = "marvell,ap807-cpu-clock" }, + { }, +}; +MODULE_DEVICE_TABLE(of, armada_8k_cpufreq_of_match); + /* * Setup the opps list with the divider for the max frequency, that * will be filled at runtime. @@ -127,7 +134,8 @@ static int __init armada_8k_cpufreq_init(void) struct device_node *node; struct cpumask cpus; - node = of_find_compatible_node(NULL, NULL, "marvell,ap806-cpu-clock"); + node = of_find_matching_node_and_match(NULL, armada_8k_cpufreq_of_match, + NULL); if (!node || !of_device_is_available(node)) { of_node_put(node); return -ENODEV; @@ -204,12 +212,6 @@ static void __exit armada_8k_cpufreq_exit(void) } module_exit(armada_8k_cpufreq_exit); -static const struct of_device_id __maybe_unused armada_8k_cpufreq_of_match[] = { - { .compatible = "marvell,ap806-cpu-clock" }, - { }, -}; -MODULE_DEVICE_TABLE(of, armada_8k_cpufreq_of_match); - MODULE_AUTHOR("Gregory Clement <gregory.clement@bootlin.com>"); MODULE_DESCRIPTION("Armada 8K cpufreq driver"); MODULE_LICENSE("GPL"); -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2023-06-16 11:41 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-06-16 11:41 Russell King (Oracle) [this message] 2023-06-16 11:41 ` [PATCH] cpufreq: armada-8k: add ap807 support Russell King (Oracle) 2023-06-19 4:20 ` Viresh Kumar 2023-06-19 4:20 ` Viresh Kumar
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=E1qA7pa-00EZw7-R9@rmk-PC.armlinux.org.uk \ --to=rmk+kernel@armlinux.org.uk \ --cc=andrew@lunn.ch \ --cc=gregory.clement@bootlin.com \ --cc=josua@solid-run.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-pm@vger.kernel.org \ --cc=rafael@kernel.org \ --cc=sebastian.hesselbarth@gmail.com \ --cc=viresh.kumar@linaro.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.