]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
iio: adc: ad7173: rename odr field
authorDavid Lechner <dlechner@baylibre.com>
Fri, 12 Sep 2025 19:09:31 +0000 (14:09 -0500)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 13 Sep 2025 14:16:07 +0000 (15:16 +0100)
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>
drivers/iio/adc/ad7173.c

index 4eb936c7868a06a4983c37460a75bd882f020a08..dece394cc023e4be6d9ffb303fbd0fd069290567 100644 (file)
@@ -205,7 +205,7 @@ struct ad7173_channel_config {
        struct_group(config_props,
                bool bipolar;
                bool input_buf;
-               u8 odr;
+               u8 sinc5_odr_index;
                u8 ref_sel;
        );
 };
@@ -582,13 +582,13 @@ static bool ad7173_is_setup_equal(const struct ad7173_channel_config *cfg1,
                      sizeof(struct {
                                     bool bipolar;
                                     bool input_buf;
-                                    u8 odr;
+                                    u8 sinc5_odr_index;
                                     u8 ref_sel;
                             }));
 
        return cfg1->bipolar == cfg2->bipolar &&
               cfg1->input_buf == cfg2->input_buf &&
-              cfg1->odr == cfg2->odr &&
+              cfg1->sinc5_odr_index == cfg2->sinc5_odr_index &&
               cfg1->ref_sel == cfg2->ref_sel;
 }
 
@@ -650,7 +650,7 @@ static int ad7173_load_config(struct ad7173_state *st,
                return ret;
 
        return ad_sd_write_reg(&st->sd, AD7173_REG_FILTER(free_cfg_slot), 2,
-                              AD7173_FILTER_ODR0_MASK & cfg->odr);
+                              AD7173_FILTER_ODR0_MASK & cfg->sinc5_odr_index);
 }
 
 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,
                        return -EINVAL;
                }
        case IIO_CHAN_INFO_SAMP_FREQ:
-               reg = st->channels[chan->address].cfg.odr;
+               reg = st->channels[chan->address].cfg.sinc5_odr_index;
 
                *val = st->info->sinc5_data_rates[reg] / MILLI;
                *val2 = (st->info->sinc5_data_rates[reg] % MILLI) * (MICRO / MILLI);
@@ -1229,7 +1229,7 @@ static int ad7173_write_raw(struct iio_dev *indio_dev,
                                break;
 
                cfg = &st->channels[chan->address].cfg;
-               cfg->odr = i;
+               cfg->sinc5_odr_index = i;
                cfg->live = false;
                break;
 
@@ -1655,7 +1655,7 @@ static int ad7173_fw_parse_channel_config(struct iio_dev *indio_dev)
                chan_st_priv->cfg.bipolar = false;
                chan_st_priv->cfg.input_buf = st->info->has_input_buf;
                chan_st_priv->cfg.ref_sel = AD7173_SETUP_REF_SEL_INT_REF;
-               chan_st_priv->cfg.odr = st->info->odr_start_value;
+               chan_st_priv->cfg.sinc5_odr_index = st->info->odr_start_value;
                chan_st_priv->cfg.openwire_comp_chan = -1;
                st->adc_mode |= AD7173_ADC_MODE_REF_EN;
                if (st->info->data_reg_only_16bit)
@@ -1727,7 +1727,7 @@ static int ad7173_fw_parse_channel_config(struct iio_dev *indio_dev)
                chan->scan_index = chan_index;
                chan->channel = ain[0];
                chan_st_priv->cfg.input_buf = st->info->has_input_buf;
-               chan_st_priv->cfg.odr = st->info->odr_start_value;
+               chan_st_priv->cfg.sinc5_odr_index = st->info->odr_start_value;
                chan_st_priv->cfg.openwire_comp_chan = -1;
 
                chan_st_priv->cfg.bipolar = fwnode_property_read_bool(child, "bipolar");