From: k.kozlowski@samsung.com (Krzysztof Kozlowski)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 6/7] ARM: Exynos: switch to using generic cpufreq driver for Exynos4x12
Date: Fri, 10 Jul 2015 17:55:01 +0900 [thread overview]
Message-ID: <559F8865.1040608@samsung.com> (raw)
In-Reply-To: <1436456621-29839-7-git-send-email-b.zolnierkie@samsung.com>
On 10.07.2015 00:43, Bartlomiej Zolnierkiewicz wrote:
> The new CPU clock type allows the use of generic CPUfreq driver.
> Switch Exynos4x12 to using generic cpufreq driver.
>
> This patch also takes care of making ARM_EXYNOS_CPU_FREQ_BOOST_SW
> config option depend on cpufreq-dt driver instead of exynos-cpufreq
> one and fixes the minor issue present with the old code (support
> for 'boost' mode in the exynos-cpufreq driver was enabled for all
> supported SoCs even though 'boost' frequency was provided only for
> Exynos4x12 ones).
>
> Cc: Tomasz Figa <tomasz.figa@gmail.com>
> Cc: Kukjin Kim <kgene.kim@samsung.com>
> Cc: Javier Martinez Canillas <javier@dowhile0.org>
> Cc: Thomas Abraham <thomas.ab@samsung.com>
> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> ---
> arch/arm/mach-exynos/exynos.c | 14 ++++++++++++++
> drivers/cpufreq/Kconfig.arm | 2 +-
> drivers/cpufreq/exynos-cpufreq.c | 3 ---
> 3 files changed, 15 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
> index 4015ec3..0c74e90 100644
> --- a/arch/arm/mach-exynos/exynos.c
> +++ b/arch/arm/mach-exynos/exynos.c
> @@ -20,6 +20,7 @@
> #include <linux/platform_device.h>
> #include <linux/pm_domain.h>
> #include <linux/irqchip.h>
> +#include <linux/cpufreq-dt.h>
>
> #include <asm/cacheflush.h>
> #include <asm/hardware/cache-l2x0.h>
> @@ -224,6 +225,12 @@ static void __init exynos_init_irq(void)
> exynos_map_pmu();
> }
>
> +struct cpufreq_dt_platform_data cpufreq_dt_pd = {
Shouldn't this be static?
> +#ifdef CONFIG_ARM_EXYNOS_CPU_FREQ_BOOST_SW
> + .boost_supported = true,
> +#endif
> +};
> +
> static const struct of_device_id exynos_cpufreq_matches[] = {
> { .compatible = "samsung,exynos4210", .data = "cpufreq-dt" },
> { .compatible = "samsung,exynos5250", .data = "cpufreq-dt" },
> @@ -235,6 +242,13 @@ static void __init exynos_cpufreq_init(void)
> struct device_node *root = of_find_node_by_path("/");
> const struct of_device_id *match;
>
> + if (of_machine_is_compatible("samsung,exynos4212") ||
> + of_machine_is_compatible("samsung,exynos4412")) {
> + platform_device_register_data(NULL, "cpufreq-dt", -1,
> + &cpufreq_dt_pd, sizeof(cpufreq_dt_pd));
> + return;
> + }
> +
> match = of_match_node(exynos_cpufreq_matches, root);
> if (!match) {
> platform_device_register_simple("exynos-cpufreq", -1, NULL, 0);
Now we have two places with compatibles for matching cpufreq-dt driver.
It is confusing especially when grepping for compatibles.
Instead why not use 'data' from exynos_cpufreq_matches? Currently it
stores the "cpufreq-dt" string which looks useless.
Best regards,
Krzysztof
> diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm
> index 9ab6388c1..5f5a15a 100644
> --- a/drivers/cpufreq/Kconfig.arm
> +++ b/drivers/cpufreq/Kconfig.arm
> @@ -49,7 +49,7 @@ config ARM_EXYNOS4X12_CPUFREQ
>
> config ARM_EXYNOS_CPU_FREQ_BOOST_SW
> bool "EXYNOS Frequency Overclocking - Software"
> - depends on ARM_EXYNOS_CPUFREQ && THERMAL
> + depends on CPUFREQ_DT && THERMAL
> select CPU_FREQ_BOOST_SW
> select EXYNOS_THERMAL
> help
> diff --git a/drivers/cpufreq/exynos-cpufreq.c b/drivers/cpufreq/exynos-cpufreq.c
> index 71d8891..89d252e 100644
> --- a/drivers/cpufreq/exynos-cpufreq.c
> +++ b/drivers/cpufreq/exynos-cpufreq.c
> @@ -150,9 +150,6 @@ static struct cpufreq_driver exynos_driver = {
> .init = exynos_cpufreq_cpu_init,
> .name = "exynos_cpufreq",
> .attr = cpufreq_generic_attr,
> -#ifdef CONFIG_ARM_EXYNOS_CPU_FREQ_BOOST_SW
> - .boost_supported = true,
> -#endif
> #ifdef CONFIG_PM
> .suspend = cpufreq_generic_suspend,
> #endif
>
next prev parent reply other threads:[~2015-07-10 8:55 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-09 15:43 [PATCH v2 0/7] cpufreq: use generic cpufreq drivers for Exynos4x12 platform Bartlomiej Zolnierkiewicz
2015-07-09 15:43 ` [PATCH v2 1/7] opp: add dev_pm_opp_get_turbo_mode_setting() helper Bartlomiej Zolnierkiewicz
2015-07-10 2:17 ` Krzysztof Kozlowski
2015-07-27 8:33 ` Viresh Kumar
2015-07-09 15:43 ` [PATCH v2 2/7] cpufreq: opp: fix handling of turbo modes Bartlomiej Zolnierkiewicz
2015-07-10 2:20 ` Krzysztof Kozlowski
2015-07-27 8:35 ` Viresh Kumar
2015-07-27 10:24 ` Bartlomiej Zolnierkiewicz
2015-07-27 10:35 ` Viresh Kumar
2015-07-27 11:14 ` Bartlomiej Zolnierkiewicz
2015-07-27 11:36 ` Viresh Kumar
2015-07-27 11:47 ` Bartlomiej Zolnierkiewicz
2015-07-30 14:37 ` Kukjin Kim
2015-07-31 18:58 ` Bartlomiej Zolnierkiewicz
2015-08-04 1:31 ` Krzysztof Kozlowski
2015-07-09 15:43 ` [PATCH v2 3/7] cpufreq-dt: add turbo modes support Bartlomiej Zolnierkiewicz
2015-07-10 8:22 ` Krzysztof Kozlowski
2015-07-27 8:37 ` Viresh Kumar
2015-07-27 11:01 ` Bartlomiej Zolnierkiewicz
2015-07-27 11:33 ` Viresh Kumar
2015-07-27 11:58 ` Bartlomiej Zolnierkiewicz
2015-07-27 12:01 ` Viresh Kumar
2015-07-09 15:43 ` [PATCH v2 4/7] clk: samsung: exynos4x12: add cpu clock configuration data and instantiate cpu clock Bartlomiej Zolnierkiewicz
2015-07-10 8:30 ` Krzysztof Kozlowski
2015-07-10 16:12 ` Javier Martinez Canillas
2015-07-11 6:36 ` Krzysztof Kozlowski
2015-07-15 9:58 ` Sylwester nawrocki
2015-07-09 15:43 ` [PATCH v2 5/7] ARM: dts: Exynos4x12: add CPU OPP and regulator supply property Bartlomiej Zolnierkiewicz
2015-07-10 8:35 ` Krzysztof Kozlowski
2015-07-09 15:43 ` [PATCH v2 6/7] ARM: Exynos: switch to using generic cpufreq driver for Exynos4x12 Bartlomiej Zolnierkiewicz
2015-07-10 8:55 ` Krzysztof Kozlowski [this message]
2015-07-09 15:43 ` [PATCH v2 7/7] cpufreq: exynos: remove Exynos4x12 specific cpufreq driver support Bartlomiej Zolnierkiewicz
2015-07-10 8:57 ` Krzysztof Kozlowski
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=559F8865.1040608@samsung.com \
--to=k.kozlowski@samsung.com \
--cc=linux-arm-kernel@lists.infradead.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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).