All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/4] Fixups and Cleanups of lemote-2f family machines
@ 2009-11-21 11:05 Wu Zhangjin
  2009-11-21 11:05 ` [PATCH v1 1/4] [loongson] Remove the inline annotation of prom_init_uart_base() Wu Zhangjin
  0 siblings, 1 reply; 10+ messages in thread
From: Wu Zhangjin @ 2009-11-21 11:05 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: linux-mips, Wu Zhangjin

This patchset includes the following changes:

  - [loongson] Remove the inline annotation of prom_init_uart_base()
    Ensure gcc 3.4.6 can compile it.
  - [loongson] yeeloong2f: add basic ec operations
    add basic support for the Embedded Controller(ec_kb3310b) of yeeloong2f netbook.
    This support is needed for the coming yeeloong2f platform drivers.
  - [loongson] yeeloong2f: add LID open event as the wakeup event
    Allow users wakeup the netbook from suspend mode via opening the LID.
  - [loongson] yeeloong2f: cleanup the reset logic with ec_write function
    Benefit from "[loongson] yeeloong2f: add basic ec operations",
    we can use the cleanup the old reset implementaion now.

All of the above updates have been tested and put into this branch:

git://dev.lemote.com/rt4ls.git linux-loongson/dev/for-upstream

Hi, Ralf, Could you please queue it for linux-2.6.33? Thanks!

Best Wishes,
     Wu Zhangjin

Wu Zhangjin (4):
  [loongson] Remove the inline annotation of prom_init_uart_base()
  [loongson] yeeloong2f: add basic ec operations
  [loongson] yeeloong2f: add LID open event as the wakeup event
  [loongson] yeeloong2f: cleanup the reset logic with ec_write function

 arch/mips/include/asm/mach-loongson/loongson.h |    3 +-
 arch/mips/loongson/common/uart_base.c          |    2 +-
 arch/mips/loongson/lemote-2f/Makefile          |    2 +-
 arch/mips/loongson/lemote-2f/ec_kb3310b.c      |  132 ++++++++++++++++++++++++
 arch/mips/loongson/lemote-2f/ec_kb3310b.h      |   47 +++++++++
 arch/mips/loongson/lemote-2f/irq.c             |    4 +-
 arch/mips/loongson/lemote-2f/pm.c              |   71 ++++++++++++-
 arch/mips/loongson/lemote-2f/reset.c           |   21 +----
 8 files changed, 256 insertions(+), 26 deletions(-)
 create mode 100644 arch/mips/loongson/lemote-2f/ec_kb3310b.c
 create mode 100644 arch/mips/loongson/lemote-2f/ec_kb3310b.h

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v1 1/4] [loongson] Remove the inline annotation of prom_init_uart_base()
  2009-11-21 11:05 [PATCH v1 0/4] Fixups and Cleanups of lemote-2f family machines Wu Zhangjin
@ 2009-11-21 11:05 ` Wu Zhangjin
  2009-11-21 11:05   ` [PATCH v1 2/4] [loongson] yeeloong2f: add basic ec operations Wu Zhangjin
  2009-11-23  1:29   ` [PATCH v1 1/4] [loongson] Remove the inline annotation of prom_init_uart_base() Wu Zhangjin
  0 siblings, 2 replies; 10+ messages in thread
From: Wu Zhangjin @ 2009-11-21 11:05 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: linux-mips, Wu Zhangjin

gcc 3.4.6 complains about un-implemented prom_init_uart_base() if using
inline to annotate prom_init_uart_base(), so, remove the inline here.

Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
---
 arch/mips/include/asm/mach-loongson/loongson.h |    2 +-
 arch/mips/loongson/common/uart_base.c          |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/include/asm/mach-loongson/loongson.h b/arch/mips/include/asm/mach-loongson/loongson.h
index daf7041..a7fa66e 100644
--- a/arch/mips/include/asm/mach-loongson/loongson.h
+++ b/arch/mips/include/asm/mach-loongson/loongson.h
@@ -33,7 +33,7 @@ extern void __init prom_init_machtype(void);
 extern void __init prom_init_env(void);
 extern unsigned long _loongson_uart_base;
 extern unsigned long uart8250_base[];
