From 91a5ae9d9e7ec68ea85d01dff0f17dcf2d96ef91 Mon Sep 17 00:00:00 2001 From: Jakub Zymelka Date: Tue, 12 Aug 2025 09:49:41 +0200 Subject: [PATCH 1/2] [nrf fromlist] drivers: adc: nrfx: fix for negative samples in single-mode We need to check value of the sample not the pointer. Upstream PR #: 91368 Signed-off-by: Jakub Zymelka --- drivers/adc/adc_nrfx_saadc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/adc/adc_nrfx_saadc.c b/drivers/adc/adc_nrfx_saadc.c index 9b0f59084b6..d62101910d7 100644 --- a/drivers/adc/adc_nrfx_saadc.c +++ b/drivers/adc/adc_nrfx_saadc.c @@ -541,7 +541,7 @@ static inline void single_ended_channel_cut_negative_sample(uint16_t channel_bit uint8_t single_ended_channels, int16_t **sample) { - if ((channel_bit & single_ended_channels) && (*sample < 0)) { + if ((channel_bit & single_ended_channels) && (**sample < 0)) { **sample = 0; } From d5761413f2aeff74b12ddb19422dac0df0889d0c Mon Sep 17 00:00:00 2001 From: Jakub Zymelka Date: Tue, 12 Aug 2025 10:52:52 +0200 Subject: [PATCH 2/2] [nrf fromlist] drivers: adc: nrfx: Temporary fix for SAADC power consumption This is temporary fix for SAADC power consumption. Need to be removed after hal_nrfx version upgrade. Upstream PR #: 94383 Signed-off-by: Jakub Zymelka --- drivers/adc/adc_nrfx_saadc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/adc/adc_nrfx_saadc.c b/drivers/adc/adc_nrfx_saadc.c index d62101910d7..499d7c4b110 100644 --- a/drivers/adc/adc_nrfx_saadc.c +++ b/drivers/adc/adc_nrfx_saadc.c @@ -755,6 +755,7 @@ static void event_handler(const nrfx_saadc_evt_t *event) correct_single_ended(&m_data.ctx.sequence, m_data.user_buffer, event->data.done.size); } + nrfy_saadc_disable(NRF_SAADC); adc_context_on_sampling_done(&m_data.ctx, DEVICE_DT_INST_GET(0)); } else if (event->type == NRFX_SAADC_EVT_CALIBRATEDONE) { err = nrfx_saadc_mode_trigger();