linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: daniel.lezcano@linaro.org (Daniel Lezcano)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V3 3/3] ARM: at91: pm: use standby callback instead of cpu_is
Date: Tue, 15 Oct 2013 09:50:32 +0200	[thread overview]
Message-ID: <1381823432-24944-3-git-send-email-daniel.lezcano@linaro.org> (raw)
In-Reply-To: <1381823432-24944-1-git-send-email-daniel.lezcano@linaro.org>

The cpuidle's platform_device has the standby function set for the correct
SoC when supported in the platform data. Remove the { if then else } statements
in the at91_pm_enter by using directly the standby ops.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 arch/arm/mach-at91/pm.c |   16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index 76f8cbf..baeb4a4a 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -39,6 +39,8 @@
 #include "at91_rstc.h"
 #include "at91_shdwc.h"
 
+static void (*at91_pm_standby)(void);
+
 static void __init show_reset_status(void)
 {
 	static char reset[] __initdata = "reset";
@@ -266,14 +268,8 @@ static int at91_pm_enter(suspend_state_t state)
 			 * For ARM 926 based chips, this requirement is weaker
 			 * as at91sam9 can access a RAM in self-refresh mode.
 			 */
-			if (cpu_is_at91rm9200())
-				at91rm9200_standby();
-			else if (cpu_is_at91sam9g45())
-				at91sam9g45_standby();
-			else if (cpu_is_at91sam9263())
-				at91sam9263_standby();
-			else
-				at91sam9_standby();
+			if (at91_pm_standby)
+				at91_pm_standby();
 			break;
 
 		case PM_SUSPEND_ON:
@@ -335,8 +331,10 @@ static int __init at91_pm_init(void)
 	if (cpu_is_at91rm9200())
 		at91_ramc_write(0, AT91RM9200_SDRAMC_LPR, 0);
 	
-	if (at91_cpuidle_device.dev.platform_data)
+	if (at91_cpuidle_device.dev.platform_data) {
+		at91_pm_standby = at91_cpuidle_device.dev.platform_data;
 		platform_device_register(&at91_cpuidle_device);
+	}
 
 	suspend_set_ops(&at91_pm_ops);
 
-- 
1.7.9.5

  parent reply	other threads:[~2013-10-15  7:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-15  7:50 [PATCH V3 1/3] ARM: at91: cpuidle: convert to platform driver Daniel Lezcano
2013-10-15  7:50 ` [PATCH V3 2/3] ARM: at91: cpuidle: Move driver to drivers/cpuidle Daniel Lezcano
2013-10-15  7:50 ` Daniel Lezcano [this message]
2013-10-15  8:42 ` [PATCH V3 1/3] ARM: at91: cpuidle: convert to platform driver Jean-Christophe PLAGNIOL-VILLARD

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=1381823432-24944-3-git-send-email-daniel.lezcano@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --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).