Commit 91927a9b authored by Chen-Yu Tsai's avatar Chen-Yu Tsai Committed by Marcel Holtmann

Bluetooth: hci_bcm: Wait for device to come out of reset after power on

The datasheets for BCM20702 and BCM43438 both have power up time
sequence graphs, however they are slightly different. Both chips
also have an internal power-on-reset, which holds the chip in reset
for a short time after the regulators are enabled.

For the BCM20702, the time period from when the regulators are enabled,
until the chip settles and comes out of sleep state, is 6564 ~ 8171 us.

For the BCM43438, the graph only shows the time period from when the
regulators are enabled until the chip responds by driving the host's
CTS line low, assuming the host has already driven its RTS line low.
This is shown to be 6.5 sleep cycles, with the sleep clock at 32.768
kHz. This is around 2 ms.

Wait a full 10 ms after the regulators are enabled to account for signal
rising times.
Tested-by: default avatarOndrej Jirman <megous@megous.com>
Signed-off-by: default avatarChen-Yu Tsai <wens@csie.org>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 75d11676
...@@ -256,6 +256,9 @@ static int bcm_gpio_set_power(struct bcm_device *dev, bool powered) ...@@ -256,6 +256,9 @@ static int bcm_gpio_set_power(struct bcm_device *dev, bool powered)
regulator_bulk_disable(BCM_NUM_SUPPLIES, dev->supplies); regulator_bulk_disable(BCM_NUM_SUPPLIES, dev->supplies);
} }
/* wait for device to power on and come out of reset */
usleep_range(10000, 20000);
dev->res_enabled = powered; dev->res_enabled = powered;
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment