Skip to content

Commit d87552a

Browse files
kapi-nocarlescufi
authored andcommitted
drivers: bluetooth: hci: rpmsg: use chosen to abstract ipc instance
Added chosen syntax in Device Tree to abstract the IPC device that is used with the IPC service module in the Bluetooth HCI RPMsg driver. Ported affected boards to declare this alias. Signed-off-by: Kamil Piszczek <[email protected]>
1 parent d550320 commit d87552a

File tree

6 files changed

+8
-2
lines changed

6 files changed

+8
-2
lines changed

boards/arm/nrf5340dk_nrf5340/nrf5340_cpuapp_common.dts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
zephyr,uart-mcumgr = &uart0;
1414
zephyr,bt-mon-uart = &uart0;
1515
zephyr,bt-c2h-uart = &uart0;
16+
zephyr,bt-hci-rpmsg-ipc = &ipc0;
1617
};
1718

1819
leds {

boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpunet.dts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
zephyr,uart-mcumgr = &uart0;
1919
zephyr,bt-mon-uart = &uart0;
2020
zephyr,bt-c2h-uart = &uart0;
21+
zephyr,bt-hci-rpmsg-ipc = &ipc0;
2122
zephyr,sram = &sram1;
2223
zephyr,flash = &flash1;
2324
zephyr,code-partition = &slot0_partition;

boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
zephyr,uart-mcumgr = &uart0;
1313
zephyr,bt-mon-uart = &uart0;
1414
zephyr,bt-c2h-uart = &uart0;
15+
zephyr,bt-hci-rpmsg-ipc = &ipc0;
1516
};
1617

1718
buttons {

boards/arm/thingy53_nrf5340/thingy53_nrf5340_cpunet.dts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
zephyr,uart-mcumgr = &uart0;
1919
zephyr,bt-mon-uart = &uart0;
2020
zephyr,bt-c2h-uart = &uart0;
21+
zephyr,bt-hci-rpmsg-ipc = &ipc0;
2122
zephyr,sram = &sram1;
2223
zephyr,flash = &flash1;
2324
zephyr,code-partition = &slot0_partition;

drivers/bluetooth/hci/rpmsg.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,8 @@ static struct ipc_ept_cfg hci_ept_cfg = {
283283
static int bt_rpmsg_open(void)
284284
{
285285
int err;
286-
const struct device *hci_ipc_instance = DEVICE_DT_GET(DT_NODELABEL(ipc0));
286+
const struct device *hci_ipc_instance =
287+
DEVICE_DT_GET(DT_CHOSEN(zephyr_bt_hci_rpmsg_ipc));
287288

288289
BT_DBG("");
289290

samples/bluetooth/hci_rpmsg/src/main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,8 @@ static struct ipc_ept_cfg hci_ept_cfg = {
268268
void main(void)
269269
{
270270
int err;
271-
const struct device *hci_ipc_instance = DEVICE_DT_GET(DT_NODELABEL(ipc0));
271+
const struct device *hci_ipc_instance =
272+
DEVICE_DT_GET(DT_CHOSEN(zephyr_bt_hci_rpmsg_ipc));
272273

273274
/* incoming events and data from the controller */
274275
static K_FIFO_DEFINE(rx_queue);

0 commit comments

Comments
 (0)