All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wu Zhangjin <wuzhangjin@gmail.com>
To: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org, Wu Zhangjin <wuzhangjin@gmail.com>
Subject: [PATCH v1 4/4] [loongson] yeeloong2f: cleanup the reset logic with ec_write function
Date: Sat, 21 Nov 2009 19:05:25 +0800	[thread overview]
Message-ID: <6dcb6241dda22fe6255b1f74e784f8b20214413c.1258800842.git.wuzhangjin@gmail.com> (raw)
In-Reply-To: <b983b517f93e13dda9d76c3d1719999b0593b9d3.1258800842.git.wuzhangjin@gmail.com>
In-Reply-To: <cover.1258800842.git.wuzhangjin@gmail.com>

A commen ec_read/ec_write function is defined in "[loongson] yeeloong2f:
add basic ec operations", So, we can use it here to cleanup the reset
logic of yeeloong2f netbook.

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

diff --git a/arch/mips/loongson/lemote-2f/reset.c b/arch/mips/loongson/lemote-2f/reset.c
index 44bb984..51d1a60 100644
--- a/arch/mips/loongson/lemote-2f/reset.c
+++ b/arch/mips/loongson/lemote-2f/reset.c
@@ -20,6 +20,7 @@
 #include <loongson.h>
 
 #include <cs5536/cs5536.h>
+#include "ec_kb3310b.h"
 
 static void reset_cpu(void)
 {
@@ -75,30 +76,12 @@ static void fl2f_shutdown(void)
 
 /* reset support for yeeloong2f and mengloong2f notebook */
 
-/*
- * The following registers are determined by the EC index configuration.
- * 1. fill the PORT_HIGH as EC register high part.
- * 2. fill the PORT_LOW as EC register low part.
- * 3. fill the PORT_DATA as EC register write data or get the data from it.
- */
-
-#define	EC_IO_PORT_HIGH	0x0381
-#define	EC_IO_PORT_LOW	0x0382
-#define	EC_IO_PORT_DATA	0x0383
-#define	REG_RESET_HIGH	0xF4	/* reset the machine auto-clear : rd/wr */
-#define REG_RESET_LOW	0xEC
-#define	BIT_RESET_ON	(1 << 0)
-
 void ml2f_reboot(void)
 {
 	reset_cpu();
 
 	/* sending an reset signal to EC(embedded controller) */
-	outb(REG_RESET_HIGH, EC_IO_PORT_HIGH);
-	outb(REG_RESET_LOW, EC_IO_PORT_LOW);
-	mmiowb();
-	outb(BIT_RESET_ON, EC_IO_PORT_DATA);
-	mmiowb();
+	ec_write(REG_RESET, BIT_RESET_ON);
 }
 
 #define yl2f89_reboot ml2f_reboot
-- 
1.6.2.1

  reply	other threads:[~2009-11-21 11:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-21 11:05 [PATCH v1 0/4] Fixups and Cleanups of lemote-2f family machines Wu Zhangjin
2009-11-21 11:05 ` [PATCH v1 1/4] [loongson] Remove the inline annotation of prom_init_uart_base() Wu Zhangjin
2009-11-21 11:05   ` [PATCH v1 2/4] [loongson] yeeloong2f: add basic ec operations Wu Zhangjin
2009-11-21 11:05     ` [PATCH v1 3/4] [loongson] yeeloong2f: add LID open event as the wakeup event Wu Zhangjin
2009-11-21 11:05       ` Wu Zhangjin [this message]
2009-11-23 16:24         ` [PATCH v1 4/4] [loongson] yeeloong2f: cleanup the reset logic with ec_write function Ralf Baechle
2009-11-23 16:20       ` [PATCH v1 3/4] [loongson] yeeloong2f: add LID open event as the wakeup event Ralf Baechle
2009-11-23 16:09     ` [PATCH v1 2/4] [loongson] yeeloong2f: add basic ec operations Ralf Baechle
2009-11-23  1:29   ` [PATCH v1 1/4] [loongson] Remove the inline annotation of prom_init_uart_base() Wu Zhangjin
2009-11-23 15:45     ` Ralf Baechle

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=6dcb6241dda22fe6255b1f74e784f8b20214413c.1258800842.git.wuzhangjin@gmail.com \
    --to=wuzhangjin@gmail.com \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.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.