All of lore.kernel.org
 help / color / mirror / Atom feed
From: keita kobayashi <keita.kobayashi.ym@renesas.com>
To: linux-sh@vger.kernel.org, linux-pm@vger.kernel.org
Cc: horms+renesas@verge.net.au, Magnus Damm <magnus.damm@gmail.com>,
	rjw@rjwysocki.net
Subject: [PATCH 4/6] ARM: shmobile: Add initialization cpuidle
Date: Fri, 01 Aug 2014 09:48:44 +0000	[thread overview]
Message-ID: <53DB627C.40104@renesas.com> (raw)

Signed-off-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
---
 arch/arm/mach-shmobile/cpuidle.c |   22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/arch/arm/mach-shmobile/cpuidle.c b/arch/arm/mach-shmobile/cpuidle.c
index 0afeb5c..19c0c98 100644
--- a/arch/arm/mach-shmobile/cpuidle.c
+++ b/arch/arm/mach-shmobile/cpuidle.c
@@ -8,13 +8,17 @@
  * for more details.
  */

+#include <linux/cpu.h>
 #include <linux/pm.h>
 #include <linux/cpuidle.h>
 #include <linux/suspend.h>
 #include <linux/module.h>
 #include <linux/err.h>
+#include <linux/device.h>
+#include <linux/platform_device.h>
 #include <asm/cpuidle.h>
 #include <asm/io.h>
+#include "common.h"

 static struct cpuidle_driver shmobile_cpuidle_default_driver = {
 	.name			= "shmobile_cpuidle",
@@ -31,7 +35,25 @@ void __init shmobile_cpuidle_set_driver(struct cpuidle_driver *drv)
 	cpuidle_drv = drv;
 }

+static struct platform_device shmobile_cpuidle = {
+	.name              = "cpuidle-shmobile",
+	.dev.platform_data = shmobile_smp_apmu_enter_cpuidle,
+	.id                = -1,
+};
+
 int __init shmobile_cpuidle_init(void)
 {
+	int cpu;
+
+	/* Make sure boot CPU also gets CPUIdle initialized */
+	for_each_online_cpu(cpu) {
+		shmobile_smp_hook(cpu, virt_to_phys(cpu_resume), 0);
+	}
+
+#ifdef CONFIG_ARCH_SHMOBILE_MULTI
+	platform_device_register(&shmobile_cpuidle);
+	return 0;
+#else
 	return cpuidle_register(cpuidle_drv, NULL);
+#endif
 }
-- 
1.7.9.5

WARNING: multiple messages have this Message-ID (diff)
From: keita kobayashi <keita.kobayashi.ym@renesas.com>
To: linux-sh@vger.kernel.org, linux-pm@vger.kernel.org
Cc: horms+renesas@verge.net.au, Magnus Damm <magnus.damm@gmail.com>,
	rjw@rjwysocki.net
Subject: [PATCH 4/6] ARM: shmobile: Add initialization cpuidle
Date: Fri, 1 Aug 2014 18:48:44 +0900	[thread overview]
Message-ID: <53DB627C.40104@renesas.com> (raw)

Signed-off-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
---
 arch/arm/mach-shmobile/cpuidle.c |   22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/arch/arm/mach-shmobile/cpuidle.c b/arch/arm/mach-shmobile/cpuidle.c
index 0afeb5c..19c0c98 100644
--- a/arch/arm/mach-shmobile/cpuidle.c
+++ b/arch/arm/mach-shmobile/cpuidle.c
@@ -8,13 +8,17 @@
  * for more details.
  */

+#include <linux/cpu.h>
 #include <linux/pm.h>
 #include <linux/cpuidle.h>
 #include <linux/suspend.h>
 #include <linux/module.h>
 #include <linux/err.h>
+#include <linux/device.h>
+#include <linux/platform_device.h>
 #include <asm/cpuidle.h>
 #include <asm/io.h>
+#include "common.h"

 static struct cpuidle_driver shmobile_cpuidle_default_driver = {
 	.name			= "shmobile_cpuidle",
@@ -31,7 +35,25 @@ void __init shmobile_cpuidle_set_driver(struct cpuidle_driver *drv)
 	cpuidle_drv = drv;
 }

+static struct platform_device shmobile_cpuidle = {
+	.name              = "cpuidle-shmobile",
+	.dev.platform_data = shmobile_smp_apmu_enter_cpuidle,
+	.id                = -1,
+};
+
 int __init shmobile_cpuidle_init(void)
 {
+	int cpu;
+
+	/* Make sure boot CPU also gets CPUIdle initialized */
+	for_each_online_cpu(cpu) {
+		shmobile_smp_hook(cpu, virt_to_phys(cpu_resume), 0);
+	}
+
+#ifdef CONFIG_ARCH_SHMOBILE_MULTI
+	platform_device_register(&shmobile_cpuidle);
+	return 0;
+#else
 	return cpuidle_register(cpuidle_drv, NULL);
+#endif
 }
-- 
1.7.9.5

             reply	other threads:[~2014-08-01  9:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-01  9:48 keita kobayashi [this message]
2014-08-01  9:48 ` [PATCH 4/6] ARM: shmobile: Add initialization cpuidle keita kobayashi

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=53DB627C.40104@renesas.com \
    --to=keita.kobayashi.ym@renesas.com \
    --cc=horms+renesas@verge.net.au \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=rjw@rjwysocki.net \
    /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.