-extern inline void __maybe_unused prom_init_uart_base(void);
+extern void prom_init_uart_base(void);
 
 /* irq operation functions */
 extern void bonito_irqdispatch(void);
diff --git a/arch/mips/loongson/common/uart_base.c b/arch/mips/loongson/common/uart_base.c
index 275bed6..1d636f4 100644
--- a/arch/mips/loongson/common/uart_base.c
+++ b/arch/mips/loongson/common/uart_base.c
@@ -29,7 +29,7 @@ unsigned long __maybe_unused uart8250_base[] = {
 };
 EXPORT_SYMBOL(uart8250_base);
 
-inline void __maybe_unused prom_init_uart_base(void)
+void __maybe_unused prom_init_uart_base(void)
 {
 	_loongson_uart_base =
 		(unsigned long)ioremap_nocache(uart8250_base[mips_machtype], 8);
-- 
1.6.2.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v1 2/4] [loongson] yeeloong2f: add basic ec operations
  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   ` 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-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
  1 sibling, 2 replies; 10+ messages in thread
From: Wu Zhangjin @ 2009-11-21 11:05 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: linux-mips, Wu Zhangjin

YeeLoong2F has a kb3310b Embedded Controller. This patch add the basic
EC operations for future relative drivers or board support.

Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
---
 arch/mips/loongson/lemote-2f/Makefile     |    2 +-
 arch/mips/loongson/lemote-2f/ec_kb3310b.c |  132 +++++++++++++++++++++++++++++
 arch/mips/loongson/lemote-2f/ec_kb3310b.h |   47 ++++++++++
 3 files changed, 180 insertions(+), 1 deletions(-)
 create mode 100644 arch/mips/loongson/lemote-2f/ec_kb3310b.c
 create mode 100644 arch/mips/loongson/lemote-2f/ec_kb3310b.h

diff --git a/arch/mips/loongson/lemote-2f/Makefile b/arch/mips/loongson/lemote-2f/Makefile
index 5add7b2..4d84b27 100644
--- a/arch/mips/loongson/lemote-2f/Makefile
+++ b/arch/mips/loongson/lemote-2f/Makefile
@@ -2,7 +2,7 @@
 # Makefile for lemote loongson2f family machines
 #
 
-obj-y += irq.o reset.o
+obj-y += irq.o reset.o ec_kb3310b.o
 
 #
 # Suspend Support
diff --git a/arch/mips/loongson/lemote-2f/ec_kb3310b.c b/arch/mips/loongson/lemote-2f/ec_kb3310b.c
new file mode 100644
index 0000000..1ca38a8
--- /dev/null
+++ b/arch/mips/loongson/lemote-2f/ec_kb3310b.c
@@ -0,0 +1,132 @@
+/*
+ * EC(Embedded Controller) KB3310B basic support for YeeLoong2F netbook
+ *
+ *  Copyright (C) 2008 Lemote Inc.
+ *  Author: liujl <liujl@lemote.com>, 2008-04-20
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#include <linux/module.h>
+#include <linux/delay.h>
+
+#include "ec_kb3310b.h"
+
+/* this spinlock is dedicated for ec_read & ec_write function */
+DEFINE_SPINLOCK(index_access_lock);
+/* this spinlock is dedicated for 62&66 ports access */
+DEFINE_SPINLOCK(port_access_lock);
+
+/* read a byte from EC registers throught index-io */
+unsigned char ec_read(unsigned short addr)
+{
+	unsigned char value;
+	unsigned long flags;
+
+	spin_lock_irqsave(&index_access_lock, flags);
+	outb((addr & 0xff00) >> 8, EC_IO_PORT_HIGH);
+	outb((addr & 0x00ff), EC_IO_PORT_LOW);
+	value = inb(EC_IO_PORT_DATA);
+	spin_unlock_irqrestore(&index_access_lock, flags);
+
+	return value;
+}
+EXPORT_SYMBOL_GPL(ec_read);
+
+/* write a byte to EC registers throught index-io */
+void ec_write(unsigned short addr, unsigned char val)
+{
+	unsigned long flags;
+
+	spin_lock_irqsave(&index_access_lock, flags);
+	outb((addr & 0xff00) >> 8, EC_IO_PORT_HIGH);
+	outb((addr & 0x00ff), EC_IO_PORT_LOW);
+	outb(val, EC_IO_PORT_DATA);
+	/*  flush the write action */
+	inb(EC_IO_PORT_DATA);
+	spin_unlock_irqrestore(&index_access_lock, flags);
+
+	return;
+}
+EXPORT_SYMBOL_GPL(ec_write);
+
+/*
+ * this function is used for ec command writing and corresponding status query
+ */
+int ec_query_seq(unsigned char cmd)
+{
+	int timeout;
+	unsigned char status;
+	unsigned long flags;
+	int ret = 0;
+
+	spin_lock_irqsave(&port_access_lock, flags);
+
+	/* make chip goto reset mode */
+	udelay(EC_REG_DELAY);
+	outb(cmd, EC_CMD_PORT);
+	udelay(EC_REG_DELAY);
+
+	/* check if the command is received by ec */
+	timeout = EC_CMD_TIMEOUT;
+	status = inb(EC_STS_PORT);
+	while (timeout-- && (status & (1 << 1))) {
+		status = inb(EC_STS_PORT);
+		udelay(EC_REG_DELAY);
+	}
+
+	if (timeout <= 0) {
+		printk(KERN_ERR "%s: deadable error : timeout...\n", __func__);
+		ret = -EINVAL;
+	} else
+		printk(KERN_INFO
+			   "(%x/%d)ec issued command %d status : 0x%x\n",
+			   timeout, EC_CMD_TIMEOUT - timeout, cmd, status);
+
+	spin_unlock_irqrestore(&port_access_lock, flags);
+
+	return ret;
+}
+EXPORT_SYMBOL_GPL(ec_query_seq);
+
+/*
+ * using query command to ec to get the proper event number
+ */
+int ec_query_event_num(void)
+{
+	return ec_query_seq(CMD_GET_EVENT_NUM);
+}
+EXPORT_SYMBOL(ec_query_event_num);
+
+/*
+ * get event number from ec
+ *
+ * NOTE : this routine must follow the query_event_num function in the
+ * interrupt
+ */
+int ec_get_event_num(void)
+{
+	int timeout = 100;
+	unsigned char value;
+	unsigned char status;
+
+	udelay(EC_REG_DELAY);
+	status = inb(EC_STS_PORT);
+	udelay(EC_REG_DELAY);
+	while (timeout-- && !(status & (1 << 0))) {
+		status = inb(EC_STS_PORT);
+		udelay(EC_REG_DELAY);
+	}
+	if (timeout <= 0) {
+		printk(KERN_INFO "%s: get event number timeout.\n", __func__);
+		return -EINVAL;
+	}
+	value = inb(EC_DAT_PORT);
+	udelay(EC_REG_DELAY);
+
+	return value;
+}
+EXPORT_SYMBOL(ec_get_event_num);
diff --git a/arch/mips/loongson/lemote-2f/ec_kb3310b.h b/arch/mips/loongson/lemote-2f/ec_kb3310b.h
new file mode 100644
index 0000000..a7ce275
--- /dev/null
+++ b/arch/mips/loongson/lemote-2f/ec_kb3310b.h
@@ -0,0 +1,47 @@
+/*
+ * EC(Embedded Controller) KB3310B header file
+ *
+ *  Copyright (C) 2008 Lemote Inc.
+ *  Author: liujl <liujl@lemote.com>, 2008-03-14
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef _EC_KB3310B_H
+#define _EC_KB3310B_H
+
+extern unsigned char ec_read(unsigned short addr);
+extern void ec_write(unsigned short addr, unsigned char val);
+extern int ec_query_seq(unsigned char cmd);
+extern int ec_query_event_num(void);
+extern int ec_get_event_num(void);
+
+/*
+ * 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
+
+/* ec delay time 500us for register and status access */
+#define	EC_REG_DELAY	500	/* unit : us */
+#define	EC_CMD_TIMEOUT	0x1000
+
+/* EC access port for sci communication */
+#define	EC_CMD_PORT		0x66
+#define	EC_STS_PORT		0x66
+#define	EC_DAT_PORT		0x62
+#define	CMD_INIT_IDLE_MODE	0xdd
+#define	CMD_EXIT_IDLE_MODE	0xdf
+#define	CMD_INIT_RESET_MODE	0xd8
+#define	CMD_REBOOT_SYSTEM	0x8c
+#define	CMD_GET_EVENT_NUM	0x84
+#define	CMD_PROGRAM_PIECE	0xda
+
+#endif /* !_EC_KB3310B_H */
-- 
1.6.2.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v1 3/4] [loongson] yeeloong2f: add LID open event as the wakeup event
  2009-11-21 11:05   ` [PATCH v1 2/4] [loongson] yeeloong2f: add basic ec operations Wu Zhangjin
