<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Samuel Ortiz wrote:
<blockquote cite="mid20080626140241.GA6838@caravaggio" type="cite">
<pre wrap="">Hi Matt,
On Thu, Jun 26, 2008 at 09:45:39PM +0800, matt_hsu wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Attached patch is to add wakeup interrupt which is from ar6k module.
Cheers,
Matt
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
<blockquote type="cite">
<pre wrap="">add-ar6k-wake-interrupt.patch
From: Matt <a class="moz-txt-link-rfc2396E" href="mailto:matt_hsu@openmoko.org"><matt_hsu@openmoko.org></a>
Signed-off-by: Matt Hsu <a class="moz-txt-link-rfc2396E" href="mailto:matt_hsu@openmoko.org"><matt_hsu@openmoko.org></a>
- add wakeup interrupt for ar6k
---
.../sdio/function/wlan/ar6000/ar6000/ar6000_drv.c | 12 ++++++++++++
.../sdio/function/wlan/ar6000/ar6000/ar6000_drv.h | 4 ++++
2 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.c b/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.c
index dacc00a..98e78aa 100644
--- a/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.c
+++ b/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.c
@@ -494,6 +494,11 @@ ar6000_dbglog_event(AR_SOFTC_T *ar, A_UINT32 dropped,
}
+static irqreturn_t ar6000_wow_irq(int irq, void *param)
+{
+        printk(KERN_DEBUG "ar6000_wow interrupt\n");
+        return IRQ_HANDLED;
+}
static int __init
ar6000_init_module(void)
@@ -501,6 +506,7 @@ ar6000_init_module(void)
static int probed = 0;
A_STATUS status;
HTC_INIT_INFO initInfo;
+        int rc;
A_MEMZERO(&initInfo,sizeof(initInfo));
initInfo.AddInstance = ar6000_avail_ev;
@@ -533,6 +539,12 @@ ar6000_init_module(void)
if(status != A_OK)
return -ENODEV;
+        set_irq_type(GTA02_IRQ_WLAN_GPIO1, IRQT_RISING);
+        rc = request_irq(GTA02_IRQ_WLAN_GPIO1, ar6000_wow_irq, IRQF_DISABLED,
+                                "ar6000", NULL);
+        if (rc < 0)
+                printk(KERN_ERR "GTA02: can't request ar6k wakeup IRQ\n");
+        enable_irq_wake(GTA02_IRQ_WLAN_GPIO1);
</pre>
</blockquote>
<pre wrap=""><!---->I would add that to the GTA02 board file, mach-gta02.c. Otherwise, you're
making this driver gta02 specific.
</pre>
</blockquote>
I see. Thanks for you suggestion. :-) I made a new patch for this.
This makes the driver more clean. Initially, I thought we may need to
do some handling which requires to call some sub-functions in ar6000.c
for interrupt handling. But I think it should be OK to do nothing in
interrupt handling. All the handling should be done in application(via
IOCTL). <br>
<br>
Cheers,<br>
<br>
Matt<br>
<blockquote cite="mid20080626140241.GA6838@caravaggio" type="cite">
<pre wrap="">
Cheers,
Samuel.
</pre>
<blockquote type="cite">
<pre wrap=""> return 0;
}
diff --git a/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.h b/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.h
index 655288b..5413d08 100644
--- a/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.h
+++ b/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.h
@@ -38,6 +38,10 @@
#include <linux/wireless.h>
#include <linux/module.h>
#include <asm/io.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <asm/arch/gta02.h>
+
#include <a_config.h>
#include <athdefs.h>
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
<br>
</body>
</html>