From 2526a3909d3aa9544541ae46bcb8d35dd7f3c2b9 Mon Sep 17 00:00:00 2001 From: wdc Date: Wed, 13 Jul 2011 14:31:37 +0800 Subject: [PATCH] bluetooth: Add the Judge of the bluetooth irq to send wake up key --- arch/arm/mach-rk29/board-rk29-a22-rfkill.c | 16 +++++++++++----- arch/arm/mach-rk29/board-rk29-phonesdk-rfkill.c | 16 +++++++++++----- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/arch/arm/mach-rk29/board-rk29-a22-rfkill.c b/arch/arm/mach-rk29/board-rk29-a22-rfkill.c index c05206c4ce94..66fe1c96afe9 100755 --- a/arch/arm/mach-rk29/board-rk29-a22-rfkill.c +++ b/arch/arm/mach-rk29/board-rk29-a22-rfkill.c @@ -64,11 +64,17 @@ void resetBtHostSleepTimer(void) mod_timer(&(gBtCtrl.tl),jiffies + BT_WAKE_LOCK_TIMEOUT*HZ);//ÔÙÖØÐÂÉèÖó¬Ê±Öµ¡£ } -void btWakeupHostLock(void) +void btWakeupHostLock(bool bt_irq_wake) { if(gBtCtrl.b_HostWake == false){ DBG("*************************Lock\n"); - rk28_send_wakeup_key(); + + if(bt_irq_wake) + { + printk("BT wakeup hostLock by send wakeup key\n"); + rk28_send_wakeup_key(); + } + wake_lock(&(gBtCtrl.bt_wakelock)); gBtCtrl.b_HostWake = true; } @@ -107,7 +113,7 @@ static int bcm4329_rfkill_resume(struct platform_device *pdev) { DBG("%s\n",__FUNCTION__); - btWakeupHostLock(); + btWakeupHostLock(false); resetBtHostSleepTimer(); gpio_set_value(RK29_PIN2_PA7, GPIO_LOW); @@ -124,7 +130,7 @@ static irqreturn_t bcm4329_wake_host_irq(int irq, void *dev) { DBG("%s\n",__FUNCTION__); - btWakeupHostLock(); + btWakeupHostLock(true); resetBtHostSleepTimer(); return IRQ_HANDLED; } @@ -157,7 +163,7 @@ static int bcm4329_set_block(void *data, bool blocked) mdelay(200); #if BT_WAKE_HOST_SUPPORT - btWakeupHostLock(); + btWakeupHostLock(false); #endif pr_info("bt turn on power\n"); } diff --git a/arch/arm/mach-rk29/board-rk29-phonesdk-rfkill.c b/arch/arm/mach-rk29/board-rk29-phonesdk-rfkill.c index f06338a8650b..e835d2da14e6 100755 --- a/arch/arm/mach-rk29/board-rk29-phonesdk-rfkill.c +++ b/arch/arm/mach-rk29/board-rk29-phonesdk-rfkill.c @@ -64,11 +64,17 @@ void resetBtHostSleepTimer(void) mod_timer(&(gBtCtrl.tl),jiffies + BT_WAKE_LOCK_TIMEOUT*HZ);//ÔÙÖØÐÂÉèÖó¬Ê±Öµ¡£ } -void btWakeupHostLock(void) +void btWakeupHostLock(bool bt_irq_wake) { if(gBtCtrl.b_HostWake == false){ DBG("*************************Lock\n"); - rk28_send_wakeup_key(); + + if(bt_irq_wake) + { + printk("BT wakeup hostLock by send wakeup key\n"); + rk28_send_wakeup_key(); + } + wake_lock(&(gBtCtrl.bt_wakelock)); gBtCtrl.b_HostWake = true; } @@ -107,7 +113,7 @@ static int bcm4329_rfkill_resume(struct platform_device *pdev) { DBG("%s\n",__FUNCTION__); - btWakeupHostLock(); + btWakeupHostLock(false); resetBtHostSleepTimer(); gpio_set_value(RK29_PIN2_PA7, GPIO_LOW); @@ -124,7 +130,7 @@ static irqreturn_t bcm4329_wake_host_irq(int irq, void *dev) { DBG("%s\n",__FUNCTION__); - btWakeupHostLock(); + btWakeupHostLock(true); resetBtHostSleepTimer(); return IRQ_HANDLED; } @@ -157,7 +163,7 @@ static int bcm4329_set_block(void *data, bool blocked) mdelay(200); #if BT_WAKE_HOST_SUPPORT - btWakeupHostLock(); + btWakeupHostLock(false); #endif pr_info("bt turn on power\n"); } -- 2.34.1