* [PATCH] cpufreq: exynos: Convert exynos-cpufreq to platform driver
@ 2013-10-16 16:00 Tomasz Figa
2013-10-17 4:59 ` Sachin Kamat
0 siblings, 1 reply; 3+ messages in thread
From: Tomasz Figa @ 2013-10-16 16:00 UTC (permalink / raw)
To: linux-samsung-soc
Cc: linux-arm-kernel, cpufreq, linux-pm, Kukjin Kim,
Russell King - ARM Linux, Viresh Kumar, Rafael J. Wysocki,
Lukasz Majewski, Tomasz Figa, Kyungmin Park
From: Lukasz Majewski <l.majewski@samsung.com>
To make the driver multiplatform-friendly, unconditional initialization
in an initcall is replaced with a platform driver probed only if
respective platform device is registered.
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
arch/arm/mach-exynos/common.c | 5 +++++
arch/arm/mach-exynos/common.h | 1 +
arch/arm/mach-exynos/mach-exynos4-dt.c | 1 +
arch/arm/mach-exynos/mach-exynos5-dt.c | 1 +
drivers/cpufreq/exynos-cpufreq.c | 11 ++++++++++-
5 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c
index c17407b..4414d70 100644
--- a/arch/arm/mach-exynos/common.c
+++ b/arch/arm/mach-exynos/common.c
@@ -305,6 +305,11 @@ void __init exynos_cpuidle_init(void)
platform_device_register(&exynos_cpuidle);
}
+void __init exynos_cpufreq_init(void)
+{
+ platform_device_register_simple("exynos-cpufreq", -1, NULL, 0);
+}
+
void __init exynos_init_late(void)
{
if (of_machine_is_compatible("samsung,exynos5440"))
diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h
index b2ac188..61e5f3a 100644
--- a/arch/arm/mach-exynos/common.h
+++ b/arch/arm/mach-exynos/common.h
@@ -23,6 +23,7 @@ void exynos_init_io(void);
void exynos4_restart(enum reboot_mode mode, const char *cmd);
void exynos5_restart(enum reboot_mode mode, const char *cmd);
void exynos_cpuidle_init(void);
+void exynos_cpufreq_init(void);
void exynos_init_late(void);
void exynos_firmware_init(void);
diff --git a/arch/arm/mach-exynos/mach-exynos4-dt.c b/arch/arm/mach-exynos/mach-exynos4-dt.c
index 53a3dc3..2cbaf63 100644
--- a/arch/arm/mach-exynos/mach-exynos4-dt.c
+++ b/arch/arm/mach-exynos/mach-exynos4-dt.c
@@ -26,6 +26,7 @@
static void __init exynos4_dt_machine_init(void)
{
exynos_cpuidle_init();
+ exynos_cpufreq_init();
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
}
diff --git a/arch/arm/mach-exynos/mach-exynos5-dt.c b/arch/arm/mach-exynos/mach-exynos5-dt.c
index c9f7dd1..9144549 100644
--- a/arch/arm/mach-exynos/mach-exynos5-dt.c
+++ b/arch/arm/mach-exynos/mach-exynos5-dt.c
@@ -48,6 +48,7 @@ static void __init exynos5_dt_machine_init(void)
}
exynos_cpuidle_init();
+ exynos_cpufreq_init();
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
}
diff --git a/drivers/cpufreq/exynos-cpufreq.c b/drivers/cpufreq/exynos-cpufreq.c
index 0ef13e8..706570e 100644
--- a/drivers/cpufreq/exynos-cpufreq.c
+++ b/drivers/cpufreq/exynos-cpufreq.c
@@ -17,6 +17,7 @@
#include <linux/regulator/consumer.h>
#include <linux/cpufreq.h>
#include <linux/suspend.h>
+#include <linux/platform_device.h>
#include <plat/cpu.h>
@@ -277,4 +278,12 @@ err_vdd_arm:
kfree(exynos_info);
return -EINVAL;
}
-late_initcall(exynos_cpufreq_init);
+
+static struct platform_driver exynos_cpufreq_platdrv = {
+ .driver = {
+ .name = "exynos-cpufreq",
+ .owner = THIS_MODULE,
+ },
+ .probe = exynos_cpufreq_init,
+};
+module_platform_driver(exynos_cpufreq_platdrv);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] cpufreq: exynos: Convert exynos-cpufreq to platform driver
2013-10-16 16:00 [PATCH] cpufreq: exynos: Convert exynos-cpufreq to platform driver Tomasz Figa
@ 2013-10-17 4:59 ` Sachin Kamat
2013-10-17 8:31 ` Jingoo Han
0 siblings, 1 reply; 3+ messages in thread
From: Sachin Kamat @ 2013-10-17 4:59 UTC (permalink / raw)
To: Tomasz Figa
Cc: linux-samsung-soc, linux-arm-kernel, cpufreq,
linux-pm@vger.kernel.org, Kukjin Kim, Russell King - ARM Linux,
Viresh Kumar, Rafael J. Wysocki, Lukasz Majewski, Kyungmin Park
Hi Tomasz, Lukasz,
On 16 October 2013 21:30, Tomasz Figa <t.figa@samsung.com> wrote:
> From: Lukasz Majewski <l.majewski@samsung.com>
>
> +static struct platform_driver exynos_cpufreq_platdrv = {
> + .driver = {
> + .name = "exynos-cpufreq",
> + .owner = THIS_MODULE,
> + },
> + .probe = exynos_cpufreq_init,
I think the prototype of this function should be changed to:
static int __init exynos_cpufreq_init(struct platform_device *pdev)
to avoid compilation warnings.
--
With warm regards,
Sachin
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] cpufreq: exynos: Convert exynos-cpufreq to platform driver
2013-10-17 4:59 ` Sachin Kamat
@ 2013-10-17 8:31 ` Jingoo Han
0 siblings, 0 replies; 3+ messages in thread
From: Jingoo Han @ 2013-10-17 8:31 UTC (permalink / raw)
To: 'Tomasz Figa'
Cc: 'linux-samsung-soc', 'linux-arm-kernel', cpufreq,
linux-pm, 'Sachin Kamat', 'Kukjin Kim',
'Russell King - ARM Linux', 'Viresh Kumar',
'Rafael J. Wysocki', 'Lukasz Majewski',
'Kyungmin Park', 'Jingoo Han'
On Thursday, October 17, 2013 2:00 PM, Sachin Kamat wrote:
> On 16 October 2013 21:30, Tomasz Figa <t.figa@samsung.com> wrote:
> > From: Lukasz Majewski <l.majewski@samsung.com>
> >
> > +static struct platform_driver exynos_cpufreq_platdrv = {
> > + .driver = {
> > + .name = "exynos-cpufreq",
> > + .owner = THIS_MODULE,
> > + },
> > + .probe = exynos_cpufreq_init,
>
> I think the prototype of this function should be changed to:
> static int __init exynos_cpufreq_init(struct platform_device *pdev)
>
> to avoid compilation warnings.
Hi Tomasz Figa,
One more thing. :-)
It makes section mismatch warning. Also, module_platform_driver()
is used. Then, '__init' annotation can be removed in order to fix
the section mismatch warning.
static int exynos_cpufreq_init(struct platform_device *pdev)
Thank you.
Best regards,
Jingoo Han
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-10-17 8:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-16 16:00 [PATCH] cpufreq: exynos: Convert exynos-cpufreq to platform driver Tomasz Figa
2013-10-17 4:59 ` Sachin Kamat
2013-10-17 8:31 ` Jingoo Han
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox