Merge tag 'iio-for-5.20a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23...
[linux-2.6-microblaze.git] / drivers / iio / frequency / admv1014.c
index d1ccaa7..865addd 100644 (file)
@@ -700,8 +700,10 @@ static int admv1014_init(struct admv1014_state *st)
                         ADMV1014_DET_EN_MSK;
 
        enable_reg = FIELD_PREP(ADMV1014_P1DB_COMPENSATION_MSK, st->p1db_comp ? 3 : 0) |
-                    FIELD_PREP(ADMV1014_IF_AMP_PD_MSK, !(st->input_mode)) |
-                    FIELD_PREP(ADMV1014_BB_AMP_PD_MSK, st->input_mode) |
+                    FIELD_PREP(ADMV1014_IF_AMP_PD_MSK,
+                               (st->input_mode == ADMV1014_IF_MODE) ? 0 : 1) |
+                    FIELD_PREP(ADMV1014_BB_AMP_PD_MSK,
+                               (st->input_mode == ADMV1014_IF_MODE) ? 1 : 0) |
                     FIELD_PREP(ADMV1014_DET_EN_MSK, st->det_en);
 
        return __admv1014_spi_update_bits(st, ADMV1014_REG_ENABLE, enable_reg_msk, enable_reg);