RK29SmartPhone:23d bpstatus wakeup changed, remove additional wakeup
authorphc <phc@rk29>
Tue, 31 May 2011 03:51:22 +0000 (11:51 +0800)
committerphc <phc@rk29>
Tue, 31 May 2011 03:51:22 +0000 (11:51 +0800)
drivers/misc/mtk23d.c

index cd2f6260dc33e1f34be9e51a0066a1bca01a0a7d..9aaa5b3a2eeb30d7690b68c635f79371cf89ab5c 100755 (executable)
@@ -45,6 +45,7 @@ MODULE_LICENSE("GPL");
 //#define AP_BP_WAKEUP  RK2818_PIN_PF5   //output AP wake up BP used rising edge
 //#define BP_AP_WAKEUP  RK2818_PIN_PE0 //input BP wake up AP
 
+static bool bpstatus_irq_enable = false;
 static bool wakelock_inited;
 static struct wake_lock mtk23d_wakelock;
 
@@ -226,8 +227,12 @@ static irqreturn_t BBwakeup_isr(int irq, void *dev_id)
        
 //     disable_irq_wake(irq);
        
-       if(wakelock_inited == true)
+       if(bpstatus_irq_enable == true)
+       {
+               MODEMDBG("mtk23d_wakelock 3s \n");
                wake_lock_timeout(&mtk23d_wakelock, 3 * HZ);
+       }
+               
 
        return IRQ_HANDLED;
 }
@@ -393,6 +398,7 @@ int mtk23d_suspend(struct platform_device *pdev)
        else
        {
                printk("enable pdata->bp_statue irq_wake!! \n");
+               bpstatus_irq_enable = true;
                enable_irq_wake(irq);
        }
        
@@ -405,17 +411,18 @@ int mtk23d_resume(struct platform_device *pdev)
        int irq = 0;
        
        MODEMDBG("%s \n", __FUNCTION__);
-       //disable_irq_wake(irq);
-       ap_wakeup(pdev);
-       ap_wakeup_bp(pdev, 1);
        
        irq = gpio_to_irq(pdata->bp_statue);
        if(irq)
        {
                printk("disable pdata->bp_statue irq_wake!! \n");
+               bpstatus_irq_enable = false;
                disable_irq_wake(irq);
        }
        
+       ap_wakeup(pdev);
+       ap_wakeup_bp(pdev, 1);
+       
        return 0;
 }