diff mbox

[v9,4/6] ARM: Exynos: switch to using generic cpufreq driver for Exynos4210/5250/5420

Message ID 1406707663-16656-5-git-send-email-thomas.ab@samsung.com
State New
Headers show

Commit Message

Thomas Abraham July 30, 2014, 8:07 a.m. UTC
The new CPU clock type allows the use of generic CPUfreq drivers. So for
Exynos4210/5250, switch to using generic cpufreq driver. For Exynos5420,
which did not have CPUfreq driver support, enable the use of generic
CPUfreq driver.

Suggested-by: Tomasz Figa <t.figa@samsung.com>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Thomas Abraham <thomas.ab@samsung.com>
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
---
 arch/arm/mach-exynos/exynos.c |   24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

Comments

Kukjin Kim July 31, 2014, 6:32 p.m. UTC | #1
On 07/30/14 17:07, Thomas Abraham wrote:
> The new CPU clock type allows the use of generic CPUfreq drivers. So for
> Exynos4210/5250, switch to using generic cpufreq driver. For Exynos5420,
> which did not have CPUfreq driver support, enable the use of generic
> CPUfreq driver.
>
> Suggested-by: Tomasz Figa<t.figa@samsung.com>
> Cc: Kukjin Kim<kgene.kim@samsung.com>

Looks good to me,

Acked-by: Kukjin Kim <kgene.kim@samsung.com>

BTW, who will handle this series? I hope see this series in 3.17.

- Kukjin

> Signed-off-by: Thomas Abraham<thomas.ab@samsung.com>
> Reviewed-by: Tomasz Figa<t.figa@samsung.com>
> ---
>   arch/arm/mach-exynos/exynos.c |   24 +++++++++++++++++++++++-
>   1 file changed, 23 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
> index 493dbc2..e61bb36 100644
> --- a/arch/arm/mach-exynos/exynos.c
> +++ b/arch/arm/mach-exynos/exynos.c
> @@ -281,6 +281,28 @@ static void __init exynos_init_irq(void)
>   	exynos_map_pmu();
>   }
>
> +static const struct of_device_id exynos_cpufreq_matches[] = {
> +	{ .compatible = "samsung,exynos5420", .data = "arm-bL-cpufreq-dt" },
> +	{ .compatible = "samsung,exynos5250", .data = "cpufreq-cpu0" },
> +	{ .compatible = "samsung,exynos4210", .data = "cpufreq-cpu0" },
> +	{ .compatible = "samsung,exynos5440", .data = "exynos5440-cpufreq" },
> +	{ /* sentinel */ }
> +};
> +
> +static void __init exynos_cpufreq_init(void)
> +{
> +	struct device_node *root = of_find_node_by_path("/");
> +	const struct of_device_id *match;
> +
> +	match = of_match_node(exynos_cpufreq_matches, root);
> +	if (!match) {
> +		platform_device_register_simple("exynos-cpufreq", -1, NULL, 0);
> +		return;
> +	}
> +
> +	platform_device_register_simple(match->data, -1, NULL, 0);
> +}
> +
>   static void __init exynos_dt_machine_init(void)
>   {
>   	struct device_node *i2c_np;
> @@ -320,7 +342,7 @@ static void __init exynos_dt_machine_init(void)
>   			of_machine_is_compatible("samsung,exynos5250"))
>   		platform_device_register(&exynos_cpuidle);
>
> -	platform_device_register_simple("exynos-cpufreq", -1, NULL, 0);
> +	exynos_cpufreq_init();
>
>   	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
>   }
Tomasz Figa July 31, 2014, 6:40 p.m. UTC | #2
Kukjin,

On 31.07.2014 20:32, Kukjin Kim wrote:
> On 07/30/14 17:07, Thomas Abraham wrote:
>> The new CPU clock type allows the use of generic CPUfreq drivers. So for
>> Exynos4210/5250, switch to using generic cpufreq driver. For Exynos5420,
>> which did not have CPUfreq driver support, enable the use of generic
>> CPUfreq driver.
>>
>> Suggested-by: Tomasz Figa<t.figa@samsung.com>
>> Cc: Kukjin Kim<kgene.kim@samsung.com>
> 
> Looks good to me,
> 
> Acked-by: Kukjin Kim <kgene.kim@samsung.com>
> 
> BTW, who will handle this series? I hope see this series in 3.17.