@ 2009-11-21 11:05     ` Wu Zhangjin
  2009-11-21 11:05       ` [PATCH v1 4/4] [loongson] yeeloong2f: cleanup the reset logic with ec_write function Wu Zhangjin
  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
  1 sibling, 2 replies; 10+ messages in thread
From: Wu Zhangjin @ 2009-11-21 11:05 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: linux-mips, Wu Zhangjin

Yeeloong2F netbook has an embedded controller(kb3310b) to manage the LID
action. when the LID is closed/opened, a SCI interrupt is sent out and
the corresponding event is saved to an EC register for later query.

This patch allow the LID open action to wake up the processor from wait
mode if it is in the suspend mode.

Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
---
 arch/mips/include/asm/mach-loongson/loongson.h |    1 +
 arch/mips/loongson/lemote-2f/irq.c             |    4 +-
 arch/mips/loongson/lemote-2f/pm.c              |   71 +++++++++++++++++++++++-
 3 files changed, 72 insertions(+), 4 deletions(-)

diff --git a/arch/mips/include/asm/mach-loongson/loongson.h b/arch/mips/include/asm/mach-loongson/loongson.h
index a7fa66e..06c28f3 100644
--- a/arch/mips/include/asm/mach-loongson/loongson.h
+++ b/arch/mips/include/asm/mach-loongson/loongson.h
@@ -41,6 +41,7 @@ extern void __init bonito_irq_init(void);
 extern void __init set_irq_trigger_mode(void);
 extern void __init mach_init_irq(void);
 extern void mach_irq_dispatch(unsigned int pending);
