Skip to content

Commit

Permalink
drivers: bluetooth: hci: Special handling of hci_reset only for ST SP…
Browse files Browse the repository at this point in the history
…I v1

Exclude devices based on ST SPI protocol v2 from special handling of
hci_reset opcode as it is redundant.

Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
  • Loading branch information
HoZHel committed Feb 28, 2024
1 parent 104b72c commit 1b42aeb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/bluetooth/hci/hci_spi_st.c
Expand Up @@ -536,7 +536,7 @@ static int bt_spi_send(struct net_buf *buf)

LOG_HEXDUMP_DBG(buf->data, buf->len, "SPI TX");

#if (DT_HAS_COMPAT_STATUS_OKAY(st_hci_spi_v1) || DT_HAS_COMPAT_STATUS_OKAY(st_hci_spi_v2))
#if DT_HAS_COMPAT_STATUS_OKAY(st_hci_spi_v1)
/*
* Since a RESET has been requested, the chip will now restart.
* Unfortunately the BlueNRG will reply with "reset received" but
Expand All @@ -547,7 +547,7 @@ static int bt_spi_send(struct net_buf *buf)
if (bt_spi_get_cmd(buf->data) == BT_HCI_OP_RESET) {
k_sem_take(&sem_initialised, K_FOREVER);
}
#endif /* DT_HAS_COMPAT_STATUS_OKAY(st_hci_spi_v1) || DT_HAS_COMPAT_STATUS_OKAY(st_hci_spi_v2) */
#endif /* DT_HAS_COMPAT_STATUS_OKAY(st_hci_spi_v1) */
net_buf_unref(buf);

return ret;
Expand Down

0 comments on commit 1b42aeb

Please sign in to comment.