drivers: adc: nrf: Update adc driver to support nRF9280

Expands driver to support nRF9280 similar to nRF54H20 device.

Signed-off-by: Andreas Moltumyr <andreas.moltumyr@nordicsemi.no>
This commit is contained in:
Andreas Moltumyr 2024-08-13 15:58:52 +02:00 committed by Anas Nashif
commit 2f1a5ce104

View file

@ -19,7 +19,7 @@ LOG_MODULE_REGISTER(adc_nrfx_saadc);
#if (NRF_SAADC_HAS_AIN_AS_PIN) #if (NRF_SAADC_HAS_AIN_AS_PIN)
#if defined(CONFIG_SOC_NRF54H20) #if defined(CONFIG_SOC_NRF54H20) || defined(CONFIG_SOC_NRF9280)
static const uint8_t saadc_psels[NRF_SAADC_AIN7 + 1] = { static const uint8_t saadc_psels[NRF_SAADC_AIN7 + 1] = {
[NRF_SAADC_AIN0] = NRF_PIN_PORT_TO_PIN_NUMBER(0U, 1), [NRF_SAADC_AIN0] = NRF_PIN_PORT_TO_PIN_NUMBER(0U, 1),
[NRF_SAADC_AIN1] = NRF_PIN_PORT_TO_PIN_NUMBER(1U, 1), [NRF_SAADC_AIN1] = NRF_PIN_PORT_TO_PIN_NUMBER(1U, 1),
@ -62,9 +62,9 @@ BUILD_ASSERT((NRF_SAADC_AIN0 == NRF_SAADC_INPUT_AIN0) &&
"Definitions from nrf-adc.h do not match those from nrf_saadc.h"); "Definitions from nrf-adc.h do not match those from nrf_saadc.h");
#endif #endif
#ifdef CONFIG_SOC_NRF54H20 #if defined(CONFIG_SOC_NRF54H20) || defined(CONFIG_SOC_NRF9280)
/* nRF54H20 always uses bounce buffers in RAM */ /* nRF54H20 and nRF9280 always use bounce buffers in RAM */
#define SAADC_MEMORY_SECTION \ #define SAADC_MEMORY_SECTION \
COND_CODE_1(DT_NODE_HAS_PROP(DT_NODELABEL(adc), memory_regions), \ COND_CODE_1(DT_NODE_HAS_PROP(DT_NODELABEL(adc), memory_regions), \
@ -76,7 +76,7 @@ static uint16_t adc_samples_buffer[SAADC_CH_NUM] SAADC_MEMORY_SECTION;
#define ADC_BUFFER_IN_RAM #define ADC_BUFFER_IN_RAM
#endif /* CONFIG_SOC_NRF54H20 */ #endif /* defined(CONFIG_SOC_NRF54H20) || defined(CONFIG_SOC_NRF9280) */
struct driver_data { struct driver_data {
struct adc_context ctx; struct adc_context ctx;
@ -663,7 +663,7 @@ static const struct adc_driver_api adc_nrfx_driver_api = {
#endif #endif
#if defined(CONFIG_SOC_NRF54L15) #if defined(CONFIG_SOC_NRF54L15)
.ref_internal = 900, .ref_internal = 900,
#elif defined(CONFIG_SOC_NRF54H20) #elif defined(CONFIG_SOC_NRF54H20) || defined(CONFIG_SOC_NRF9280)
.ref_internal = 1024, .ref_internal = 1024,
#else #else
.ref_internal = 600, .ref_internal = 600,