+extern int mach_i8259_irq(void);
 
 /* We need this in some places... */
 #define delay()	({		\
diff --git a/arch/mips/loongson/lemote-2f/irq.c b/arch/mips/loongson/lemote-2f/irq.c
index 50e7bb6..77d32f9 100644
--- a/arch/mips/loongson/lemote-2f/irq.c
+++ b/arch/mips/loongson/lemote-2f/irq.c
@@ -9,6 +9,7 @@
  */
 
 #include <linux/interrupt.h>
+#include <linux/module.h>
 
 #include <asm/irq_cpu.h>
 #include <asm/i8259.h>
@@ -30,7 +31,7 @@
  * The generic i8259_irq() make the kernel hang on booting.  Since we cannot
  * get the irq via the IRR directly, we access the ISR instead.
  */
-static inline int mach_i8259_irq(void)
+int mach_i8259_irq(void)
 {
 	int irq, isr;
 
@@ -60,6 +61,7 @@ static inline int mach_i8259_irq(void)
 
 	return irq;
 }
+EXPORT_SYMBOL(mach_i8259_irq);
 
 static void i8259_irqdispatch(void)
 {
diff --git a/arch/mips/loongson/lemote-2f/pm.c b/arch/mips/loongson/lemote-2f/pm.c
index 8090d05..3072583 100644
--- a/arch/mips/loongson/lemote-2f/pm.c
+++ b/arch/mips/loongson/lemote-2f/pm.c
@@ -14,6 +14,7 @@
 #include <linux/interrupt.h>
 #include <linux/pm.h>
 #include <linux/i8042.h>
+#include <linux/module.h>
 
 #include <asm/i8259.h>
 #include <asm/mipsregs.h>
@@ -21,6 +22,8 @@
 
 #include <loongson.h>
 
+#include "ec_kb3310b.h"
+
 #define I8042_KBD_IRQ		1
 #define I8042_CTR_KBDINT	0x01
 #define I8042_CTR_KBDDIS	0x10
@@ -49,9 +52,6 @@ static int i8042_enable_kbd_port(void)
 	return 0;
 }
 
