From f551ee60e108e5569ace5d59ce476235bc7af35e Mon Sep 17 00:00:00 2001 From: Eduardo Montoya Date: Mon, 3 Jun 2024 11:58:02 +0200 Subject: [PATCH] [nrf fromtree] drivers: ieee802154: nrf5: sleep if idle when RxOnWhenIdle=0 When RxOnWhenIdle is set to False, turn the radio off if no operation is ongoing in order to save power. (cherry picked from commit 01b0d8736e2ef23893e631de1905c4cfbb12a0c9) Signed-off-by: Eduardo Montoya --- drivers/ieee802154/ieee802154_nrf5.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/ieee802154/ieee802154_nrf5.c b/drivers/ieee802154/ieee802154_nrf5.c index 80435f06fba..61ffb7ef0e5 100644 --- a/drivers/ieee802154/ieee802154_nrf5.c +++ b/drivers/ieee802154/ieee802154_nrf5.c @@ -995,6 +995,10 @@ static int nrf5_configure(const struct device *dev, case IEEE802154_CONFIG_RX_ON_WHEN_IDLE: nrf_802154_rx_on_when_idle_set(config->rx_on_when_idle); nrf5_data.rx_on_when_idle = config->rx_on_when_idle; + + if (config->rx_on_when_idle == false) { + (void)nrf_802154_sleep_if_idle(); + } break; default: