[PATCH] add-ar6k-wake-interrupt.patch

matt_hsu matt_hsu at openmoko.org
Fri Jun 27 10:11:17 CEST 2008


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 <matt_hsu at openmoko.org>
>>
>> Signed-off-by: Matt Hsu <matt_hsu at openmoko.org>
>>
>> - 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>
>>     
>
>
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.openmoko.org/pipermail/openmoko-kernel/attachments/20080627/5c618e9a/attachment.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: add-ar6k-wake-interrupt.patch
Type: text/x-patch
Size: 1310 bytes
Desc: not available
Url : http://lists.openmoko.org/pipermail/openmoko-kernel/attachments/20080627/5c618e9a/attachment.bin 


More information about the openmoko-kernel mailing list