-/*
- * The i8042 is connnected to i8259A
- */
 void setup_wakeup_events(void)
 {
 	int irq_mask;
@@ -65,9 +65,74 @@ void setup_wakeup_events(void)
 
 		/* enable keyboard port */
 		i8042_enable_kbd_port();
+
+		/* wakeup cpu via SCI with relative lid openning event */
+		outb(irq_mask & ~(1 << PIC_CASCADE_IR), PIC_MASTER_IMR);
+		inb(PIC_MASTER_IMR);
+		outb(0xff & ~(1 << (SCI_IRQ_NUM - 8)), PIC_SLAVE_IMR);
+		inb(PIC_SLAVE_IMR);
+
 		break;
 
 	default:
 		break;
 	}
 }
+
+static struct delayed_work lid_task;
+static int initialized;
+/* yeeloong_report_lid_status will be implemented in yeeloong_laptop.c */
+sci_handler yeeloong_report_lid_status;
+EXPORT_SYMBOL(yeeloong_report_lid_status);
+static void yeeloong_lid_update_task(struct work_struct *work)
+{
+	if (yeeloong_report_lid_status)
+		yeeloong_report_lid_status(BIT_LID_DETECT_ON);
+}
+
+int wakeup_loongson(void)
+{
+	int irq;
+
+	/* query the interrupt number */
+	irq = mach_i8259_irq();
+	if (irq < 0)
+		return 0;
+
+	printk(KERN_INFO "%s: irq = %d\n", __func__, irq);
+
+	if (irq == I8042_KBD_IRQ)
+		return 1;
+	else if (irq == SCI_IRQ_NUM) {
+		int ret, sci_event;
+		/* query the event number */
+		ret = ec_query_seq(CMD_GET_EVENT_NUM);
+		if (ret < 0)
+			return 0;
+		sci_event = ec_get_event_num();
+		if (sci_event < 0)
+			return 0;
+		if (sci_event == EVENT_LID) {
+			int lid_status;
+			/* check the LID status */
+			lid_status = ec_read(REG_LID_DETECT);
+			/* wakeup cpu when people open the LID */
+			if (lid_status == BIT_LID_DETECT_ON) {
+				/* If we call it directly here, the WARNING
+				 * will be sent out by getnstimeofday
+				 * via "WARN_ON(timekeeping_suspended);"
+				 * because we can not schedule in suspend mode.
+				 */
+				if (initialized == 0) {
+					INIT_DELAYED_WORK(&lid_task,
+						yeeloong_lid_update_task);
+					initialized = 1;
+				}
+				schedule_delayed_work(&lid_task, 1);
+				return 1;
+			}
+		}
+	}
+
+	return 0;
+}
-- 
1.6.2.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v1 4/4] [loongson] yeeloong2f: cleanup the reset logic with ec_write function
  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
  2009-11-23 16:24         ` Ralf Baechle
  2009-11-23 16:20       ` [PATCH v1 3/4] [loongson] yeeloong2f: add LID open event as the wakeup event Ralf Baechle
  1 sibling, 1 reply; 10+ messages in thread
From: Wu Zhangjin @ 2009-11-21 11:05 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: linux-mips, Wu Zhangjin

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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH v1 1/4] [loongson] Remove the inline annotation of prom_init_uart_base()
  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-23  1:29   ` Wu Zhangjin
  2009-11-23 15:45     ` Ralf Baechle
  1 sibling, 1 reply; 10+ messages in thread
From: Wu Zhangjin @ 2009-11-23  1:29 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: linux-mips

Hi, Ralf

This one is also urgent, could you please fold it into "MIPS: Loongson:
Cleanup the serial port support"? thanks!

Best Regards,
	Wu Zhangjin

