From: Thomas Abraham <ta.omasab@gmail.com> To: Tomasz Figa <tomasz.figa@gmail.com> Cc: "linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>, "linux-arm-kernel@lists.infradead.org" <linux-arm-kernel@lists.infradead.org>, "linux-samsung-soc@vger.kernel.org" <linux-samsung-soc@vger.kernel.org>, "Mike Turquette" <mturquette@linaro.org>, "Kukjin Kim" <kgene.kim@samsung.com>, "Tomasz Figa" <t.figa@samsung.com>, "Lukasz Majewski" <l.majewski@samsung.com>, "Viresh Kumar" <viresh.kumar@linaro.org>, "Heiko Stübner" <heiko@sntech.de>, "Chanwoo Choi" <cw00.choi@samsung.com> Subject: Re: [PATCH v7 5/6] ARM: Exynos: switch to using generic cpufreq driver for exynos4210/5250/5420 Date: Tue, 29 Jul 2014 11:07:44 +0530 [thread overview] Message-ID: <CAJuA9ai=Dw0QN+KR7XQAP93R3+78ndzYNpJKwtAn-Nr6dffTXg@mail.gmail.com> (raw) In-Reply-To: <53CA7247.1080009@gmail.com> On Sat, Jul 19, 2014 at 6:57 PM, Tomasz Figa <tomasz.figa@gmail.com> wrote: > On 14.07.2014 15:38, Thomas Abraham wrote: >> From: Thomas Abraham <thomas.ab@samsung.com> >> >> Remove the platform device instantiation for exynos cpufreq driver and add the >> platform device for generic cpufreq drivers. >> >> Cc: Kukjin Kim <kgene.kim@samsung.com> >> Signed-off-by: Thomas Abraham <thomas.ab@samsung.com> >> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> >> Reviewed-by: Amit Daniel Kachhap <amit.daniel@samsung.com> >> Tested-by: Arjun K.V <arjun.kv@samsung.com> >> --- >> arch/arm/mach-exynos/exynos.c | 15 ++++++++++++++- >> 1 file changed, 14 insertions(+), 1 deletion(-) >> >> diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c >> index 2a43a17..5028b35 100644 >> --- a/arch/arm/mach-exynos/exynos.c >> +++ b/arch/arm/mach-exynos/exynos.c >> @@ -183,7 +183,20 @@ void __init exynos_cpuidle_init(void) >> >> void __init exynos_cpufreq_init(void) >> { >> - platform_device_register_simple("exynos-cpufreq", -1, NULL, 0); >> + char *dev_name; >> + >> + if (of_machine_is_compatible("samsung,exynos5440")) >> + return; > > The original code registers the device unconditionally. Why Exynos5440 > is excluded now? > >> + if (of_machine_is_compatible("samsung,exynos5420")) >> + dev_name = "arm-bL-cpufreq-dt"; >> + else >> + if (of_machine_is_compatible("samsung,exynos4412") || >> + of_machine_is_compatible("samsung,exynos4212")) >> + dev_name = "exynos-cpufreq"; >> + else >> + dev_name = "cpufreq-cpu0"; >> + >> + platform_device_register_simple(dev_name, -1, NULL, 0); >> } > > How about rewriting this to: > > 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" }, > { /* sentinel */ } > }; > > 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); > } > > This way it is much more readable and original behavior is preserved for > any SoCs not supported by new drivers. Thanks for the suggestion Tomasz. > > 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
WARNING: multiple messages have this Message-ID (diff)
From: ta.omasab@gmail.com (Thomas Abraham) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v7 5/6] ARM: Exynos: switch to using generic cpufreq driver for exynos4210/5250/5420 Date: Tue, 29 Jul 2014 11:07:44 +0530 [thread overview] Message-ID: <CAJuA9ai=Dw0QN+KR7XQAP93R3+78ndzYNpJKwtAn-Nr6dffTXg@mail.gmail.com> (raw) In-Reply-To: <53CA7247.1080009@gmail.com> On Sat, Jul 19, 2014 at 6:57 PM, Tomasz Figa <tomasz.figa@gmail.com> wrote: > On 14.07.2014 15:38, Thomas Abraham wrote: >> From: Thomas Abraham <thomas.ab@samsung.com> >> >> Remove the platform device instantiation for exynos cpufreq driver and add the >> platform device for generic cpufreq drivers. >> >> Cc: Kukjin Kim <kgene.kim@samsung.com> >> Signed-off-by: Thomas Abraham <thomas.ab@samsung.com> >> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> >> Reviewed-by: Amit Daniel Kachhap <amit.daniel@samsung.com> >> Tested-by: Arjun K.V <arjun.kv@samsung.com> >> --- >> arch/arm/mach-exynos/exynos.c | 15 ++++++++++++++- >> 1 file changed, 14 insertions(+), 1 deletion(-) >> >> diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c >> index 2a43a17..5028b35 100644 >> --- a/arch/arm/mach-exynos/exynos.c >> +++ b/arch/arm/mach-exynos/exynos.c >> @@ -183,7 +183,20 @@ void __init exynos_cpuidle_init(void) >> >> void __init exynos_cpufreq_init(void) >> { >> - platform_device_register_simple("exynos-cpufreq", -1, NULL, 0); >> + char *dev_name; >> + >> + if (of_machine_is_compatible("samsung,exynos5440")) >> + return; > > The original code registers the device unconditionally. Why Exynos5440 > is excluded now? > >> + if (of_machine_is_compatible("samsung,exynos5420")) >> + dev_name = "arm-bL-cpufreq-dt"; >> + else >> + if (of_machine_is_compatible("samsung,exynos4412") || >> + of_machine_is_compatible("samsung,exynos4212")) >> + dev_name = "exynos-cpufreq"; >> + else >> + dev_name = "cpufreq-cpu0"; >> + >> + platform_device_register_simple(dev_name, -1, NULL, 0); >> } > > How about rewriting this to: > > 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" }, > { /* sentinel */ } > }; > > 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); > } > > This way it is much more readable and original behavior is preserved for > any SoCs not supported by new drivers. Thanks for the suggestion Tomasz. > > Best regards, > Tomasz > -- > To unsubscribe from this list: send the line "unsubscribe linux-pm" in > the body of a message to majordomo at vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-07-29 5:37 UTC|newest] Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-07-14 13:38 [PATCH v7 0/6] cpufreq: use generic cpufreq drivers for exynos platforms Thomas Abraham 2014-07-14 13:38 ` Thomas Abraham 2014-07-14 13:38 ` [PATCH v7 1/6] clk: samsung: add infrastructure to register cpu clocks Thomas Abraham 2014-07-14 13:38 ` Thomas Abraham 2014-07-19 12:55 ` Tomasz Figa 2014-07-19 12:55 ` Tomasz Figa 2014-07-29 5:35 ` Thomas Abraham 2014-07-29 5:35 ` Thomas Abraham 2014-07-29 9:57 ` Tomasz Figa 2014-07-29 9:57 ` Tomasz Figa 2014-07-14 13:38 ` [PATCH v7 2/6] clk: samsung: register exynos5420 apll/kpll configuration data Thomas Abraham 2014-07-14 13:38 ` Thomas Abraham 2014-07-19 12:57 ` Tomasz Figa 2014-07-19 12:57 ` Tomasz Figa 2014-07-14 13:38 ` [PATCH v7 3/6] clk: exynos: use cpu-clock provider type to represent arm clock Thomas Abraham 2014-07-14 13:38 ` Thomas Abraham 2014-07-19 13:06 ` Tomasz Figa 2014-07-19 13:06 ` Tomasz Figa 2014-07-14 13:38 ` [PATCH v7 4/6] ARM: dts: Exynos: add cpu nodes, opp and cpu clock configuration data Thomas Abraham 2014-07-14 13:38 ` Thomas Abraham 2014-07-19 13:18 ` Tomasz Figa 2014-07-19 13:18 ` Tomasz Figa 2014-07-29 5:36 ` Thomas Abraham 2014-07-29 5:36 ` Thomas Abraham 2014-07-14 13:38 ` [PATCH v7 5/6] ARM: Exynos: switch to using generic cpufreq driver for exynos4210/5250/5420 Thomas Abraham 2014-07-14 13:38 ` Thomas Abraham 2014-07-19 13:27 ` Tomasz Figa 2014-07-19 13:27 ` Tomasz Figa 2014-07-29 5:37 ` Thomas Abraham [this message] 2014-07-29 5:37 ` Thomas Abraham 2014-07-14 13:38 ` [PATCH v7 6/6] cpufreq: exynos: remove exynos4210/5250 specific cpufreq driver support Thomas Abraham 2014-07-14 13:38 ` Thomas Abraham 2014-07-19 13:29 ` Tomasz Figa 2014-07-19 13:29 ` Tomasz Figa 2014-07-29 5:53 ` Thomas Abraham 2014-07-29 5:53 ` Thomas Abraham 2014-07-15 3:50 ` [PATCH v7 0/6] cpufreq: use generic cpufreq drivers for exynos platforms Thomas Abraham 2014-07-15 3:50 ` Thomas Abraham 2014-07-17 5:58 ` Thomas Abraham 2014-07-17 5:58 ` Thomas Abraham 2014-07-18 0:44 ` Chanwoo Choi 2014-07-18 0:44 ` Chanwoo Choi 2014-07-18 2:04 ` Thomas Abraham 2014-07-18 2:04 ` Thomas Abraham 2014-07-19 19:20 ` Tobias Jakobi 2014-07-19 19:20 ` Tobias Jakobi 2014-07-19 20:54 ` Tomasz Figa 2014-07-19 20:54 ` Tomasz Figa 2014-07-19 21:17 ` Tobias Jakobi 2014-07-19 21:17 ` Tobias Jakobi
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='CAJuA9ai=Dw0QN+KR7XQAP93R3+78ndzYNpJKwtAn-Nr6dffTXg@mail.gmail.com' \ --to=ta.omasab@gmail.com \ --cc=cw00.choi@samsung.com \ --cc=heiko@sntech.de \ --cc=kgene.kim@samsung.com \ --cc=l.majewski@samsung.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-pm@vger.kernel.org \ --cc=linux-samsung-soc@vger.kernel.org \ --cc=mturquette@linaro.org \ --cc=t.figa@samsung.com \ --cc=tomasz.figa@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.