drivers: ieee802154: kw41z: make driver DT-based

Use Devicetree to describe the radio and IEEE 802.15.4. This allows to
remove usage of IEEE802154_KW41Z_DRV_NAME in preparation for the removal
of NET_CONFIG_IEEE802154_DEV_NAME.

KW41Z files have been updated with the addition of radio and an
ieee802154 nodes The peripheral has been enabled in the frdm_k41z board
(used for testing ieee802154).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
Gerard Marull-Paretas 2022-07-15 16:59:22 +02:00 committed by Carles Cufí
commit 7d5272db62
6 changed files with 24 additions and 12 deletions

View file

@ -10,13 +10,6 @@ menuconfig IEEE802154_KW41Z
if IEEE802154_KW41Z
config IEEE802154_KW41Z_DRV_NAME
string "NXP KW41Z Driver's name"
default "KW41Z"
help
This option sets the driver name. Do not change it unless
you know what you are doing.
config IEEE802154_KW41Z_INIT_PRIO
int "KW41Z initialization priority"
default 80

View file

@ -6,6 +6,8 @@
* SPDX-License-Identifier: Apache-2.0
*/
#define DT_DRV_COMPAT nxp_kw41z_ieee802154
#define LOG_MODULE_NAME ieee802154_kw41z
#define LOG_LEVEL CONFIG_IEEE802154_DRIVER_LOG_LEVEL
@ -1110,9 +1112,8 @@ static struct ieee802154_radio_api kw41z_radio_api = {
#endif
NET_DEVICE_INIT(
kw41z, /* Device Name */
CONFIG_IEEE802154_KW41Z_DRV_NAME, /* Driver Name */
NET_DEVICE_DT_INST_DEFINE(
0,
kw41z_init, /* Initialization Function */
NULL, /* No PM API support */
&kw41z_context_data, /* Context data */

View file

@ -240,6 +240,13 @@
status = "okay";
interrupts = <13 0>;
};
ieee802154: ieee802154@4005d000 {
compatible = "nxp,kw41z-ieee802514";
reg = <0x4005d000 0x1000>;
label = "KW41Z";
status = "disabled";
};
};
};

View file

@ -0,0 +1,12 @@
# Copyright (c) 2022 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0
description: NXP KW41Z IEEE 802.15.4 node
compatible: "nxp,kw41z-ieee802154"
include: base.yaml
properties:
reg:
required: true

View file

@ -33,7 +33,7 @@ config IEEE802154_KW41Z
default y
config NET_CONFIG_IEEE802154_DEV_NAME
default IEEE802154_KW41Z_DRV_NAME
default "KW41Z"
endif # NETWORKING

View file

@ -449,7 +449,6 @@ CONFIG_SHELL_MQTT_INIT_LOG_LEVEL_ERR=y
#CONFIG_IEEE802154_CC2520_RX_STACK_SIZE=1024
#CONFIG_IEEE802154_DRIVER_LOG_LEVEL_DBG=y
#CONFIG_IEEE802154_KW41Z_DRV_NAME="KW41Z"
#CONFIG_IEEE802154_KW41Z_INIT_PRIO=90
#CONFIG_IEEE802154_KW41Z=y