From: Jonathan Cameron <jic23@kernel.org>
To: David Lechner <dlechner@baylibre.com>
Cc: "Michael Hennerich" <Michael.Hennerich@analog.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/5] iio: adc: ad7173: rename odr field
Date: Thu, 24 Jul 2025 14:15:07 +0100 [thread overview]
Message-ID: <20250724141507.4ed285d2@jic23-huawei> (raw)
In-Reply-To: <20250710-iio-adc-ad7137-add-filter-support-v1-2-acffe401c4d2@baylibre.com>
On Thu, 10 Jul 2025 17:39:51 -0500
David Lechner <dlechner@baylibre.com> wrote:
> 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.
>
> Signed-off-by: David Lechner <dlechner@baylibre.com>
This one can't be applied until the fixes has worked it's way back.
Looks fine though.
> ---
> drivers/iio/adc/ad7173.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/iio/adc/ad7173.c b/drivers/iio/adc/ad7173.c
> index 5daf21c6ba5637b2e47dcd052bdd019c3ecbb442..01d78d531d6c024dd92fff21b8b2afb750092b66 100644
> --- a/drivers/iio/adc/ad7173.c
> +++ b/drivers/iio/adc/ad7173.c
> @@ -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_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");
>
next prev parent reply other threads:[~2025-07-24 13:15 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-10 22:39 [PATCH 0/5] iio: adc: ad7137: add filter support David Lechner
2025-07-10 22:39 ` [PATCH 1/5] iio: adc: ad7173: rename ad7173_chan_spec_ext_info David Lechner
2025-07-10 22:39 ` [PATCH 2/5] iio: adc: ad7173: rename odr field David Lechner
2025-07-24 13:15 ` Jonathan Cameron [this message]
2025-07-10 22:39 ` [PATCH 3/5] iio: adc: ad7173: support changing filter type David Lechner
2025-07-25 8:44 ` Nuno Sá
2025-07-10 22:39 ` [PATCH 4/5] iio: ABI: alphabetize filter types David Lechner
2025-07-10 22:39 ` [PATCH 5/5] iio: ABI: add filter types for ad7173 David Lechner
2025-07-10 22:47 ` [PATCH 0/5] iio: adc: ad7137: add filter support David Lechner
2025-07-24 13:20 ` Jonathan Cameron
2025-07-24 18:50 ` David Lechner
2025-07-27 15:39 ` Jonathan Cameron
2025-07-25 8:47 ` Nuno Sá
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250724141507.4ed285d2@jic23-huawei \
--to=jic23@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox