linux-mips
[Top] [All Lists]

[PATCH] [loongson] Lemote-2F: Suspend CS5536 MFGPT Timer

To: Ralf Baechle <ralf@linux-mips.org>
Subject: [PATCH] [loongson] Lemote-2F: Suspend CS5536 MFGPT Timer
From: Wu Zhangjin <wuzhangjin@gmail.com>
Date: Tue, 24 Nov 2009 21:48:36 +0800
Cc: linux-mips@linux-mips.org, Wu Zhangjin <wuzhangjin@gmail.com>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer; bh=GJDDN/uMPDywD9L6vmT+nwjHQ7tocY96zgQCgzzRUu0=; b=Hez7oCcprFvdv9IR0BPWYkRvrpZjnr5f9a4XmY7gVvlUpTCZgJZ39LqMyxAW4j5+66 /sK4q8fROLJb4WmUAmshoXBYFwoNWvUcu7W2Y1vVN+Xl9MWKG+NVYJls0xXJ5DQ7RxTU 4pZMnpvkkwUFYh3H4vnnx/srL6pqxr4KsSlmc=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=psJY4puz9Ae3WcWomPz0c2oFVZC8vfB6WLn9IElHmxIKlrb5aeu2i1YpQrcuQqFTeJ epcX0RuGBA/sCJIIttQooboO4DzjGDQhsGvhp+vnFhRFQRHm9HnYLuQaoXX+5Gxf+dJW QoM5nfFJp/TBDn9NJZqaACa7NQxIoSQf2UrUQ=
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
From: Wu Zhangjin <wuzhangjin@gmail.com>

Before putting loongson2f into wait mode, suspend the MFGPT Timer, and
after wake-up, resume it. This may save some power.

Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
---
 arch/mips/loongson/lemote-2f/pm.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/arch/mips/loongson/lemote-2f/pm.c 
b/arch/mips/loongson/lemote-2f/pm.c
index 81c0641..d7af2e6 100644
--- a/arch/mips/loongson/lemote-2f/pm.c
+++ b/arch/mips/loongson/lemote-2f/pm.c
@@ -22,6 +22,7 @@
 
 #include <loongson.h>
 
+#include <cs5536/cs5536_mfgpt.h>
 #include "ec_kb3310b.h"
 
 #define I8042_KBD_IRQ          1
@@ -136,3 +137,13 @@ int wakeup_loongson(void)
 
        return 0;
 }
+
+void __weak mach_suspend(void)
+{
+       disable_mfgpt0_counter();
+}
+
+void __weak mach_resume(void)
+{
+       enable_mfgpt0_counter();
+}
-- 
1.6.2.1


<Prev in Thread] Current Thread [Next in Thread>