Skip to contentSkip to conversation

cpufreq: dt: Don't create platform-device from platform code

PATCH Superseded Viresh Kumar 7 participants 21 messages Apr 21, 2016 – Apr 23, 2016

Subsystems (11)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
author maintainer
#1 lore raw

PATCH 1/8 cpufreq: berlin: Use generic platdev driver

In reply to Viresh Kumar

The cpufreq-dt-platdev driver supports creation of cpufreq-dt platform device now, reuse that and remove similar code from platform code.

Cc Antoine Tenart <[email protected]>
Cc Sebastian Hesselbarth <[email protected]>
---
 arch/arm/mach-berlin/berlin.c        | 6 ------
 drivers/cpufreq/cpufreq-dt-platdev.c | 2 ++
 2 files changed, 2 insertions(+), 6 deletions(-)
arch/arm/mach-berlin/berlin.c +0 -6
index 25d73870ccca..ac181c6797ee 100644
@@ -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
drivers/cpufreq/cpufreq-dt-platdev.c +2 -0
index f2ae7ad99a3c..3b3e6804cf14 100644
@@ -12,6 +12,8 @@
 #include <linux/platform_device.h>
 
 static const struct of_device_id machines[] = {
+	{ .compatible = "marvell,berlin", },
+
 	{ .compatible = "samsung,exynos3250", },
 	{ .compatible = "samsung,exynos4210", },
 	{ .compatible = "samsung,exynos4212", },
Signature · 1 line
2.7.1.410.g6faf27b
author maintainer
#3 lore raw

PATCH 2/8 cpufreq: imx: Use generic platdev driver

In reply to Viresh Kumar

The cpufreq-dt-platdev driver supports creation of cpufreq-dt platform device now, reuse that and remove similar code from platform code.

Cc Shawn Guo <[email protected]>
Cc Sascha Hauer <[email protected]>
---
 arch/arm/mach-imx/imx27-dt.c         | 4 ----
 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(+), 15 deletions(-)
arch/arm/mach-imx/imx27-dt.c +0 -4
index bd42d1bd10af..90c62bf01f9e 100644
@@ -20,11 +20,7 @@
 
 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 = {
arch/arm/mach-imx/mach-imx51.c +0 -3
index 6883fbaf9484..10a82a4f1e58 100644
@@ -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)
arch/arm/mach-imx/mach-imx53.c +0 -2
index 86316a979297..18b5c5c136db 100644
@@ -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 = {
arch/arm/mach-imx/mach-imx7d.c +0 -6
index 5a27f20c9a82..b450f525a670 100644
@@ -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
drivers/cpufreq/cpufreq-dt-platdev.c +5 -0
index 3b3e6804cf14..ac12c4a02964 100644
@@ -12,6 +12,11 @@
 #include <linux/platform_device.h>
 
 static const struct of_device_id machines[] = {
+	{ .compatible = "fsl,imx27", },
+	{ .compatible = "fsl,imx51", },
+	{ .compatible = "fsl,imx53", },
+	{ .compatible = "fsl,imx7d", },
+
 	{ .compatible = "marvell,berlin", },
 
 	{ .compatible = "samsung,exynos3250", },
Signature · 1 line
2.7.1.410.g6faf27b
author maintainer
#8 lore raw

PATCH 3/8 cpufreq: omap: Use generic platdev driver

In reply to Viresh Kumar

The cpufreq-dt-platdev driver supports creation of cpufreq-dt platform device now, reuse that and remove similar code from platform code.

---
 arch/arm/mach-omap2/pm.c             | 7 ++-----
 drivers/cpufreq/cpufreq-dt-platdev.c | 5 +++++
 2 files changed, 7 insertions(+), 5 deletions(-)
arch/arm/mach-omap2/pm.c +2 -5
index 58920bc8807b..2f7b11da7d5d 100644
@@ -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)
drivers/cpufreq/cpufreq-dt-platdev.c +5 -0
index ac12c4a02964..3d7d459aed25 100644
@@ -28,6 +28,11 @@ static const struct of_device_id machines[] = {
 	{ .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)
Signature · 1 line
2.7.1.410.g6faf27b
author maintainer
#9 lore raw

PATCH 4/8 cpufreq: rockchip: Use generic platdev driver

In reply to Viresh Kumar

The cpufreq-dt-platdev driver supports creation of cpufreq-dt platform device now, reuse that and remove similar code from platform code.

Cc Heiko Stuebner <[email protected]>
---
 arch/arm/mach-rockchip/rockchip.c    | 1 -
 drivers/cpufreq/cpufreq-dt-platdev.c | 7 +++++++
 2 files changed, 7 insertions(+), 1 deletion(-)
arch/arm/mach-rockchip/rockchip.c +0 -1
index 3f07cc5dfe5f..beb71da5d9c8 100644
@@ -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[] = {
drivers/cpufreq/cpufreq-dt-platdev.c +7 -0
index 3d7d459aed25..b831f1463227 100644
@@ -29,6 +29,13 @@ static const struct of_device_id machines[] = {
 	{ .compatible = "samsung,exynos5800", },
 #endif
 
+	{ .compatible = "rockchip,rk2928", },
+	{ .compatible = "rockchip,rk3066a", },
+	{ .compatible = "rockchip,rk3066b", },
+	{ .compatible = "rockchip,rk3188", },
+	{ .compatible = "rockchip,rk3228", },
+	{ .compatible = "rockchip,rk3288", },
+
 	{ .compatible = "ti,omap2", },
 	{ .compatible = "ti,omap3", },
 	{ .compatible = "ti,omap4", },
Signature · 1 line
2.7.1.410.g6faf27b
author maintainer
#10 lore raw

PATCH 5/8 cpufreq: shmobile: Use generic platdev driver

In reply to Viresh Kumar

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 <[email protected]>
Cc Magnus Damm <[email protected]>
---
 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
arch/arm/mach-shmobile/Makefile +0 -1
index a65c80ac9009..c9ea0e6ff4f9 100644
@@ -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
arch/arm/mach-shmobile/common.h +0 -7
index 5464b7a75e30..3b562d87826d 100644
@@ -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 */
arch/arm/mach-shmobile/cpufreq.c deleted +0 -19
deleted file mode 100644
index 634d701c56a7..000000000000
@@ -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;
-}
drivers/cpufreq/cpufreq-dt-platdev.c +12 -0
index b831f1463227..05ac0ea25c49 100644
@@ -29,6 +29,18 @@ static const struct of_device_id machines[] = {
 	{ .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,rk3066a", },
 	{ .compatible = "rockchip,rk3066b", },
Signature · 1 line
2.7.1.410.g6faf27b
author maintainer
#15 lore raw

PATCH 6/8 cpufreq: sunxi: Use generic platdev driver

In reply to Viresh Kumar

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 <[email protected]>
Cc Chen-Yu Tsai <[email protected]>
---
 arch/arm/mach-sunxi/sunxi.c          |  9 ---------
 drivers/cpufreq/cpufreq-dt-platdev.c | 12 ++++++++++++
 2 files changed, 12 insertions(+), 9 deletions(-)
arch/arm/mach-sunxi/sunxi.c +0 -9
index 3c156190a1d4..95dca8c2c9ed 100644
@@ -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[] = {
drivers/cpufreq/cpufreq-dt-platdev.c +12 -0
index 05ac0ea25c49..db6767a1f975 100644
@@ -12,6 +12,18 @@
 #include <linux/platform_device.h>
 
 static const struct of_device_id machines[] = {
+	{ .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", },
Signature · 1 line
2.7.1.410.g6faf27b
author maintainer
#17 lore raw

PATCH 7/8 cpufreq: zynq: Use generic platdev driver

In reply to Viresh Kumar

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 <[email protected]>
Cc S?ren Brinkmann <[email protected]>
---
 arch/arm/mach-zynq/common.c          | 2 --
 drivers/cpufreq/cpufreq-dt-platdev.c | 2 ++
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-zynq/common.c +0 -2
index 860ffb663f02..da876d28ccbc 100644
@@ -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)
drivers/cpufreq/cpufreq-dt-platdev.c +2 -0
index db6767a1f975..c8a3eceac356 100644
@@ -64,6 +64,8 @@ static const struct of_device_id machines[] = {
 	{ .compatible = "ti,omap3", },
 	{ .compatible = "ti,omap4", },
 	{ .compatible = "ti,omap5", },
+
+	{ .compatible = "xlnx,zynq-7000", },
 };
 
 static int __init cpufreq_dt_platdev_init(void)
Signature · 1 line
2.7.1.410.g6faf27b
author maintainer
#18 lore raw

PATCH 8/8 cpufreq: hisilicon: Use generic platdev driver

In reply to Viresh Kumar

The cpufreq-dt-platdev driver supports creation of cpufreq-dt platform device now, reuse that and remove similar code from platform code.

---
 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
drivers/cpufreq/Kconfig.arm +0 -9
index 14b1f9393b05..d89b8afe23b6 100644
@@ -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
drivers/cpufreq/Makefile +0 -1
index d7b646c0f2e9..2cce2cd400f9 100644
@@ -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
drivers/cpufreq/cpufreq-dt-platdev.c +2 -0
index c8a3eceac356..69b2a222c84e 100644
@@ -24,6 +24,8 @@ static const struct of_device_id machines[] = {
 	{ .compatible = "allwinner,sun8i-a83t", },
 	{ .compatible = "allwinner,sun8i-h3", },
 
+	{ .compatible = "hisilicon,hi6220", },
+
 	{ .compatible = "fsl,imx27", },
 	{ .compatible = "fsl,imx51", },
 	{ .compatible = "fsl,imx53", },
drivers/cpufreq/hisi-acpu-cpufreq.c deleted +0 -42

42 lines not on this page · raw message

Signature · 1 line
2.7.1.410.g6faf27b

Viresh Kumar

author maintainer
#0 lore raw

cover cpufreq: dt: Don't create platform-device from platform code

Hi,

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.

I have pushed these for testing by:
- kernelci (build/boot testing for ARM)
- Intel's buildbot (build for ARM, build/boot for Intel)

Viresh Kumar (8):
cpufreq: berlin: Use generic platdev driver
cpufreq: imx: Use generic platdev driver
cpufreq: omap: Use generic platdev driver
cpufreq: rockchip: 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         |  4 ---
 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 | 47 ++++++++++++++++++++++++++++++++++++
 drivers/cpufreq/hisi-acpu-cpufreq.c  | 42 --------------------------------
 16 files changed, 49 insertions(+), 117 deletions(-)
 delete mode 100644 arch/arm/mach-shmobile/cpufreq.c
 delete mode 100644 drivers/cpufreq/hisi-acpu-cpufreq.c
Signature · 1 line
2.7.1.410.g6faf27b
Acked-by on v1 6/8
#16 lore raw

Re: [PATCH 6/8] cpufreq: sunxi: Use generic platdev driver

In reply to Viresh Kumar
Quoted 6 lines · Viresh Kumar

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 <[email protected]>
Cc Chen-Yu Tsai <[email protected]>

Thanks,
Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160421/9c237690/attachment.sig>
Acked-by on v1 1/8
#2 lore raw

Re: [PATCH 1/8] cpufreq: berlin: Use generic platdev driver

In reply to Viresh Kumar

Hi,

Quoted 6 lines · Viresh Kumar

The cpufreq-dt-platdev driver supports creation of cpufreq-dt platform device now, reuse that and remove similar code from platform code.

Cc Antoine Tenart <[email protected]>
Cc Sebastian Hesselbarth <[email protected]>

Thanks!

Antoine

Quoted 45 lines
---
 arch/arm/mach-berlin/berlin.c        | 6 ------
 drivers/cpufreq/cpufreq-dt-platdev.c | 2 ++
 2 files changed, 2 insertions(+), 6 deletions(-)
arch/arm/mach-berlin/berlin.c +0 -6
index 25d73870ccca..ac181c6797ee 100644
@@ -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
drivers/cpufreq/cpufreq-dt-platdev.c +2 -0
index f2ae7ad99a3c..3b3e6804cf14 100644
@@ -12,6 +12,8 @@
 #include <linux/platform_device.h>
 
 static const struct of_device_id machines[] = {
+	{ .compatible = "marvell,berlin", },
+
 	{ .compatible = "samsung,exynos3250", },
 	{ .compatible = "samsung,exynos4210", },
 	{ .compatible = "samsung,exynos4212", },
Signature · 1 line
2.7.1.410.g6faf27b
Signature · 10 lines
Antoine T?nart, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160421/88b91cfd/attachment.sig>
Acked-by on v1 2/8
#4 lore raw

Re: [PATCH 2/8] cpufreq: imx: Use generic platdev driver

In reply to Viresh Kumar

Am Donnerstag, den 21.04.2016, 14:13 +0530 schrieb Viresh Kumar:

Quoted 6 lines

The cpufreq-dt-platdev driver supports creation of cpufreq-dt platform device now, reuse that and remove similar code from platform code.

Cc Shawn Guo <[email protected]>
Cc Sascha Hauer <[email protected]>

Looks good to me:

Quoted 95 lines
---
 arch/arm/mach-imx/imx27-dt.c         | 4 ----
 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(+), 15 deletions(-)
arch/arm/mach-imx/imx27-dt.c +0 -4
index bd42d1bd10af..90c62bf01f9e 100644
@@ -20,11 +20,7 @@
 
 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 = {
arch/arm/mach-imx/mach-imx51.c +0 -3
index 6883fbaf9484..10a82a4f1e58 100644
@@ -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)
arch/arm/mach-imx/mach-imx53.c +0 -2
index 86316a979297..18b5c5c136db 100644
@@ -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 = {
arch/arm/mach-imx/mach-imx7d.c +0 -6
index 5a27f20c9a82..b450f525a670 100644
@@ -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
drivers/cpufreq/cpufreq-dt-platdev.c +5 -0
index 3b3e6804cf14..ac12c4a02964 100644
@@ -12,6 +12,11 @@
 #include <linux/platform_device.h>
 
 static const struct of_device_id machines[] = {
+	{ .compatible = "fsl,imx27", },
+	{ .compatible = "fsl,imx51", },
+	{ .compatible = "fsl,imx53", },
+	{ .compatible = "fsl,imx7d", },
+
 	{ .compatible = "marvell,berlin", },
 
 	{ .compatible = "samsung,exynos3250", },
#5 lore raw

Re: [PATCH 2/8] cpufreq: imx: Use generic platdev driver

In reply to Viresh Kumar
Quoted 19 lines · On Thursday 21 April 2016 14:13:48 Viresh Kumar wrote:

The cpufreq-dt-platdev driver supports creation of cpufreq-dt platform device now, reuse that and remove similar code from platform code.

Cc Shawn Guo <[email protected]>
Cc Sascha Hauer <[email protected]>
---
 arch/arm/mach-imx/imx27-dt.c         | 4 ----
 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(+), 15 deletions(-)
arch/arm/mach-imx/imx27-dt.c +0 -0
index bd42d1bd10af..90c62bf01f9e 100644

arch/arm/mach-imx/imx27-dt.c line 25

Quoted 10 lines
arch/arm/mach-imx/imx27-dt.c +0 -4
@@ -20,11 +20,7 @@
 
 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);
 }
 

Please remove the entire function now, a NULL .init_machine machine callback pointer has the same effect as the remaining line.

The rest of the patch is fine.

Arnd

author maintainer
#6 lore raw

Re: [PATCH 2/8] cpufreq: imx: Use generic platdev driver

Quoted 34 lines · Arnd Bergmann
Quoted 19 lines · On Thursday 21 April 2016 14:13:48 Viresh Kumar wrote:

The cpufreq-dt-platdev driver supports creation of cpufreq-dt platform device now, reuse that and remove similar code from platform code.

Cc Shawn Guo <[email protected]>
Cc Sascha Hauer <[email protected]>
---
 arch/arm/mach-imx/imx27-dt.c         | 4 ----
 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(+), 15 deletions(-)
arch/arm/mach-imx/imx27-dt.c +0 -0
index bd42d1bd10af..90c62bf01f9e 100644

arch/arm/mach-imx/imx27-dt.c line 25

Quoted 10 lines
arch/arm/mach-imx/imx27-dt.c +0 -4
@@ -20,11 +20,7 @@
 
 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);
 }
 

Please remove the entire function now, a NULL .init_machine machine callback pointer has the same effect as the remaining line.

Quoted 1 line

The rest of the patch is fine.

Perhaps that should be done in a separate patch I feel. Will do so after this is merged.

Signature · 1 line
viresh
Acked-by on the v1 series
#20 lore raw
In reply to Viresh Kumar
Quoted 10 lines · On Thursday 21 April 2016 14:13:46 Viresh Kumar wrote:

Hi,

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.

Looks good overall, one minor comment for patch 3, thanks a lot for your work on this!

#7 lore raw

Re: [PATCH 2/8] cpufreq: imx: Use generic platdev driver

In reply to Viresh Kumar
Quoted 19 lines · On Thursday 21 April 2016 15:20:32 Viresh Kumar wrote:
Quoted 19 lines
Quoted 5 lines
arch/arm/mach-imx/imx27-dt.c +0 -0
index bd42d1bd10af..90c62bf01f9e 100644

arch/arm/mach-imx/imx27-dt.c line 25

Quoted 10 lines
arch/arm/mach-imx/imx27-dt.c +0 -4
@@ -20,11 +20,7 @@
 
 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);
 }
 

Please remove the entire function now, a NULL .init_machine machine callback pointer has the same effect as the remaining line.

Quoted 5 lines
Quoted 1 line

The rest of the patch is fine.

Perhaps that should be done in a separate patch I feel. Will do so after this is merged.

I would do it in the same patch, just like you remove some of the .init_late() callbacks elsewhere, but it clearly works either way, so do as you like unless Shawn or Sascha have a strong opinion on the matter.

Arnd

#11 lore raw

Re: [PATCH 5/8] cpufreq: shmobile: Use generic platdev driver

In reply to Viresh Kumar

Hi Viresh,

drivers/cpufreq/cpufreq-dt-platdev.c static const struct of_device_id machines[] = { · line 31

Quoted 6 lines · Viresh Kumar
drivers/cpufreq/cpufreq-dt-platdev.c +0 -0
@@ -29,6 +29,18 @@ static const struct of_device_id machines[] = {
        { .compatible = "samsung,exynos5800", },
 #endif
 

I think an #ifdef CONFIG_ARCH_RENESAS block wouldn't hurt, likewise for the other SoCs.
Soon you'll have this file filled with lots of compatible values for random\
SoCs...

Quoted 5 lines
drivers/cpufreq/cpufreq-dt-platdev.c +5 -0
+       { .compatible = "renesas,emev2", },
+       { .compatible = "renesas,r7s72100", },
+       { .compatible = "renesas,r8a73a4", },
+       { .compatible = "renesas,r8a7740", },
+       { .compatible = "renesas,r8a7778", },

drivers/cpufreq/cpufreq-dt-platdev.c static const struct of_device_id machines[] = { · line 46

Quoted 10 lines
drivers/cpufreq/cpufreq-dt-platdev.c +7 -0
+       { .compatible = "renesas,r8a7779", },
+       { .compatible = "renesas,r8a7790", },
+       { .compatible = "renesas,r8a7791", },
+       { .compatible = "renesas,r8a7793", },
+       { .compatible = "renesas,r8a7794", },
+       { .compatible = "renesas,sh73a0", },
+
        { .compatible = "rockchip,rk2928", },
        { .compatible = "rockchip,rk3066a", },
        { .compatible = "rockchip,rk3066b", },

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

author maintainer
#12 lore raw

Re: [PATCH 5/8] cpufreq: shmobile: Use generic platdev driver

Quoted 14 lines · Geert Uytterhoeven

Hi Viresh,

drivers/cpufreq/cpufreq-dt-platdev.c static const struct of_device_id machines[] = { · line 31

Quoted 6 lines · Viresh Kumar
drivers/cpufreq/cpufreq-dt-platdev.c +0 -0
@@ -29,6 +29,18 @@ static const struct of_device_id machines[] = {
        { .compatible = "samsung,exynos5800", },
 #endif
 

I think an #ifdef CONFIG_ARCH_RENESAS block wouldn't hurt, likewise for the other SoCs.
Soon you'll have this file filled with lots of compatible values for random\
SoCs...

This is going to be done once per boot and this shouldn't hurt. And for new platforms we may do things differently as they are going to use opp-v2 bindings.

And, so I am not really in favor of ifdef hackery :)

Signature · 1 line
viresh
#13 lore raw

Re: [PATCH 5/8] cpufreq: shmobile: Use generic platdev driver

Hi Viresh,

Quoted 14 lines · Viresh Kumar
Quoted 12 lines · Geert Uytterhoeven

drivers/cpufreq/cpufreq-dt-platdev.c static const struct of_device_id machines[] = { · line 31

Quoted 6 lines · Viresh Kumar
drivers/cpufreq/cpufreq-dt-platdev.c +0 -0
@@ -29,6 +29,18 @@ static const struct of_device_id machines[] = {
        { .compatible = "samsung,exynos5800", },
 #endif
 

I think an #ifdef CONFIG_ARCH_RENESAS block wouldn't hurt, likewise for the other SoCs.
Soon you'll have this file filled with lots of compatible values for random\
SoCs...

Quoted 2 lines

This is going to be done once per boot and this shouldn't hurt. And for new platforms we may do things differently as they are going to use opp-v2 bindings.

I was mainly thinking about kernel size.
If this is done once per boot, the array should be __initconst, (looking at the code
in next) which is fine as cpufreq_dt_platdev_init() is already __init.

Thanks!

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

author maintainer
#14 lore raw

Re: [PATCH 5/8] cpufreq: shmobile: Use generic platdev driver

Quoted 1 line · Geert Uytterhoeven

I was mainly thinking about kernel size.

Ahh, I see..

Quoted 3 lines

If this is done once per boot, the array should be __initconst, (looking at the code
in next) which is fine as cpufreq_dt_platdev_init() is already __init.

Sure, makes sense.. I will do that as a separate patch.

Though just to correct what I earlier said, if cpufreq-dt is developed as a module, its done once per module insertion :)

Signature · 1 line
viresh
Tested-by on v1 8/8
#19 lore raw

Re: [PATCH 8/8] cpufreq: hisilicon: Use generic platdev driver

In reply to Viresh Kumar
Quoted 5 lines · Viresh Kumar

The cpufreq-dt-platdev driver supports creation of cpufreq-dt platform device now, reuse that and remove similar code from platform code.

Have tested this patch on Hikey, it works well with new driver cpufreq-dt-platdev.c.

Thanks,
Leo Yan

Quoted 104 lines
---
 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
drivers/cpufreq/Kconfig.arm +0 -9
index 14b1f9393b05..d89b8afe23b6 100644
@@ -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
drivers/cpufreq/Makefile +0 -1
index d7b646c0f2e9..2cce2cd400f9 100644
@@ -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
drivers/cpufreq/cpufreq-dt-platdev.c +2 -0
index c8a3eceac356..69b2a222c84e 100644
@@ -24,6 +24,8 @@ static const struct of_device_id machines[] = {
 	{ .compatible = "allwinner,sun8i-a83t", },
 	{ .compatible = "allwinner,sun8i-h3", },
 
+	{ .compatible = "hisilicon,hi6220", },
+
 	{ .compatible = "fsl,imx27", },
 	{ .compatible = "fsl,imx51", },
 	{ .compatible = "fsl,imx53", },
drivers/cpufreq/hisi-acpu-cpufreq.c deleted +0 -42
deleted file mode 100644
index 026d5b2224de..000000000000
@@ -1,42 +0,0 @@
-/*
- * Hisilicon Platforms Using ACPU CPUFreq Support
- *
- * Copyright (c) 2015 Hisilicon Limited.
- * Copyright (c) 2015 Linaro Limited.
- *
- * Leo Yan <[email protected]>
- *
- * 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 <[email protected]>");
-MODULE_DESCRIPTION("Hisilicon acpu cpufreq driver");
-MODULE_LICENSE("GPL v2");
Signature · 1 line
2.7.1.410.g6faf27b