* [PATCH V2 1/9] cpufreq: dt: Mark platdev machines array as __initconst
2016-04-22 11:28 [PATCH V2 0/9] cpufreq: dt: Don't create platform-device from platform code Viresh Kumar
@ 2016-04-22 11:28 ` Viresh Kumar
2016-04-22 11:28 ` [PATCH V2 2/9] cpufreq: berlin: Use generic platdev driver Viresh Kumar
` (8 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: Viresh Kumar @ 2016-04-22 11:28 UTC (permalink / raw)
To: Rafael Wysocki, Viresh Kumar; +Cc: linaro-kernel, linux-pm, geert, linux-kernel
The machines array in cpufreq-dt-platdev is used only once at boot time
and so should be marked with __initconst, so that kernel can free up
memory used for it, if required.
Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
drivers/cpufreq/cpufreq-dt-platdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-dt-platdev.c
index f2ae7ad99a3c..00da8c8bee6c 100644
--- a/drivers/cpufreq/cpufreq-dt-platdev.c
+++ b/drivers/cpufreq/cpufreq-dt-platdev.c
@@ -11,7 +11,7 @@
#include <linux/of.h>
#include <linux/platform_device.h>
-static const struct of_device_id machines[] = {
+static const struct of_device_id machines[] __initconst = {
{ .compatible = "samsung,exynos3250", },
{ .compatible = "samsung,exynos4210", },
{ .compatible = "samsung,exynos4212", },
--
2.7.1.410.g6faf27b
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH V2 2/9] cpufreq: berlin: Use generic platdev driver
2016-04-22 11:28 [PATCH V2 0/9] cpufreq: dt: Don't create platform-device from platform code Viresh Kumar
2016-04-22 11:28 ` [PATCH V2 1/9] cpufreq: dt: Mark platdev machines array as __initconst Viresh Kumar
@ 2016-04-22 11:28 ` Viresh Kumar
2016-04-22 11:28 ` [PATCH V2 3/9] cpufreq: imx: " Viresh Kumar
` (7 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: Viresh Kumar @ 2016-04-22 11:28 UTC (permalink / raw)
To: Rafael Wysocki, Sebastian Hesselbarth, Viresh Kumar
Cc: linaro-kernel, Arnd Bergmann, linux-pm, Antoine Tenart,
linux-kernel, geert, linux-arm-kernel
The cpufreq-dt-platdev driver supports creation of cpufreq-dt platform
device now, reuse that and remove similar code from platform code.
Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
arch/arm/mach-berlin/berlin.c | 6 ------
drivers/cpufreq/cpufreq-dt-platdev.c | 2 ++
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-berlin/berlin.c b/arch/arm/mach-berlin/berlin.c
index 25d73870ccca..ac181c6797ee 100644
--- a/arch/arm/mach-berlin/berlin.c
+++ b/arch/arm/mach-berlin/berlin.c
@@ -18,11 +18,6 @@
#include <asm/hardware/cache-l2x0.h>
#include <asm/mach/arch.h>
-static void __init berlin_init_late(void)
-{
- platform_device_register_simple("cpufreq-dt", -1, NULL, 0);
-}
-
static const char * const berlin_dt_compat[] = {
"marvell,berlin",
NULL,
@@ -30,7 +25,6 @@ static const char * const berlin_dt_compat[] = {
DT_MACHINE_START(BERLIN_DT, "Marvell Berlin")
.dt_compat = berlin_dt_compat,
- .init_late = berlin_init_late,
/*
* with DT probing for L2CCs, berlin_init_machine can be removed.
* Note: 88DE3005 (Armada 1500-mini) uses pl310 l2cc
diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-dt-platdev.c
index 00da8c8bee6c..3e1c8211c213 100644
--- a/drivers/cpufreq/cpufreq-dt-platdev.c
+++ b/drivers/cpufreq/cpufreq-dt-platdev.c
@@ -12,6 +12,8 @@
#include <linux/platform_device.h>
static const struct of_device_id machines[] __initconst = {
+ { .compatible = "marvell,berlin", },
+
{ .compatible = "samsung,exynos3250", },
{ .compatible = "samsung,exynos4210", },
{ .compatible = "samsung,exynos4212", },
--
2.7.1.410.g6faf27b
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH V2 3/9] cpufreq: imx: Use generic platdev driver
2016-04-22 11:28 [PATCH V2 0/9] cpufreq: dt: Don't create platform-device from platform code Viresh Kumar
2016-04-22 11:28 ` [PATCH V2 1/9] cpufreq: dt: Mark platdev machines array as __initconst Viresh Kumar
2016-04-22 11:28 ` [PATCH V2 2/9] cpufreq: berlin: Use generic platdev driver Viresh Kumar
@ 2016-04-22 11:28 ` Viresh Kumar
2016-04-22 11:28 ` [PATCH V2 4/9] cpufreq: omap: " Viresh Kumar
` (6 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: Viresh Kumar @ 2016-04-22 11:28 UTC (permalink / raw)
To: Rafael Wysocki, Shawn Guo, Sascha Hauer, Viresh Kumar
Cc: linaro-kernel, linux-pm, geert, Lucas Stach, Arnd Bergmann,
linux-arm-kernel, linux-kernel
The cpufreq-dt-platdev driver supports creation of cpufreq-dt platform
device now, reuse that and remove similar code from platform code.
Note that the complete routine imx27_dt_init() is removed as
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
has same effect as a NULL .init_machine machine callback pointer.
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Sascha Hauer <kernel@pengutronix.de>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
arch/arm/mach-imx/imx27-dt.c | 10 ----------
arch/arm/mach-imx/mach-imx51.c | 3 ---
arch/arm/mach-imx/mach-imx53.c | 2 --
arch/arm/mach-imx/mach-imx7d.c | 6 ------
drivers/cpufreq/cpufreq-dt-platdev.c | 5 +++++
5 files changed, 5 insertions(+), 21 deletions(-)
diff --git a/arch/arm/mach-imx/imx27-dt.c b/arch/arm/mach-imx/imx27-dt.c
index bd42d1bd10af..530a728c2acc 100644
--- a/arch/arm/mach-imx/imx27-dt.c
+++ b/arch/arm/mach-imx/imx27-dt.c
@@ -18,15 +18,6 @@
#include "common.h"
#include "mx27.h"
-static void __init imx27_dt_init(void)
-{
- struct platform_device_info devinfo = { .name = "cpufreq-dt", };
-
- of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
-
- platform_device_register_full(&devinfo);
-}
-
static const char * const imx27_dt_board_compat[] __initconst = {
"fsl,imx27",
NULL
@@ -36,6 +27,5 @@ DT_MACHINE_START(IMX27_DT, "Freescale i.MX27 (Device Tree Support)")
.map_io = mx27_map_io,
.init_early = imx27_init_early,
.init_irq = mx27_init_irq,
- .init_machine = imx27_dt_init,
.dt_compat = imx27_dt_board_compat,
MACHINE_END
diff --git a/arch/arm/mach-imx/mach-imx51.c b/arch/arm/mach-imx/mach-imx51.c
index 6883fbaf9484..10a82a4f1e58 100644
--- a/arch/arm/mach-imx/mach-imx51.c
+++ b/arch/arm/mach-imx/mach-imx51.c
@@ -50,13 +50,10 @@ static void __init imx51_ipu_mipi_setup(void)
static void __init imx51_dt_init(void)
{
- struct platform_device_info devinfo = { .name = "cpufreq-dt", };
-
imx51_ipu_mipi_setup();
imx_src_init();
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
- platform_device_register_full(&devinfo);
}
static void __init imx51_init_late(void)
diff --git a/arch/arm/mach-imx/mach-imx53.c b/arch/arm/mach-imx/mach-imx53.c
index 86316a979297..18b5c5c136db 100644
--- a/arch/arm/mach-imx/mach-imx53.c
+++ b/arch/arm/mach-imx/mach-imx53.c
@@ -40,8 +40,6 @@ static void __init imx53_dt_init(void)
static void __init imx53_init_late(void)
{
imx53_pm_init();
-
- platform_device_register_simple("cpufreq-dt", -1, NULL, 0);
}
static const char * const imx53_dt_board_compat[] __initconst = {
diff --git a/arch/arm/mach-imx/mach-imx7d.c b/arch/arm/mach-imx/mach-imx7d.c
index 5a27f20c9a82..b450f525a670 100644
--- a/arch/arm/mach-imx/mach-imx7d.c
+++ b/arch/arm/mach-imx/mach-imx7d.c
@@ -105,11 +105,6 @@ static void __init imx7d_init_irq(void)
irqchip_init();
}
-static void __init imx7d_init_late(void)
-{
- platform_device_register_simple("cpufreq-dt", -1, NULL, 0);
-}
-
static const char *const imx7d_dt_compat[] __initconst = {
"fsl,imx7d",
NULL,
@@ -117,7 +112,6 @@ static const char *const imx7d_dt_compat[] __initconst = {
DT_MACHINE_START(IMX7D, "Freescale i.MX7 Dual (Device Tree)")
.init_irq = imx7d_init_irq,
- .init_late = imx7d_init_late,
.init_machine = imx7d_init_machine,
.dt_compat = imx7d_dt_compat,
MACHINE_END
diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-dt-platdev.c
index 3e1c8211c213..3843314389c7 100644
--- a/drivers/cpufreq/cpufreq-dt-platdev.c
+++ b/drivers/cpufreq/cpufreq-dt-platdev.c
@@ -12,6 +12,11 @@
#include <linux/platform_device.h>
static const struct of_device_id machines[] __initconst = {
+ { .compatible = "fsl,imx27", },
+ { .compatible = "fsl,imx51", },
+ { .compatible = "fsl,imx53", },
+ { .compatible = "fsl,imx7d", },
+
{ .compatible = "marvell,berlin", },
{ .compatible = "samsung,exynos3250", },
--
2.7.1.410.g6faf27b
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH V2 4/9] cpufreq: omap: Use generic platdev driver
2016-04-22 11:28 [PATCH V2 0/9] cpufreq: dt: Don't create platform-device from platform code Viresh Kumar
` (2 preceding siblings ...)
2016-04-22 11:28 ` [PATCH V2 3/9] cpufreq: imx: " Viresh Kumar
@ 2016-04-22 11:28 ` Viresh Kumar
[not found] ` <cover.1461324267.git.viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
` (5 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: Viresh Kumar @ 2016-04-22 11:28 UTC (permalink / raw)
To: Rafael Wysocki, Kevin Hilman, Tony Lindgren, Viresh Kumar
Cc: linaro-kernel, linux-pm, geert, Arnd Bergmann, linux-omap,
linux-arm-kernel, linux-kernel
The cpufreq-dt-platdev driver supports creation of cpufreq-dt platform
device now, reuse that and remove similar code from platform code.
Cc: Tony Lindgren <tony@atomide.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
arch/arm/mach-omap2/pm.c | 7 ++-----
drivers/cpufreq/cpufreq-dt-platdev.c | 5 +++++
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
index 58920bc8807b..2f7b11da7d5d 100644
--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -277,13 +277,10 @@ static void __init omap4_init_voltages(void)
static inline void omap_init_cpufreq(void)
{
- struct platform_device_info devinfo = { };
+ struct platform_device_info devinfo = { .name = "omap-cpufreq" };
if (!of_have_populated_dt())
- devinfo.name = "omap-cpufreq";
- else
- devinfo.name = "cpufreq-dt";
- platform_device_register_full(&devinfo);
+ platform_device_register_full(&devinfo);
}
static int __init omap2_common_pm_init(void)
diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-dt-platdev.c
index 3843314389c7..4e525f6ec59f 100644
--- a/drivers/cpufreq/cpufreq-dt-platdev.c
+++ b/drivers/cpufreq/cpufreq-dt-platdev.c
@@ -28,6 +28,11 @@ static const struct of_device_id machines[] __initconst = {
{ .compatible = "samsung,exynos5420", },
{ .compatible = "samsung,exynos5800", },
#endif
+
+ { .compatible = "ti,omap2", },
+ { .compatible = "ti,omap3", },
+ { .compatible = "ti,omap4", },
+ { .compatible = "ti,omap5", },
};
static int __init cpufreq_dt_platdev_init(void)
--
2.7.1.410.g6faf27b
^ permalink raw reply related [flat|nested] 12+ messages in thread[parent not found: <cover.1461324267.git.viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>]
* [PATCH V2 5/9] cpufreq: rockchip: Use generic platdev driver
[not found] ` <cover.1461324267.git.viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
@ 2016-04-22 11:28 ` Viresh Kumar
2016-04-22 13:58 ` Heiko Stübner
0 siblings, 1 reply; 12+ messages in thread
From: Viresh Kumar @ 2016-04-22 11:28 UTC (permalink / raw)
To: Rafael Wysocki, Heiko Stuebner, Viresh Kumar
Cc: linaro-kernel-cunTk1MwBs8s++Sfvej+rw, Arnd Bergmann,
linux-pm-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Finley Xiao,
geert-Td1EMuHUCqxL1ZNQvxDV9g,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
From: Finley Xiao <finley.xiao-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
This patch add rockchip's compatible string to the compat list and
remove similar code from platform code for supporting generic platdev
driver.
Signed-off-by: Finley Xiao <finley.xiao-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
Acked-by: Viresh Kumar <viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Acked-by: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
Signed-off-by: Viresh Kumar <viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---
arch/arm/mach-rockchip/rockchip.c | 1 -
drivers/cpufreq/cpufreq-dt-platdev.c | 11 +++++++++++
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-rockchip/rockchip.c b/arch/arm/mach-rockchip/rockchip.c
index 3f07cc5dfe5f..beb71da5d9c8 100644
--- a/arch/arm/mach-rockchip/rockchip.c
+++ b/arch/arm/mach-rockchip/rockchip.c
@@ -74,7 +74,6 @@ static void __init rockchip_dt_init(void)
{
rockchip_suspend_init();
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
- platform_device_register_simple("cpufreq-dt", 0, NULL, 0);
}
static const char * const rockchip_board_dt_compat[] = {
diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-dt-platdev.c
index 4e525f6ec59f..75fa921d8540 100644
--- a/drivers/cpufreq/cpufreq-dt-platdev.c
+++ b/drivers/cpufreq/cpufreq-dt-platdev.c
@@ -29,6 +29,17 @@ static const struct of_device_id machines[] __initconst = {
{ .compatible = "samsung,exynos5800", },
#endif
+ { .compatible = "rockchip,rk2928", },
+ { .compatible = "rockchip,rk3036", },
+ { .compatible = "rockchip,rk3066a", },
+ { .compatible = "rockchip,rk3066b", },
+ { .compatible = "rockchip,rk3188", },
+ { .compatible = "rockchip,rk3228", },
+ { .compatible = "rockchip,rk3288", },
+ { .compatible = "rockchip,rk3366", },
+ { .compatible = "rockchip,rk3368", },
+ { .compatible = "rockchip,rk3399", },
+
{ .compatible = "ti,omap2", },
{ .compatible = "ti,omap3", },
{ .compatible = "ti,omap4", },
--
2.7.1.410.g6faf27b
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [PATCH V2 5/9] cpufreq: rockchip: Use generic platdev driver
2016-04-22 11:28 ` [PATCH V2 5/9] cpufreq: rockchip: " Viresh Kumar
@ 2016-04-22 13:58 ` Heiko Stübner
0 siblings, 0 replies; 12+ messages in thread
From: Heiko Stübner @ 2016-04-22 13:58 UTC (permalink / raw)
To: Viresh Kumar
Cc: Rafael Wysocki, linaro-kernel, linux-pm, geert, Finley Xiao,
Arnd Bergmann, linux-arm-kernel, linux-rockchip, linux-kernel
Am Freitag, 22. April 2016, 16:58:43 schrieb Viresh Kumar:
> From: Finley Xiao <finley.xiao@rock-chips.com>
>
> This patch add rockchip's compatible string to the compat list and
> remove similar code from platform code for supporting generic platdev
> driver.
>
> Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
very cool to have that cpufreq stuff move somewhere else
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
> ---
> arch/arm/mach-rockchip/rockchip.c | 1 -
> drivers/cpufreq/cpufreq-dt-platdev.c | 11 +++++++++++
> 2 files changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-rockchip/rockchip.c
> b/arch/arm/mach-rockchip/rockchip.c index 3f07cc5dfe5f..beb71da5d9c8 100644
> --- a/arch/arm/mach-rockchip/rockchip.c
> +++ b/arch/arm/mach-rockchip/rockchip.c
> @@ -74,7 +74,6 @@ static void __init rockchip_dt_init(void)
> {
> rockchip_suspend_init();
> of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
> - platform_device_register_simple("cpufreq-dt", 0, NULL, 0);
> }
>
> static const char * const rockchip_board_dt_compat[] = {
> diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c
> b/drivers/cpufreq/cpufreq-dt-platdev.c index 4e525f6ec59f..75fa921d8540
> 100644
> --- a/drivers/cpufreq/cpufreq-dt-platdev.c
> +++ b/drivers/cpufreq/cpufreq-dt-platdev.c
> @@ -29,6 +29,17 @@ static const struct of_device_id machines[] __initconst =
> { { .compatible = "samsung,exynos5800", },
> #endif
>
> + { .compatible = "rockchip,rk2928", },
> + { .compatible = "rockchip,rk3036", },
> + { .compatible = "rockchip,rk3066a", },
> + { .compatible = "rockchip,rk3066b", },
> + { .compatible = "rockchip,rk3188", },
> + { .compatible = "rockchip,rk3228", },
> + { .compatible = "rockchip,rk3288", },
> + { .compatible = "rockchip,rk3366", },
> + { .compatible = "rockchip,rk3368", },
> + { .compatible = "rockchip,rk3399", },
> +
> { .compatible = "ti,omap2", },
> { .compatible = "ti,omap3", },
> { .compatible = "ti,omap4", },
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH V2 6/9] cpufreq: shmobile: Use generic platdev driver
2016-04-22 11:28 [PATCH V2 0/9] cpufreq: dt: Don't create platform-device from platform code Viresh Kumar
` (4 preceding siblings ...)
[not found] ` <cover.1461324267.git.viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
@ 2016-04-22 11:28 ` Viresh Kumar
2016-04-22 11:28 ` [PATCH V2 7/9] cpufreq: sunxi: " Viresh Kumar
` (3 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: Viresh Kumar @ 2016-04-22 11:28 UTC (permalink / raw)
To: Rafael Wysocki, Simon Horman, Magnus Damm, Viresh Kumar
Cc: linaro-kernel, linux-pm, geert, Arnd Bergmann, linux-renesas-soc,
linux-arm-kernel, linux-kernel
The cpufreq-dt-platdev driver supports creation of cpufreq-dt platform
device now, reuse that and remove similar code from platform code.
Cc: Simon Horman <horms@verge.net.au>
Cc: Magnus Damm <magnus.damm@gmail.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
arch/arm/mach-shmobile/Makefile | 1 -
arch/arm/mach-shmobile/common.h | 7 -------
arch/arm/mach-shmobile/cpufreq.c | 19 -------------------
drivers/cpufreq/cpufreq-dt-platdev.c | 12 ++++++++++++
4 files changed, 12 insertions(+), 27 deletions(-)
delete mode 100644 arch/arm/mach-shmobile/cpufreq.c
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index a65c80ac9009..c9ea0e6ff4f9 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -38,7 +38,6 @@ smp-$(CONFIG_ARCH_EMEV2) += smp-emev2.o headsmp-scu.o platsmp-scu.o
# PM objects
obj-$(CONFIG_SUSPEND) += suspend.o
-obj-$(CONFIG_CPU_FREQ) += cpufreq.o
obj-$(CONFIG_PM_RCAR) += pm-rcar.o
obj-$(CONFIG_PM_RMOBILE) += pm-rmobile.o
obj-$(CONFIG_ARCH_RCAR_GEN2) += pm-rcar-gen2.o
diff --git a/arch/arm/mach-shmobile/common.h b/arch/arm/mach-shmobile/common.h
index 5464b7a75e30..3b562d87826d 100644
--- a/arch/arm/mach-shmobile/common.h
+++ b/arch/arm/mach-shmobile/common.h
@@ -25,16 +25,9 @@ static inline int shmobile_suspend_init(void) { return 0; }
static inline void shmobile_smp_apmu_suspend_init(void) { }
#endif
-#ifdef CONFIG_CPU_FREQ
-int shmobile_cpufreq_init(void);
-#else
-static inline int shmobile_cpufreq_init(void) { return 0; }
-#endif
-
static inline void __init shmobile_init_late(void)
{
shmobile_suspend_init();
- shmobile_cpufreq_init();
}
#endif /* __ARCH_MACH_COMMON_H */
diff --git a/arch/arm/mach-shmobile/cpufreq.c b/arch/arm/mach-shmobile/cpufreq.c
deleted file mode 100644
index 634d701c56a7..000000000000
--- a/arch/arm/mach-shmobile/cpufreq.c
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * CPUFreq support code for SH-Mobile ARM
- *
- * Copyright (C) 2014 Gaku Inami
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License. See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-
-#include <linux/platform_device.h>
-
-#include "common.h"
-
-int __init shmobile_cpufreq_init(void)
-{
- platform_device_register_simple("cpufreq-dt", -1, NULL, 0);
- return 0;
-}
diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-dt-platdev.c
index 75fa921d8540..4b94fe3427f9 100644
--- a/drivers/cpufreq/cpufreq-dt-platdev.c
+++ b/drivers/cpufreq/cpufreq-dt-platdev.c
@@ -29,6 +29,18 @@ static const struct of_device_id machines[] __initconst = {
{ .compatible = "samsung,exynos5800", },
#endif
+ { .compatible = "renesas,emev2", },
+ { .compatible = "renesas,r7s72100", },
+ { .compatible = "renesas,r8a73a4", },
+ { .compatible = "renesas,r8a7740", },
+ { .compatible = "renesas,r8a7778", },
+ { .compatible = "renesas,r8a7779", },
+ { .compatible = "renesas,r8a7790", },
+ { .compatible = "renesas,r8a7791", },
+ { .compatible = "renesas,r8a7793", },
+ { .compatible = "renesas,r8a7794", },
+ { .compatible = "renesas,sh73a0", },
+
{ .compatible = "rockchip,rk2928", },
{ .compatible = "rockchip,rk3036", },
{ .compatible = "rockchip,rk3066a", },
--
2.7.1.410.g6faf27b
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH V2 7/9] cpufreq: sunxi: Use generic platdev driver
2016-04-22 11:28 [PATCH V2 0/9] cpufreq: dt: Don't create platform-device from platform code Viresh Kumar
` (5 preceding siblings ...)
2016-04-22 11:28 ` [PATCH V2 6/9] cpufreq: shmobile: " Viresh Kumar
@ 2016-04-22 11:28 ` Viresh Kumar
2016-04-22 11:28 ` [PATCH V2 8/9] cpufreq: zynq: " Viresh Kumar
` (2 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: Viresh Kumar @ 2016-04-22 11:28 UTC (permalink / raw)
To: Rafael Wysocki, Maxime Ripard, Chen-Yu Tsai, Viresh Kumar
Cc: linaro-kernel, linux-pm, geert, Arnd Bergmann, linux-arm-kernel,
linux-kernel
The cpufreq-dt-platdev driver supports creation of cpufreq-dt platform
device now, reuse that and remove similar code from platform code.
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
arch/arm/mach-sunxi/sunxi.c | 9 ---------
drivers/cpufreq/cpufreq-dt-platdev.c | 12 ++++++++++++
2 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/arch/arm/mach-sunxi/sunxi.c b/arch/arm/mach-sunxi/sunxi.c
index 3c156190a1d4..95dca8c2c9ed 100644
--- a/arch/arm/mach-sunxi/sunxi.c
+++ b/arch/arm/mach-sunxi/sunxi.c
@@ -17,11 +17,6 @@
#include <asm/mach/arch.h>
-static void __init sunxi_dt_cpufreq_init(void)
-{
- platform_device_register_simple("cpufreq-dt", -1, NULL, 0);
-}
-
static const char * const sunxi_board_dt_compat[] = {
"allwinner,sun4i-a10",
"allwinner,sun5i-a10s",
@@ -32,7 +27,6 @@ static const char * const sunxi_board_dt_compat[] = {
DT_MACHINE_START(SUNXI_DT, "Allwinner sun4i/sun5i Families")
.dt_compat = sunxi_board_dt_compat,
- .init_late = sunxi_dt_cpufreq_init,
MACHINE_END
static const char * const sun6i_board_dt_compat[] = {
@@ -53,7 +47,6 @@ static void __init sun6i_timer_init(void)
DT_MACHINE_START(SUN6I_DT, "Allwinner sun6i (A31) Family")
.init_time = sun6i_timer_init,
.dt_compat = sun6i_board_dt_compat,
- .init_late = sunxi_dt_cpufreq_init,
MACHINE_END
static const char * const sun7i_board_dt_compat[] = {
@@ -63,7 +56,6 @@ static const char * const sun7i_board_dt_compat[] = {
DT_MACHINE_START(SUN7I_DT, "Allwinner sun7i (A20) Family")
.dt_compat = sun7i_board_dt_compat,
- .init_late = sunxi_dt_cpufreq_init,
MACHINE_END
static const char * const sun8i_board_dt_compat[] = {
@@ -77,7 +69,6 @@ static const char * const sun8i_board_dt_compat[] = {
DT_MACHINE_START(SUN8I_DT, "Allwinner sun8i Family")
.init_time = sun6i_timer_init,
.dt_compat = sun8i_board_dt_compat,
- .init_late = sunxi_dt_cpufreq_init,
MACHINE_END
static const char * const sun9i_board_dt_compat[] = {
diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-dt-platdev.c
index 4b94fe3427f9..24dde5e256d4 100644
--- a/drivers/cpufreq/cpufreq-dt-platdev.c
+++ b/drivers/cpufreq/cpufreq-dt-platdev.c
@@ -12,6 +12,18 @@
#include <linux/platform_device.h>
static const struct of_device_id machines[] __initconst = {
+ { .compatible = "allwinner,sun4i-a10", },
+ { .compatible = "allwinner,sun5i-a10s", },
+ { .compatible = "allwinner,sun5i-a13", },
+ { .compatible = "allwinner,sun5i-r8", },
+ { .compatible = "allwinner,sun6i-a31", },
+ { .compatible = "allwinner,sun6i-a31s", },
+ { .compatible = "allwinner,sun7i-a20", },
+ { .compatible = "allwinner,sun8i-a23", },
+ { .compatible = "allwinner,sun8i-a33", },
+ { .compatible = "allwinner,sun8i-a83t", },
+ { .compatible = "allwinner,sun8i-h3", },
+
{ .compatible = "fsl,imx27", },
{ .compatible = "fsl,imx51", },
{ .compatible = "fsl,imx53", },
--
2.7.1.410.g6faf27b
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH V2 8/9] cpufreq: zynq: Use generic platdev driver
2016-04-22 11:28 [PATCH V2 0/9] cpufreq: dt: Don't create platform-device from platform code Viresh Kumar
` (6 preceding siblings ...)
2016-04-22 11:28 ` [PATCH V2 7/9] cpufreq: sunxi: " Viresh Kumar
@ 2016-04-22 11:28 ` Viresh Kumar
2016-04-22 11:28 ` [PATCH V2 9/9] cpufreq: hisilicon: " Viresh Kumar
2016-04-26 0:06 ` [PATCH V2 0/9] cpufreq: dt: Don't create platform-device from platform code Rafael J. Wysocki
9 siblings, 0 replies; 12+ messages in thread
From: Viresh Kumar @ 2016-04-22 11:28 UTC (permalink / raw)
To: Rafael Wysocki, Michal Simek, Sören Brinkmann, Viresh Kumar
Cc: linaro-kernel, linux-pm, geert, Arnd Bergmann, linux-arm-kernel,
linux-kernel
The cpufreq-dt-platdev driver supports creation of cpufreq-dt platform
device now, reuse that and remove similar code from platform code.
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Sören Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
arch/arm/mach-zynq/common.c | 2 --
drivers/cpufreq/cpufreq-dt-platdev.c | 2 ++
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-zynq/common.c b/arch/arm/mach-zynq/common.c
index 860ffb663f02..da876d28ccbc 100644
--- a/arch/arm/mach-zynq/common.c
+++ b/arch/arm/mach-zynq/common.c
@@ -110,7 +110,6 @@ static void __init zynq_init_late(void)
*/
static void __init zynq_init_machine(void)
{
- struct platform_device_info devinfo = { .name = "cpufreq-dt", };
struct soc_device_attribute *soc_dev_attr;
struct soc_device *soc_dev;
struct device *parent = NULL;
@@ -145,7 +144,6 @@ static void __init zynq_init_machine(void)
of_platform_populate(NULL, of_default_bus_match_table, NULL, parent);
platform_device_register(&zynq_cpuidle_device);
- platform_device_register_full(&devinfo);
}
static void __init zynq_timer_init(void)
diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-dt-platdev.c
index 24dde5e256d4..5ad29383e862 100644
--- a/drivers/cpufreq/cpufreq-dt-platdev.c
+++ b/drivers/cpufreq/cpufreq-dt-platdev.c
@@ -68,6 +68,8 @@ static const struct of_device_id machines[] __initconst = {
{ .compatible = "ti,omap3", },
{ .compatible = "ti,omap4", },
{ .compatible = "ti,omap5", },
+
+ { .compatible = "xlnx,zynq-7000", },
};
static int __init cpufreq_dt_platdev_init(void)
--
2.7.1.410.g6faf27b
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH V2 9/9] cpufreq: hisilicon: Use generic platdev driver
2016-04-22 11:28 [PATCH V2 0/9] cpufreq: dt: Don't create platform-device from platform code Viresh Kumar
` (7 preceding siblings ...)
2016-04-22 11:28 ` [PATCH V2 8/9] cpufreq: zynq: " Viresh Kumar
@ 2016-04-22 11:28 ` Viresh Kumar
2016-04-26 0:06 ` [PATCH V2 0/9] cpufreq: dt: Don't create platform-device from platform code Rafael J. Wysocki
9 siblings, 0 replies; 12+ messages in thread
From: Viresh Kumar @ 2016-04-22 11:28 UTC (permalink / raw)
To: Rafael Wysocki, Viresh Kumar
Cc: linaro-kernel, linux-pm, geert, Leo Yan, Arnd Bergmann,
linux-kernel
The cpufreq-dt-platdev driver supports creation of cpufreq-dt platform
device now, reuse that and remove similar code from platform code.
Cc: Leo Yan <leo.yan@linaro.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/cpufreq/Kconfig.arm | 9 --------
drivers/cpufreq/Makefile | 1 -
drivers/cpufreq/cpufreq-dt-platdev.c | 2 ++
drivers/cpufreq/hisi-acpu-cpufreq.c | 42 ------------------------------------
4 files changed, 2 insertions(+), 52 deletions(-)
delete mode 100644 drivers/cpufreq/hisi-acpu-cpufreq.c
diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm
index 14b1f9393b05..d89b8afe23b6 100644
--- a/drivers/cpufreq/Kconfig.arm
+++ b/drivers/cpufreq/Kconfig.arm
@@ -50,15 +50,6 @@ config ARM_HIGHBANK_CPUFREQ
If in doubt, say N.
-config ARM_HISI_ACPU_CPUFREQ
- tristate "Hisilicon ACPU CPUfreq driver"
- depends on ARCH_HISI && CPUFREQ_DT
- select PM_OPP
- help
- This enables the hisilicon ACPU CPUfreq driver.
-
- If in doubt, say N.
-
config ARM_IMX6Q_CPUFREQ
tristate "Freescale i.MX6 cpufreq support"
depends on ARCH_MXC
diff --git a/drivers/cpufreq/Makefile b/drivers/cpufreq/Makefile
index d7b646c0f2e9..2cce2cd400f9 100644
--- a/drivers/cpufreq/Makefile
+++ b/drivers/cpufreq/Makefile
@@ -55,7 +55,6 @@ obj-$(CONFIG_ARCH_DAVINCI) += davinci-cpufreq.o
obj-$(CONFIG_UX500_SOC_DB8500) += dbx500-cpufreq.o
obj-$(CONFIG_ARM_EXYNOS5440_CPUFREQ) += exynos5440-cpufreq.o
obj-$(CONFIG_ARM_HIGHBANK_CPUFREQ) += highbank-cpufreq.o
-obj-$(CONFIG_ARM_HISI_ACPU_CPUFREQ) += hisi-acpu-cpufreq.o
obj-$(CONFIG_ARM_IMX6Q_CPUFREQ) += imx6q-cpufreq.o
obj-$(CONFIG_ARM_INTEGRATOR) += integrator-cpufreq.o
obj-$(CONFIG_ARM_KIRKWOOD_CPUFREQ) += kirkwood-cpufreq.o
diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-dt-platdev.c
index 5ad29383e862..ac4a0ba87c12 100644
--- a/drivers/cpufreq/cpufreq-dt-platdev.c
+++ b/drivers/cpufreq/cpufreq-dt-platdev.c
@@ -24,6 +24,8 @@ static const struct of_device_id machines[] __initconst = {
{ .compatible = "allwinner,sun8i-a83t", },
{ .compatible = "allwinner,sun8i-h3", },
+ { .compatible = "hisilicon,hi6220", },
+
{ .compatible = "fsl,imx27", },
{ .compatible = "fsl,imx51", },
{ .compatible = "fsl,imx53", },
diff --git a/drivers/cpufreq/hisi-acpu-cpufreq.c b/drivers/cpufreq/hisi-acpu-cpufreq.c
deleted file mode 100644
index 026d5b2224de..000000000000
--- a/drivers/cpufreq/hisi-acpu-cpufreq.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Hisilicon Platforms Using ACPU CPUFreq Support
- *
- * Copyright (c) 2015 Hisilicon Limited.
- * Copyright (c) 2015 Linaro Limited.
- *
- * Leo Yan <leo.yan@linaro.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed "as is" WITHOUT ANY WARRANTY of any
- * kind, whether express or implied; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
-
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
-#include <linux/err.h>
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/of.h>
-#include <linux/platform_device.h>
-
-static int __init hisi_acpu_cpufreq_driver_init(void)
-{
- struct platform_device *pdev;
-
- if (!of_machine_is_compatible("hisilicon,hi6220"))
- return -ENODEV;
-
- pdev = platform_device_register_simple("cpufreq-dt", -1, NULL, 0);
- return PTR_ERR_OR_ZERO(pdev);
-}
-module_init(hisi_acpu_cpufreq_driver_init);
-
-MODULE_AUTHOR("Leo Yan <leo.yan@linaro.org>");
-MODULE_DESCRIPTION("Hisilicon acpu cpufreq driver");
-MODULE_LICENSE("GPL v2");
--
2.7.1.410.g6faf27b
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [PATCH V2 0/9] cpufreq: dt: Don't create platform-device from platform code
2016-04-22 11:28 [PATCH V2 0/9] cpufreq: dt: Don't create platform-device from platform code Viresh Kumar
` (8 preceding siblings ...)
2016-04-22 11:28 ` [PATCH V2 9/9] cpufreq: hisilicon: " Viresh Kumar
@ 2016-04-26 0:06 ` Rafael J. Wysocki
9 siblings, 0 replies; 12+ messages in thread
From: Rafael J. Wysocki @ 2016-04-26 0:06 UTC (permalink / raw)
To: Viresh Kumar
Cc: linaro-kernel, linux-pm, geert, Chen-Yu Tsai, Leo Yan,
Magnus Damm, Maxime Ripard, Michal Simek, Sascha Hauer,
Sebastian Hesselbarth, Shawn Guo, Simon Horman,
Sören Brinkmann, Tony Lindgren
On Friday, April 22, 2016 04:58:38 PM Viresh Kumar wrote:
> Hi Rafael,
>
> This migrates rest of the platforms to use cpufreq-dt-platdev.c. There
> are few exceptions though:
> - mvebu: it uses platform data and its problem will be solved in a
> separate series.
> - highbank, s5pv210, sti, tegra124: these platforms already have cpufreq
> drivers in drivers/cpufreq/, which does some other stuff and finally
> create the device. There are sequencing issues, and so they will be
> left as it is.
>
> V1->V2:
> - Acks from Arnd for all the patches and from few other maintainers
> - Finley sent his patch for rockchip 2 minutes before I sent mine :), and so I
> picked his patch instead of mine.
> - First patch is new based on suggestions from Geert.
> - Arnd suggested to get rid of a init routine in imx patch, that's done as well.
>
> I think we can push this series now that its been Acked by Arnd..
>
> Finley Xiao (1):
> cpufreq: rockchip: Use generic platdev driver
>
> Viresh Kumar (8):
> cpufreq: dt: Mark platdev machines array as __initconst
> cpufreq: berlin: Use generic platdev driver
> cpufreq: imx: Use generic platdev driver
> cpufreq: omap: Use generic platdev driver
> cpufreq: shmobile: Use generic platdev driver
> cpufreq: sunxi: Use generic platdev driver
> cpufreq: zynq: Use generic platdev driver
> cpufreq: hisilicon: Use generic platdev driver
>
> arch/arm/mach-berlin/berlin.c | 6 ----
> arch/arm/mach-imx/imx27-dt.c | 10 -------
> arch/arm/mach-imx/mach-imx51.c | 3 --
> arch/arm/mach-imx/mach-imx53.c | 2 --
> arch/arm/mach-imx/mach-imx7d.c | 6 ----
> arch/arm/mach-omap2/pm.c | 7 ++---
> arch/arm/mach-rockchip/rockchip.c | 1 -
> arch/arm/mach-shmobile/Makefile | 1 -
> arch/arm/mach-shmobile/common.h | 7 -----
> arch/arm/mach-shmobile/cpufreq.c | 19 -------------
> arch/arm/mach-sunxi/sunxi.c | 9 ------
> arch/arm/mach-zynq/common.c | 2 --
> drivers/cpufreq/Kconfig.arm | 9 ------
> drivers/cpufreq/Makefile | 1 -
> drivers/cpufreq/cpufreq-dt-platdev.c | 53 +++++++++++++++++++++++++++++++++++-
> drivers/cpufreq/hisi-acpu-cpufreq.c | 42 ----------------------------
> 16 files changed, 54 insertions(+), 124 deletions(-)
> delete mode 100644 arch/arm/mach-shmobile/cpufreq.c
> delete mode 100644 drivers/cpufreq/hisi-acpu-cpufreq.c
All [1-9/9] applied, thanks!
^ permalink raw reply [flat|nested] 12+ messages in thread