Skip to content

Commit 7584ffd

Browse files
npal-cyChromeos LUCI
authored andcommitted
driver/bluetooth/h4_ifx_cyw43xxx: Allow CBUCK regulator to discharge
Problem: re-plug USB (e.g cy8cproto_062_4343w kit) can cause that CY43xx device become unresponsive (cy8cproto_062_4343w). As result we catch ASSERTION FAIL (timeout) on HCI_Reset command. that BT CBUCK regulator to discharge. Tested on: cy8cproto_062_4343w, cy8ckit_062s2_ai and cy8ckit_062s2_43012 kits. (cherry picked from commit 41c9ec3) Original-Fix: added delay (BT_POWER_CBUCK_DISCHARGE_TIME_MS) to be sure Original-Signed-off-by: Nazar Palamar <[email protected]> GitOrigin-RevId: 41c9ec3 Change-Id: Ifae85657472fd7b437eef83df23b2e1d3bb917b6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5650214 Reviewed-by: Ting Shen <[email protected]> Tested-by: ChromeOS Prod (Robot) <[email protected]> Tested-by: Ting Shen <[email protected]> Commit-Queue: Ting Shen <[email protected]>
1 parent 4d7d234 commit 7584ffd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/bluetooth/hci/h4_ifx_cyw43xxx.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ BUILD_ASSERT(DT_PROP(DT_INST_GPARENT(0), hw_flow_control) == 1,
3232

3333
/* BT settling time after power on */
3434
#define BT_POWER_ON_SETTLING_TIME_MS (500u)
35+
#define BT_POWER_CBUCK_DISCHARGE_TIME_MS (300u)
3536

3637
/* Stabilization delay after FW loading */
3738
#define BT_STABILIZATION_DELAY_MS (250u)
@@ -230,12 +231,16 @@ int bt_h4_vnd_setup(const struct device *dev)
230231
}
231232

232233
/* Configure bt_reg_on as output */
233-
err = gpio_pin_configure_dt(&bt_reg_on, GPIO_OUTPUT);
234+
err = gpio_pin_configure_dt(&bt_reg_on, GPIO_OUTPUT_LOW);
234235
if (err) {
235236
LOG_ERR("Error %d: failed to configure bt_reg_on %s pin %d",
236237
err, bt_reg_on.port->name, bt_reg_on.pin);
237238
return err;
238239
}
240+
241+
/* Allow BT CBUCK regulator to discharge */
242+
(void)k_msleep(BT_POWER_CBUCK_DISCHARGE_TIME_MS);
243+
239244
err = gpio_pin_set_dt(&bt_reg_on, 1);
240245
if (err) {
241246
return err;

0 commit comments

Comments
 (0)