Samuel Ortiz wrote:
Hi Matt,

On Thu, Jun 26, 2008 at 09:45:39PM +0800, matt_hsu wrote:
Attached patch is to add wakeup interrupt which is from ar6k module.

Cheers,

Matt

add-ar6k-wake-interrupt.patch

From: Matt <[EMAIL PROTECTED]>

Signed-off-by: Matt Hsu <[EMAIL PROTECTED]>

- 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);
I would add that to the GTA02 board file, mach-gta02.c. Otherwise, you're
making this driver gta02 specific.
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).

   Cheers,

   Matt
Cheers,
Samuel.


     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>



add-ar6k-wake-interrupt.patch

From: Matt <[EMAIL PROTECTED]>

Signed-off-by: Matt Hsu <[EMAIL PROTECTED]>

- add an interrupt for ar6k wifi module
---

 arch/arm/mach-s3c2440/mach-gta02.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)


diff --git a/arch/arm/mach-s3c2440/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c
index 601f7bc..89382ce 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
@@ -1377,6 +1377,12 @@ static irqreturn_t gta02_modem_irq(int irq, void *param)
 	return IRQ_HANDLED;
 }
 
+static irqreturn_t ar6000_wow_irq(int irq, void *param)
+{
+	printk(KERN_DEBUG "ar6000_wow interrupt\n");
+	return IRQ_HANDLED;
+}
+
 static void __init gta02_machine_init(void)
 {
 	int rc;
@@ -1482,6 +1488,15 @@ static void __init gta02_machine_init(void)
 	if (rc < 0)
 		printk(KERN_ERR "GTA02: can't request GSM modem wakeup IRQ\n");
 	enable_irq_wake(GTA02_IRQ_MODEM);
+
+	/* Make sure the wifi module can wake us up*/
+	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);
 }
 
 MACHINE_START(NEO1973_GTA02, "GTA02")

Reply via email to