All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: imx: add cpufreq support for i.mx6sx
@ 2014-06-23  4:10 Anson Huang
  2014-06-25  7:22 ` Shawn Guo
  0 siblings, 1 reply; 2+ messages in thread
From: Anson Huang @ 2014-06-23  4:10 UTC (permalink / raw)
  To: linux-arm-kernel

Add cpufreq support for i.MX6SX, using common
i.MX6Q cpufreq driver.

Signed-off-by: Anson Huang <b20788@freescale.com>
---
 arch/arm/mach-imx/mach-imx6sx.c |   27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/arch/arm/mach-imx/mach-imx6sx.c b/arch/arm/mach-imx/mach-imx6sx.c
index 74ff7d6..be2ca52 100644
--- a/arch/arm/mach-imx/mach-imx6sx.c
+++ b/arch/arm/mach-imx/mach-imx6sx.c
@@ -8,6 +8,7 @@
 
 #include <linux/irqchip.h>
 #include <linux/of_platform.h>
+#include <linux/pm_opp.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
@@ -39,9 +40,35 @@ static void __init imx6sx_init_irq(void)
 	irqchip_init();
 }
 
+static void __init imx6sx_opp_init(struct device *cpu_dev)
+{
+	struct device_node *np;
+
+	np = of_find_node_by_path("/cpus/cpu at 0");
+	if (!np) {
+		pr_warn("failed to find cpu0 node\n");
+		return;
+	}
+
+	cpu_dev->of_node = np;
+	if (of_init_opp_table(cpu_dev))
+		pr_warn("failed to init OPP table\n");
+
+	of_node_put(np);
+}
+
+static struct platform_device imx6sx_cpufreq_pdev = {
+	.name = "imx6q-cpufreq",
+};
+
 static void __init imx6sx_init_late(void)
 {
 	imx6q_cpuidle_init();
+
+	if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ)) {
+		imx6sx_opp_init(&imx6sx_cpufreq_pdev.dev);
+		platform_device_register(&imx6sx_cpufreq_pdev);
+	}
 }
 
 static const char *imx6sx_dt_compat[] __initconst = {
-- 
1.7.9.5

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

end of thread, other threads:[~2014-06-25  7:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-23  4:10 [PATCH] ARM: imx: add cpufreq support for i.mx6sx Anson Huang
2014-06-25  7:22 ` Shawn Guo

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.