aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacky Cheung <jackyc@google.com>2016-01-25 15:31:28 -0800
committerDevin Kim <dojip.kim@lge.com>2016-03-15 13:51:07 -0700
commit6924014484d3406e3d2da384efc20e40e8a5ae80 (patch)
treec1649cfcc682fdfd450ae9dba23332d74028f48a
parent2550d892d30429344de2f3974f9c7dd3a9743cab (diff)
Fix issue with Rfkill core and Nitrous BT power states out of sync.android-wear-6.0.1_r0.1
Tidy up the initial states of both Rfkill and Nitrous to be blocked (powered down) initially. There was a mismatch in the states of these two components that caused the rfkill_resume() to power the BT back on erroneously when it should be stayed off. Change-Id: I44ae0c58d697122475a5df77d5e015a6059000e0
-rw-r--r--drivers/bluetooth/nitrous.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/bluetooth/nitrous.c b/drivers/bluetooth/nitrous.c
index 24ec6efe86f5..f9c7d4638ec9 100644
--- a/drivers/bluetooth/nitrous.c
+++ b/drivers/bluetooth/nitrous.c
@@ -383,14 +383,13 @@ static int nitrous_rfkill_init(struct platform_device *pdev,
goto err_rfkill_alloc;
}
+ /* Make sure rfkill core is initialized to be blocked initially. */
+ rfkill_init_sw_state(lpm->rfkill, true);
rc = rfkill_register(lpm->rfkill);
if (unlikely(rc))
goto err_rfkill_register;
- rfkill_set_states(lpm->rfkill, true, false);
- /* Set blocked state to false, so the call to
- bt_rfkill_set_power can run and set blocked to true */
- lpm->rfkill_blocked = false;
+ /* Power off chip at startup. */
nitrous_rfkill_set_power(lpm, true);
return 0;