Skip to content

Commit

Permalink
bluetooth: hci_nxp: move vendor specific setup to its dedicated place
Browse files Browse the repository at this point in the history
Some vendor specific setup was done inside
the open() HCI function, those should be
inside setup() function instead.

Signed-off-by: Yassine El Aissaoui <[email protected]>
  • Loading branch information
yeaissa committed Jun 4, 2024
1 parent e3866a9 commit 648ebc1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions drivers/bluetooth/hci/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ config BT_DA1469X

config BT_NXP
bool "NXP HCI driver"
select BT_HCI_SETUP
help
NXP HCI bluetooth interface

Expand Down
14 changes: 13 additions & 1 deletion drivers/bluetooth/hci/hci_nxp.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,18 @@ static int bt_nxp_open(void)
LOG_ERR("HCI open failed");
break;
}
} while (false);

return ret;
}

int bt_nxp_setup(const struct bt_hci_setup_params *params)
{
ARG_UNUSED(params);

int ret;

do {
#if CONFIG_HCI_NXP_SET_CAL_DATA
ret = bt_nxp_set_calibration_data();
if (ret < 0) {
Expand Down Expand Up @@ -345,7 +356,7 @@ static int bt_nxp_open(void)
LOG_ERR("Failed to configure controller autosleep");
break;
}
#endif
#endif /* CONFIG_HCI_NXP_ENABLE_AUTO_SLEEP */
} while (false);

return ret;
Expand Down Expand Up @@ -373,6 +384,7 @@ static int bt_nxp_close(void)
static const struct bt_hci_driver drv = {
.name = "BT NXP",
.open = bt_nxp_open,
.setup = bt_nxp_setup,
.close = bt_nxp_close,
.send = bt_nxp_send,
.bus = BT_HCI_DRIVER_BUS_IPM,
Expand Down

0 comments on commit 648ebc1

Please sign in to comment.