From d75ee9d51288993ace934625d4ed2177a6dc0ad3 Mon Sep 17 00:00:00 2001 From: Pawit Pornkitprasan Date: Thu, 31 Jan 2013 17:18:58 +0400 Subject: 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 https://github.com/CyanogenMod/android_kernel_samsung_aries/commit/19a208a64958ff0cefb43c7b1623307ca090edd2 Change-Id: If0286bd1d37131b6dd140818287cfe6537b3195e --- arch/arm/mach-s5pv210/herring-rfkill.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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; -- cgit v1.1