This series consists mostly of clock changes and it likely depends on
patches already in my for-next, so I would be inclined toward taking it
through samsung-clk tree. However, for this I would need Acks for patch
5/6 from Viresh and for patches [1] and [2] (which are dependencies of
this series) from you. I also need to make sure that the two mentioned
patches don't have any dependencies already in your tree.

[1] ARM: dts: add CPU nodes for Exynos4 SoCs
   - https://lkml.org/lkml/2014/7/21/315
[2] ARM: dts: smdk5250: Specify MAX77686 pmic interrupt
   - http://www.spinics.net/lists/arm-kernel/msg351134.html

Best regards,
Tomasz
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tomasz Figa July 31, 2014, 6:54 p.m. UTC | #3
On 31.07.2014 20:40, Tomasz Figa wrote:
> Kukjin,
> 
> On 31.07.2014 20:32, Kukjin Kim wrote:
>> On 07/30/14 17:07, Thomas Abraham wrote:
>>> The new CPU clock type allows the use of generic CPUfreq drivers. So for
>>> Exynos4210/5250, switch to using generic cpufreq driver. For Exynos5420,
>>> which did not have CPUfreq driver support, enable the use of generic
>>> CPUfreq driver.
>>>
>>> Suggested-by: Tomasz Figa<t.figa@samsung.com>
>>> Cc: Kukjin Kim<kgene.kim@samsung.com>
>>
>> Looks good to me,
>>
>> Acked-by: Kukjin Kim <kgene.kim@samsung.com>
>>
>> BTW, who will handle this series? I hope see this series in 3.17.
> 
> This series consists mostly of clock changes and it likely depends on
> patches already in my for-next, so I would be inclined toward taking it
> through samsung-clk tree. However, for this I would need Acks for patch
> 5/6 from Viresh and for patches [1] and [2] (which are dependencies of
> this series) from you. I also need to make sure that the two mentioned
> patches don't have any dependencies already in your tree.
> 
> [1] ARM: dts: add CPU nodes for Exynos4 SoCs
>    - https://lkml.org/lkml/2014/7/21/315
> [2] ARM: dts: smdk5250: Specify MAX77686 pmic interrupt
>    - http://www.spinics.net/lists/arm-kernel/msg351134.html

Aha, I'm not quite sure we really want to hurry with this series for
3.17. I'd prefer it to be picked up early after 3.17-rc1 shows up to sit
in linux-next for a while an be thoroughly tested on a number of boards.

This would also have the advantage of having the two patches mentioned
above already merged.

Best regards,
Tomasz
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
index 493dbc2..e61bb36 100644
--- a/arch/arm/mach-exynos/exynos.c
+++ b/arch/arm/mach-exynos/exynos.c
@@ -281,6 +281,28 @@  static void __init exynos_init_irq(void)
 	exynos_map_pmu();
 }
 
+static const struct of_device_id exynos_cpufreq_matches[] = {
+	{ .compatible = "samsung,exynos5420", .data = "arm-bL-cpufreq-dt" },
+	{ .compatible = "samsung,exynos5250", .data = "cpufreq-cpu0" },
+	{ .compatible = "samsung,exynos4210", .data = "cpufreq-cpu0" },
+	{ .compatible = "samsung,exynos5440", .data = "exynos5440-cpufreq" },
+	{ /* sentinel */ }
+};
+
+static void __init exynos_cpufreq_init(void)
+{
+	struct device_node *root = of_find_node_by_path("/");
+	const struct of_device_id *match;
+
+	match = of_match_node(exynos_cpufreq_matches, root);
+	if (!match) {
+		platform_device_register_simple("exynos-cpufreq", -1, NULL, 0);
+		return;
+	}
+
+	platform_device_register_simple(match->data, -1, NULL, 0);
+}
+
 static void __init exynos_dt_machine_init(void)
 {
 	struct device_node *i2c_np;
@@ -320,7 +342,7 @@  static void __init exynos_dt_machine_init(void)
 			of_machine_is_compatible("samsung,exynos5250"))
 		platform_device_register(&exynos_cpuidle);
 
-	platform_device_register_simple("exynos-cpufreq", -1, NULL, 0);
+	exynos_cpufreq_init();
 
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }