diff options
author | Andre Eisenbach <eisenbach@google.com> | 2017-03-14 12:56:28 -0700 |
---|---|---|
committer | Andre Eisenbach <eisenbach@google.com> | 2017-03-14 12:58:55 -0700 |
commit | 832b11ff8f70870dbee8a0351c84e8347ec94d0c (patch) | |
tree | 48bbb48ffd892070f6a3058e61d3dc48f5d3aa9b | |
parent | 654ce2d86a5950544b5f264d82a3bc1a8d3cfdb7 (diff) | |
download | libbt-832b11ff8f70870dbee8a0351c84e8347ec94d0c.tar.gz |
Always power-off the Bluetooth chip before power on
This moves vendor specific logic from the HAL code here to ensure that
different chipsets can choose their power-on behaviour.
Bug: 36216049
Test: manual
Change-Id: Id3e9df127abbbe2cd2c34356dcee70373605bdb1
-rw-r--r-- | src/bt_vendor_brcm.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/bt_vendor_brcm.c b/src/bt_vendor_brcm.c index a2d1641..265132d 100644 --- a/src/bt_vendor_brcm.c +++ b/src/bt_vendor_brcm.c @@ -148,10 +148,12 @@ static int op(bt_vendor_opcode_t opcode, void *param) case BT_VND_OP_POWER_CTRL: { int *state = (int *) param; - if (*state == BT_VND_PWR_OFF) - upio_set_bluetooth_power(UPIO_BT_POWER_OFF); - else if (*state == BT_VND_PWR_ON) + upio_set_bluetooth_power(UPIO_BT_POWER_OFF); + if (*state == BT_VND_PWR_ON) + { + ALOGW("NOTE: BT_VND_PWR_ON now forces power-off first"); upio_set_bluetooth_power(UPIO_BT_POWER_ON); + } } break; |