/* Stops the sub-GHz interface and yields the radio (tells RF module to power down).  */
static int ieee802154_cc13xx_cc26xx_subg_stop_if(const struct device *dev)
/* Stops the sub-GHz interface and yields the radio (tells RF module to power down).  */
static int ieee802154_cc13xx_cc26xx_subg_stop_if(const struct device *dev)
{
	struct ieee802154_cc13xx_cc26xx_subg_data *drv_data = dev->data;
	int ret;
	if (k_sem_take(&drv_data->lock, LOCK_TIMEOUT)) {
		return -EIO;
	}
	if (!drv_data->is_up) {
		ret = -EALREADY;
		goto out;
	}
	ret = drv_abort_commands(dev);
	if (ret) {
		goto out;
	}
	ret = drv_power_down(dev);
	if (ret) {
		goto out;
	}
	drv_data->is_up = false;
 out:
	k_sem_give(&drv_data->lock);
	return ret;
}