drivers: adc: adc_ads1119: Fix configuration register access.
The adc_ads1119 driver is unable to overwrite the configuration register,
the chip therefore always works with its default settings. Register access
macros are fixed by this commit.
Fixes: #70091
Signed-off-by: Jan Kubiznak <jan.kubiznak@deveritec.com>
diff --git a/drivers/adc/adc_ads1119.c b/drivers/adc/adc_ads1119.c
index 1abdcaa..638b83f 100644
--- a/drivers/adc/adc_ads1119.c
+++ b/drivers/adc/adc_ads1119.c
@@ -21,11 +21,11 @@
LOG_MODULE_REGISTER(ADS1119, CONFIG_ADC_LOG_LEVEL);
-#define ADS1119_CONFIG_VREF(x) ((x) & BIT(0))
-#define ADS1119_CONFIG_CM(x) ((x) & BIT(1))
-#define ADS1119_CONFIG_DR(x) ((x) & (BIT_MASK(2) << 2))
-#define ADS1119_CONFIG_GAIN(x) ((x) & BIT(4))
-#define ADS1119_CONFIG_MUX(x) ((x) & (BIT_MASK(3) << 5))
+#define ADS1119_CONFIG_VREF(x) (FIELD_PREP(BIT(0), x))
+#define ADS1119_CONFIG_CM(x) (FIELD_PREP(BIT(1), x))
+#define ADS1119_CONFIG_DR(x) (FIELD_PREP(BIT_MASK(2) << 2, x))
+#define ADS1119_CONFIG_GAIN(x) (FIELD_PREP(BIT(4), x))
+#define ADS1119_CONFIG_MUX(x) (FIELD_PREP(BIT_MASK(3) << 5, x))
#define ADS1119_STATUS_MASK_ID BIT_MASK(7)
#define ADS1119_STATUS_MASK_READY BIT(7)