On Sat, 2009-11-21 at 19:05 +0800, Wu Zhangjin wrote:
> gcc 3.4.6 complains about un-implemented prom_init_uart_base() if using
> inline to annotate prom_init_uart_base(), so, remove the inline here.
> 
> Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
> ---
>  arch/mips/include/asm/mach-loongson/loongson.h |    2 +-
>  arch/mips/loongson/common/uart_base.c          |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/mips/include/asm/mach-loongson/loongson.h b/arch/mips/include/asm/mach-loongson/loongson.h
> index daf7041..a7fa66e 100644
> --- a/arch/mips/include/asm/mach-loongson/loongson.h
> +++ b/arch/mips/include/asm/mach-loongson/loongson.h
> @@ -33,7 +33,7 @@ extern void __init prom_init_machtype(void);
>  extern void __init prom_init_env(void);
>  extern unsigned long _loongson_uart_base;
>  extern unsigned long uart8250_base[];
> -extern inline void __maybe_unused prom_init_uart_base(void);
> +extern void prom_init_uart_base(void);
>  
>  /* irq operation functions */
>  extern void bonito_irqdispatch(void);
> diff --git a/arch/mips/loongson/common/uart_base.c b/arch/mips/loongson/common/uart_base.c
> index 275bed6..1d636f4 100644
> --- a/arch/mips/loongson/common/uart_base.c
> +++ b/arch/mips/loongson/common/uart_base.c
> @@ -29,7 +29,7 @@ unsigned long __maybe_unused uart8250_base[] = {
>  };
>  EXPORT_SYMBOL(uart8250_base);
>  
> -inline void __maybe_unused prom_init_uart_base(void)
> +void __maybe_unused prom_init_uart_base(void)
>  {
>  	_loongson_uart_base =
>  		(unsigned long)ioremap_nocache(uart8250_base[mips_machtype], 8);

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v1 1/4] [loongson] Remove the inline annotation of prom_init_uart_base()
  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
  0 siblings, 0 replies; 10+ messages in thread
From: Ralf Baechle @ 2009-11-23 15:45 UTC (permalink / raw)
  To: Wu Zhangjin; +Cc: linux-mips

On Mon, Nov 23, 2009 at 09:29:56AM +0800, Wu Zhangjin wrote:

> This one is also urgent, could you please fold it into "MIPS: Loongson:
> Cleanup the serial port support"? thanks!

Done.  Thanks!

  Ralf

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v1 2/4] [loongson] yeeloong2f: add basic ec operations
  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-23 16:09     ` Ralf Baechle
  1 sibling, 0 replies; 10+ messages in thread
From: Ralf Baechle @ 2009-11-23 16:09 UTC (permalink / raw)
  To: Wu Zhangjin; +Cc: linux-mips

On Sat, Nov 21, 2009 at 07:05:23PM +0800, Wu Zhangjin wrote:

> YeeLoong2F has a kb3310b Embedded Controller. This patch add the basic
> EC operations for future relative drivers or board support.

Queued with a bunch of cleanups.

Thanks!

  Ralf

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v1 3/4] [loongson] yeeloong2f: add LID open event as the wakeup event
  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       ` [PATCH v1 4/4] [loongson] yeeloong2f: cleanup the reset logic with ec_write function Wu Zhangjin
@ 2009-11-23 16:20       ` Ralf Baechle
  1 sibling, 0 replies; 10+ messages in thread
From: Ralf Baechle @ 2009-11-23 16:20 UTC (permalink / raw)
  To: Wu Zhangjin; +Cc: linux-mips

On Sat, Nov 21, 2009 at 07:05:24PM +0800, Wu Zhangjin wrote:

> Yeeloong2F netbook has an embedded controller(kb3310b) to manage the LID
> action. when the LID is closed/opened, a SCI interrupt is sent out and
> the corresponding event is saved to an EC register for later query.
> 
> This patch allow the LID open action to wake up the processor from wait
> mode if it is in the suspend mode.

Thanks, queued for 2.6.33.

  Ralf

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v1 4/4] [loongson] yeeloong2f: cleanup the reset logic with ec_write function
  2009-11-21 11:05       ` [PATCH v1 4/4] [loongson] yeeloong2f: cleanup the reset logic with ec_write function Wu Zhangjin
@ 2009-11-23 16:24         ` Ralf Baechle
  0 siblings, 0 replies; 10+ messages in thread
From: Ralf Baechle @ 2009-11-23 16:24 UTC (permalink / raw)
  To: Wu Zhangjin; +Cc: linux-mips

On Sat, Nov 21, 2009 at 07:05:25PM +0800, Wu Zhangjin wrote:

> 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>

And this one queued for 2.6.33 as well.

Thanks,

  Ralf

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-11-23 16:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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       ` [PATCH v1 4/4] [loongson] yeeloong2f: cleanup the reset logic with ec_write function Wu Zhangjin
2009-11-23 16:24         ` 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

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.