Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

David Lechner and committed by
Jonathan Cameron
27901cbc 63cc48ea

+8 -8
+8 -8
drivers/iio/adc/ad7173.c
··· 205 205 struct_group(config_props, 206 206 bool bipolar; 207 207 bool input_buf; 208 - u8 odr; 208 + u8 sinc5_odr_index; 209 209 u8 ref_sel; 210 210 ); 211 211 }; ··· 582 582 sizeof(struct { 583 583 bool bipolar; 584 584 bool input_buf; 585 - u8 odr; 585 + u8 sinc5_odr_index; 586 586 u8 ref_sel; 587 587 })); 588 588 589 589 return cfg1->bipolar == cfg2->bipolar && 590 590 cfg1->input_buf == cfg2->input_buf && 591 - cfg1->odr == cfg2->odr && 591 + cfg1->sinc5_odr_index == cfg2->sinc5_odr_index && 592 592 cfg1->ref_sel == cfg2->ref_sel; 593 593 } 594 594 ··· 650 650 return ret; 651 651 652 652 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); 654 654 } 655 655 656 656 static int ad7173_config_channel(struct ad7173_state *st, int addr) ··· 1183 1183 return -EINVAL; 1184 1184 } 1185 1185 case IIO_CHAN_INFO_SAMP_FREQ: 1186 - reg = st->channels[chan->address].cfg.odr; 1186 + reg = st->channels[chan->address].cfg.sinc5_odr_index; 1187 1187 1188 1188 *val = st->info->sinc5_data_rates[reg] / MILLI; 1189 1189 *val2 = (st->info->sinc5_data_rates[reg] % MILLI) * (MICRO / MILLI); ··· 1229 1229 break; 1230 1230 1231 1231 cfg = &st->channels[chan->address].cfg; 1232 - cfg->odr = i; 1232 + cfg->sinc5_odr_index = i; 1233 1233 cfg->live = false; 1234 1234 break; 1235 1235 ··· 1655 1655 chan_st_priv->cfg.bipolar = false; 1656 1656 chan_st_priv->cfg.input_buf = st->info->has_input_buf; 1657 1657 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; 1659 1659 chan_st_priv->cfg.openwire_comp_chan = -1; 1660 1660 st->adc_mode |= AD7173_ADC_MODE_REF_EN; 1661 1661 if (st->info->data_reg_only_16bit) ··· 1727 1727 chan->scan_index = chan_index; 1728 1728 chan->channel = ain[0]; 1729 1729 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; 1731 1731 chan_st_priv->cfg.openwire_comp_chan = -1; 1732 1732 1733 1733 chan_st_priv->cfg.bipolar = fwnode_property_read_bool(child, "bipolar");