All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cpufreq: rockchip: add driver
@ 2016-03-18 12:10 ` Feng Xiao
  0 siblings, 0 replies; 38+ messages in thread
From: Feng Xiao @ 2016-03-18 12:10 UTC (permalink / raw)
  To: linux, heiko, rjw, viresh.kumar
  Cc: linux-arm-kernel, linux-rockchip, linux-kernel, linux-pm, wxt,
	zyw, jay.xu, tim.chen, xxx, huangtao, Feng Xiao

This driver will directly use cpufreq-dt driver as backend.

As there is not a generic devicetree board file(rockchip.c)
on ARM64 architecture, so remove platform_device_register_simple
in rockchip.c and add a new cpufreq driver to support for all
Rockchip SoCs.

Signed-off-by: Feng Xiao <xf@rock-chips.com>
---
 arch/arm/mach-rockchip/rockchip.c  |  1 -
 drivers/cpufreq/Kconfig.arm        | 10 ++++++++++
 drivers/cpufreq/Makefile           |  1 +
 drivers/cpufreq/rockchip-cpufreq.c | 36 ++++++++++++++++++++++++++++++++++++
 4 files changed, 47 insertions(+), 1 deletion(-)
 create mode 100644 drivers/cpufreq/rockchip-cpufreq.c

diff --git a/arch/arm/mach-rockchip/rockchip.c b/arch/arm/mach-rockchip/rockchip.c
index 3f07cc5..beb71da 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/Kconfig.arm b/drivers/cpufreq/Kconfig.arm
index 14b1f93..1786315 100644
--- a/drivers/cpufreq/Kconfig.arm
+++ b/drivers/cpufreq/Kconfig.arm
@@ -97,6 +97,16 @@ config ARM_OMAP2PLUS_CPUFREQ
 	depends on ARCH_OMAP2PLUS
 	default ARCH_OMAP2PLUS
 
+config ARM_ROCKCHIP_CPUFREQ
+	tristate "Rockchip CPUfreq driver"
+	depends on ARCH_ROCKCHIP && CPUFREQ_DT
+	select PM_OPP
+	help
+	  This adds the CPUFreq driver support for Rockchip SoCs.
+	  The driver will directly use cpufreq-dt driver as backend.
+
+	  If in doubt, say N.
+
 config ARM_S3C_CPUFREQ
 	bool
 	help
diff --git a/drivers/cpufreq/Makefile b/drivers/cpufreq/Makefile
index 9e63fb1..91d8bb7 100644
--- a/drivers/cpufreq/Makefile
+++ b/drivers/cpufreq/Makefile
@@ -61,6 +61,7 @@ obj-$(CONFIG_ARM_MT8173_CPUFREQ)	+= mt8173-cpufreq.o
 obj-$(CONFIG_ARM_OMAP2PLUS_CPUFREQ)	+= omap-cpufreq.o
 obj-$(CONFIG_ARM_PXA2xx_CPUFREQ)	+= pxa2xx-cpufreq.o
 obj-$(CONFIG_PXA3xx)			+= pxa3xx-cpufreq.o
+obj-$(CONFIG_ARM_ROCKCHIP_CPUFREQ)	+= rockchip-cpufreq.o
 obj-$(CONFIG_ARM_S3C24XX_CPUFREQ)	+= s3c24xx-cpufreq.o
 obj-$(CONFIG_ARM_S3C24XX_CPUFREQ_DEBUGFS) += s3c24xx-cpufreq-debugfs.o
 obj-$(CONFIG_ARM_S3C2410_CPUFREQ)	+= s3c2410-cpufreq.o
diff --git a/drivers/cpufreq/rockchip-cpufreq.c b/drivers/cpufreq/rockchip-cpufreq.c
new file mode 100644
index 0000000..ecbadcd
--- /dev/null
+++ b/drivers/cpufreq/rockchip-cpufreq.c
@@ -0,0 +1,36 @@
+/*
+ * Rockchip Platforms CPUFreq Support
+ *
+ * Copyright (C) 2016 Fuzhou Rockchip Electronics Co., Ltd
+ *
+ * Feng Xiao <xf@rock-chips.com>
+ *
+ * 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.
+ */
+
+#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 rockchip_cpufreq_driver_init(void)
+{
+	struct platform_device *pdev;
+
+	pdev = platform_device_register_simple("cpufreq-dt", -1, NULL, 0);
+	return PTR_ERR_OR_ZERO(pdev);
+}
+module_init(rockchip_cpufreq_driver_init);
+
+MODULE_AUTHOR("Feng Xiao <xf@rock-chips.com>");
+MODULE_DESCRIPTION("Rockchip cpufreq driver");
+MODULE_LICENSE("GPL v2");
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2016-03-25  4:42 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-18 12:10 [PATCH] cpufreq: rockchip: add driver Feng Xiao
2016-03-18 12:10 ` Feng Xiao
2016-03-18 12:56 ` Heiko Stübner
2016-03-18 12:56   ` Heiko Stübner
2016-03-21  9:50   ` Viresh Kumar
2016-03-21  9:50     ` Viresh Kumar
2016-03-21  9:54     ` Heiko Stübner
2016-03-21  9:54       ` Heiko Stübner
2016-03-21  9:58       ` Viresh Kumar
2016-03-21  9:58         ` Viresh Kumar
2016-03-21 13:24         ` Feng Xiao
2016-03-21 13:24           ` Feng Xiao
2016-03-21 15:13           ` Viresh Kumar
2016-03-21 15:13             ` Viresh Kumar
2016-03-21 15:13           ` Heiko Stübner
2016-03-21 15:13             ` Heiko Stübner
2016-03-21 15:52             ` Heiko Stübner
2016-03-21 15:52               ` Heiko Stübner
2016-03-22  1:28               ` Feng Xiao
2016-03-22  1:28                 ` Feng Xiao
2016-03-22  1:28                 ` Feng Xiao
2016-03-22 11:57 ` [PATCH v1] " Feng Xiao
2016-03-22 11:57   ` Feng Xiao
2016-03-22 16:07   ` Heiko Stübner
2016-03-22 16:07     ` Heiko Stübner
2016-03-23  2:18   ` [PATCH v2] " Feng Xiao
2016-03-23  2:18     ` Feng Xiao
2016-03-23  4:40     ` Viresh Kumar
2016-03-23  4:40       ` Viresh Kumar
2016-03-24  3:01       ` Feng Xiao
2016-03-24  3:01         ` Feng Xiao
2016-03-24  3:01         ` Feng Xiao
2016-03-24  6:43         ` Viresh Kumar
2016-03-24  6:43           ` Viresh Kumar
2016-03-24 15:09           ` Finley Xiao
2016-03-24 15:09             ` Finley Xiao
2016-03-25  4:42             ` Viresh Kumar
2016-03-25  4:42               ` Viresh Kumar

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.