From: josephl@nvidia.com (Joseph Lo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/4] ARM: tegra: cpuidle: move the init function behind the suspend init function
Date: Mon, 3 Jun 2013 19:17:44 +0800 [thread overview]
Message-ID: <1370258267-30184-2-git-send-email-josephl@nvidia.com> (raw)
In-Reply-To: <1370258267-30184-1-git-send-email-josephl@nvidia.com>
One of the state of CPUidle on Tegra can power gate the CPU and the
vdd_cpu rail. But it depends on some configurations from DT and a common
hook function for different Tegra SoCs to power gate the CPU rail. And
these stuffs are initialized after common Tegra suspend init function. So
we move the CPUidle init behind the suspend init function. And making the
CPUidle driver more generic.
Signed-off-by: Joseph Lo <josephl@nvidia.com>
---
arch/arm/mach-tegra/common.c | 2 ++
arch/arm/mach-tegra/cpuidle.c | 14 ++++----------
arch/arm/mach-tegra/cpuidle.h | 6 ++++++
3 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c
index 9f852c6..ec5836b 100644
--- a/arch/arm/mach-tegra/common.c
+++ b/arch/arm/mach-tegra/common.c
@@ -29,6 +29,7 @@
#include "board.h"
#include "common.h"
+#include "cpuidle.h"
#include "fuse.h"
#include "iomap.h"
#include "irq.h"
@@ -108,5 +109,6 @@ void __init tegra_init_early(void)
void __init tegra_init_late(void)
{
tegra_init_suspend();
+ tegra_cpuidle_init();
tegra_powergate_debugfs_init();
}
diff --git a/arch/arm/mach-tegra/cpuidle.c b/arch/arm/mach-tegra/cpuidle.c
index 4b744c4..4a7a788 100644
--- a/arch/arm/mach-tegra/cpuidle.c
+++ b/arch/arm/mach-tegra/cpuidle.c
@@ -27,25 +27,19 @@
#include "fuse.h"
#include "cpuidle.h"
-static int __init tegra_cpuidle_init(void)
+void __init tegra_cpuidle_init(void)
{
- int ret;
-
switch (tegra_chip_id) {
case TEGRA20:
- ret = tegra20_cpuidle_init();
+ tegra20_cpuidle_init();
break;
case TEGRA30:
- ret = tegra30_cpuidle_init();
+ tegra30_cpuidle_init();
break;
case TEGRA114:
- ret = tegra114_cpuidle_init();
+ tegra114_cpuidle_init();
break;
default:
- ret = -ENODEV;
break;
}
-
- return ret;
}
-device_initcall(tegra_cpuidle_init);
diff --git a/arch/arm/mach-tegra/cpuidle.h b/arch/arm/mach-tegra/cpuidle.h
index d733f75..9bcf61f 100644
--- a/arch/arm/mach-tegra/cpuidle.h
+++ b/arch/arm/mach-tegra/cpuidle.h
@@ -35,4 +35,10 @@ int tegra114_cpuidle_init(void);
static inline int tegra114_cpuidle_init(void) { return -ENODEV; }
#endif
+#ifdef CONFIG_CPU_IDLE
+void tegra_cpuidle_init(void);
+#else
+static inline void tegra_cpuidle_init(void) {}
+#endif
+
#endif
--
1.8.3
next prev parent reply other threads:[~2013-06-03 11:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-03 11:17 [PATCH 0/4] ARM: tegra: cpuidle: some clean up for CPUidle driver Joseph Lo
2013-06-03 11:17 ` Joseph Lo [this message]
2013-06-03 11:17 ` [PATCH 2/4] ARM: tegra: hook tegra_tear_down_cpu function in the PM suspend init function Joseph Lo
2013-06-03 20:31 ` Stephen Warren
2013-06-03 11:17 ` [PATCH 3/4] ARM: tegra: cpuidle: using IS_ENABLED for multi SoCs management in init func Joseph Lo
2013-06-03 11:17 ` [PATCH 4/4] ARM: tegra: check processor id in tegra_{set, clear}_cpu_in_lp2 Joseph Lo
2013-06-03 20:35 ` Stephen Warren
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=1370258267-30184-2-git-send-email-josephl@nvidia.com \
--to=josephl@nvidia.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).