Skip to content

Commit 27901cb

Browse files
dlechjic23
authored andcommitted
iio: adc: ad7173: rename odr field
Rename odr to sinc5_odr_index in the channel setup structure. In a following commit, we will be adding a separate odr field for when the sinc3 filter is used instead so having sinc5 in the name will help avoid confusion. And _index makes it more clear that this is an index of the sinc5_data_rates array and not the output data rate itself. Reviewed-by: Nuno Sá <nuno.sa@analog.com> Signed-off-by: David Lechner <dlechner@baylibre.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent 63cc48e commit 27901cb

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

drivers/iio/adc/ad7173.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ struct ad7173_channel_config {
205205
struct_group(config_props,
206206
bool bipolar;
207207
bool input_buf;
208-
u8 odr;
208+
u8 sinc5_odr_index;
209209
u8 ref_sel;
210210
);
211211
};
@@ -582,13 +582,13 @@ static bool ad7173_is_setup_equal(const struct ad7173_channel_config *cfg1,
582582
sizeof(struct {
583583
bool bipolar;
584584
bool input_buf;
585-
u8 odr;
585+
u8 sinc5_odr_index;
586586
u8 ref_sel;
587587
}));
588588

589589
return cfg1->bipolar == cfg2->bipolar &&
590590
cfg1->input_buf == cfg2->input_buf &&
591-
cfg1->odr == cfg2->odr &&
591+
cfg1->sinc5_odr_index == cfg2->sinc5_odr_index &&
592592
cfg1->ref_sel == cfg2->ref_sel;
593593
}
594594

@@ -650,7 +650,7 @@ static int ad7173_load_config(struct ad7173_state *st,
650650
return ret;
651651

652652
return ad_sd_write_reg(&st->sd, AD7173_REG_FILTER(free_cfg_slot), 2,
653-
AD7173_FILTER_ODR0_MASK & cfg->odr);
653+
AD7173_FILTER_ODR0_MASK & cfg->sinc5_odr_index);
654654
}
655655

656656
static int ad7173_config_channel(struct ad7173_state *st, int addr)
@@ -1183,7 +1183,7 @@ static int ad7173_read_raw(struct iio_dev *indio_dev,
11831183
return -EINVAL;
11841184
}
11851185
case IIO_CHAN_INFO_SAMP_FREQ:
1186-
reg = st->channels[chan->address].cfg.odr;
1186+
reg = st->channels[chan->address].cfg.sinc5_odr_index;
11871187

11881188
*val = st->info->sinc5_data_rates[reg] / MILLI;
11891189
*val2 = (st->info->sinc5_data_rates[reg] % MILLI) * (MICRO / MILLI);
@@ -1229,7 +1229,7 @@ static int ad7173_write_raw(struct iio_dev *indio_dev,
12291229
break;
12301230

12311231
cfg = &st->channels[chan->address].cfg;
1232-
cfg->odr = i;
1232+
cfg->sinc5_odr_index = i;
12331233
cfg->live = false;
12341234
break;
12351235

@@ -1655,7 +1655,7 @@ static int ad7173_fw_parse_channel_config(struct iio_dev *indio_dev)
16551655
chan_st_priv->cfg.bipolar = false;
16561656
chan_st_priv->cfg.input_buf = st->info->has_input_buf;
16571657
chan_st_priv->cfg.ref_sel = AD7173_SETUP_REF_SEL_INT_REF;
1658-
chan_st_priv->cfg.odr = st->info->odr_start_value;
1658+
chan_st_priv->cfg.sinc5_odr_index = st->info->odr_start_value;
16591659
chan_st_priv->cfg.openwire_comp_chan = -1;
16601660
st->adc_mode |= AD7173_ADC_MODE_REF_EN;
16611661
if (st->info->data_reg_only_16bit)
@@ -1727,7 +1727,7 @@ static int ad7173_fw_parse_channel_config(struct iio_dev *indio_dev)
17271727
chan->scan_index = chan_index;
17281728
chan->channel = ain[0];
17291729
chan_st_priv->cfg.input_buf = st->info->has_input_buf;
1730-
chan_st_priv->cfg.odr = st->info->odr_start_value;
1730+
chan_st_priv->cfg.sinc5_odr_index = st->info->odr_start_value;
17311731
chan_st_priv->cfg.openwire_comp_chan = -1;
17321732

17331733
chan_st_priv->cfg.bipolar = fwnode_property_read_bool(child, "bipolar");

0 commit comments

Comments
 (0)