aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPawit Pornkitprasan <p.pawit@gmail.com>2013-01-31 17:18:58 +0400
committerAlexey Brodkin <alexey.brodkin@gmail.com>2013-01-31 20:47:06 +0400
commitd75ee9d51288993ace934625d4ed2177a6dc0ad3 (patch)
treea9a29978420c521738f71cc52f9e2f2146567357
parent2a11ce9a6629123b24ae6e0d9ae77fd56eb4e759 (diff)
downloadkernel_samsung_crespo-d75ee9d51288993ace934625d4ed2177a6dc0ad3.zip
kernel_samsung_crespo-d75ee9d51288993ace934625d4ed2177a6dc0ad3.tar.gz
kernel_samsung_crespo-d75ee9d51288993ace934625d4ed2177a6dc0ad3.tar.bz2
crespo: rfkill: fix unbalanced irq
BlueDroid makes disable call to rfkill which it is already disabled causing unbalanced irq which prevents the device from going to sleep Based on the same fix for aries by Pawit Pornkitprasan <p.pawit@gmail.com> https://github.com/CyanogenMod/android_kernel_samsung_aries/commit/19a208a64958ff0cefb43c7b1623307ca090edd2 Change-Id: If0286bd1d37131b6dd140818287cfe6537b3195e
-rw-r--r--arch/arm/mach-s5pv210/herring-rfkill.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/arm/mach-s5pv210/herring-rfkill.c b/arch/arm/mach-s5pv210/herring-rfkill.c
index ce7408f..bf2c80f 100644
--- a/arch/arm/mach-s5pv210/herring-rfkill.c
+++ b/arch/arm/mach-s5pv210/herring-rfkill.c
@@ -48,6 +48,7 @@ static struct wake_lock rfkill_wake_lock;
static struct rfkill *bt_rfk;
static const char bt_name[] = "bcm4329";
+static bool current_blocked = true;
#ifdef CONFIG_CPU_DIDLE
static bool bt_running = false;
@@ -189,6 +190,13 @@ static int bt_rfkill_set_block(void *data, bool blocked)
{
unsigned int ret = 0;
+ if (current_blocked == blocked) {
+ pr_debug("[BT] keeping current blocked state %d\n", blocked);
+ return ret;
+ }
+
+ current_blocked = blocked;
+
ret = bluetooth_set_power(data, blocked ?
RFKILL_USER_STATE_SOFT_BLOCKED :
RFKILL_USER_STATE_UNBLOCKED);
@@ -254,7 +262,7 @@ static int __init herring_rfkill_probe(struct platform_device *pdev)
}
rfkill_set_sw_state(bt_rfk, 1);
- bluetooth_set_power(NULL, RFKILL_USER_STATE_SOFT_BLOCKED);
+ bt_rfkill_set_block(NULL, true);
return ret;