nimble/phy/nrf: Force PA/LNA disable on phy disable
This is to make sure PA/LNA control pins are always disabled on phy
disable.
diff --git a/nimble/drivers/nrf5340/src/ble_phy.c b/nimble/drivers/nrf5340/src/ble_phy.c
index 49f04a8..ac90c4f 100644
--- a/nimble/drivers/nrf5340/src/ble_phy.c
+++ b/nimble/drivers/nrf5340/src/ble_phy.c
@@ -392,6 +392,21 @@
#endif
}
+static void
+ble_phy_plna_force_disable(void)
+{
+#if PLNA_SINGLE_GPIO
+ NRF_GPIOTE_NS->TASKS_CLR[plna_idx] = 1;
+#else
+#if MYNEWT_VAL(BLE_LL_PA)
+ NRF_GPIOTE_NS->TASKS_CLR[plna_pa_idx] = 1;
+#endif
+#if MYNEWT_VAL(BLE_LL_LNA)
+ NRF_GPIOTE_NS->TASKS_CLR[plna_lna_idx] = 1;
+#endif
+#endif
+}
+
int
ble_phy_get_cur_phy(void)
{
@@ -1973,7 +1988,7 @@
ble_phy_stop_usec_timer();
ble_phy_disable_irq_and_ppi();
-
+ ble_phy_plna_force_disable();
ble_phy_dbg_clear_pins();
}