All of lore.kernel.org
 help / color / mirror / Atom feed
From: b20788@freescale.com (Anson Huang)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: imx: add cpufreq support for i.mx6sx
Date: Mon, 23 Jun 2014 12:10:32 +0800	[thread overview]
Message-ID: <1403496632-20308-1-git-send-email-b20788@freescale.com> (raw)

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

             reply	other threads:[~2014-06-23  4:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-23  4:10 Anson Huang [this message]
2014-06-25  7:22 ` [PATCH] ARM: imx: add cpufreq support for i.mx6sx Shawn Guo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1403496632-20308-1-git-send-email-b20788@freescale.com \
    --to=b20788@freescale.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.