drivers: ieee802154: cc2520: Convert to DEVICE_DT_INST_DEFINE

Move driver to use {NET_}DEVICE_DT_INST_DEFINE.  This lets us
remove the IEEE802154_CC2520_DRV_NAME Kconfig symobl.

We also update the ieee802154 build_all test to actually enable
the CC2520 driver.

Signed-off-by: Kumar Gala <galak@kernel.org>
This commit is contained in:
Kumar Gala 2022-07-14 13:09:53 -05:00 committed by Carles Cufí
parent 5cca6ed087
commit e99652b67d
4 changed files with 8 additions and 17 deletions

View file

@ -9,12 +9,6 @@ menuconfig IEEE802154_CC2520
if IEEE802154_CC2520
config IEEE802154_CC2520_DRV_NAME
string "TI CC2520 Driver's name"
default "cc2520"
help
This option sets the driver name
config IEEE802154_CC2520_RX_STACK_SIZE
int "Driver's internal RX thread stack size"
default 800

View file

@ -1051,17 +1051,14 @@ static struct ieee802154_radio_api cc2520_radio_api = {
};
#if defined(CONFIG_IEEE802154_RAW_MODE)
DEVICE_DEFINE(cc2520, CONFIG_IEEE802154_CC2520_DRV_NAME,
cc2520_init, NULL, &cc2520_context_data, NULL,
POST_KERNEL, CONFIG_IEEE802154_CC2520_INIT_PRIO,
&cc2520_radio_api);
DEVICE_DT_INST_DEFINE(0, cc2520_init, NULL, &cc2520_context_data, NULL,
POST_KERNEL, CONFIG_IEEE802154_CC2520_INIT_PRIO,
&cc2520_radio_api);
#else
NET_DEVICE_INIT(cc2520, CONFIG_IEEE802154_CC2520_DRV_NAME,
cc2520_init, NULL,
&cc2520_context_data, &cc2520_config,
CONFIG_IEEE802154_CC2520_INIT_PRIO,
&cc2520_radio_api, IEEE802154_L2,
NET_L2_GET_CTX_TYPE(IEEE802154_L2), 125);
NET_DEVICE_DT_INST_DEFINE(0, cc2520_init, NULL, &cc2520_context_data,
&cc2520_config, CONFIG_IEEE802154_CC2520_INIT_PRIO,
&cc2520_radio_api, IEEE802154_L2,
NET_L2_GET_CTX_TYPE(IEEE802154_L2), 125);
#endif

View file

@ -8,6 +8,7 @@ tests:
ieee802154.build.cc12xx_cc2520:
platform_allow: cc1352r_sensortag
extra_configs:
- CONFIG_IEEE802154_CC2520=y
- CONFIG_IEEE802154_CC13XX_CC26XX=y
- CONFIG_IEEE802154_CC13XX_CC26XX_SUB_GHZ=y
ieee802154.build.kw41z:

View file

@ -441,7 +441,6 @@ CONFIG_SHELL_MQTT_INIT_LOG_LEVEL_ERR=y
#CONFIG_IEEE802154_CC2520_CRYPTO_DRV_NAME="CRYPTO"
#CONFIG_IEEE802154_CC2520_CRYPTO_INIT_PRIO=90
#CONFIG_IEEE802154_CC2520_CRYPTO=y
#CONFIG_IEEE802154_CC2520_DRV_NAME="CC2520"
#CONFIG_IEEE802154_CC2520_INIT_PRIO=90
#CONFIG_IEEE802154_CC2520_MAC4=0x01
#CONFIG_IEEE802154_CC2520_MAC5=0x02