All of lore.kernel.org
 help / color / mirror / Atom feed
From: shawn.guo@freescale.com (Shawn Guo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: imx: add cpufreq support for i.mx6sx
Date: Wed, 25 Jun 2014 15:22:18 +0800	[thread overview]
Message-ID: <20140625072217.GD2224@dragon> (raw)
In-Reply-To: <1403496632-20308-1-git-send-email-b20788@freescale.com>

On Mon, Jun 23, 2014 at 12:10:32PM +0800, Anson Huang wrote:
> 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);
> +}

The whole function is not needed for imx6sx, because we do not need to
tweak OPP table like what we do on imx6q.  In this case, we can just
let imx6q-cpufreq call of_init_opp_table() on its own.

Shawn

> +
> +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-25  7:22 UTC|newest]

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

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=20140625072217.GD2224@dragon \
    --to=shawn.guo@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.