From: Jonathan Cameron <jic23@kernel.org>
To: Dumitru Ceclan via B4 Relay
<devnull+dumitru.ceclan.analog.com@kernel.org>
Cc: dumitru.ceclan@analog.com, Lars-Peter Clausen <lars@metafoo.de>,
Michael Hennerich <Michael.Hennerich@analog.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>,
David Lechner <dlechner@baylibre.com>,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
Dumitru Ceclan <mitrutzceclan@gmail.com>
Subject: Re: [PATCH 2/6] iio: adc: ad7173: fix buffers enablement for ad7176-2
Date: Sat, 6 Apr 2024 15:56:46 +0100 [thread overview]
Message-ID: <20240406155646.694f710b@jic23-huawei> (raw)
In-Reply-To: <20240401-ad4111-v1-2-34618a9cc502@analog.com>
On Mon, 01 Apr 2024 18:32:20 +0300
Dumitru Ceclan via B4 Relay <devnull+dumitru.ceclan.analog.com@kernel.org> wrote:
> From: Dumitru Ceclan <dumitru.ceclan@analog.com>
>
> AD7176-2 does not feature input buffers, enable buffers only on
> supported models.
>
> Fixes: cff259bf7274 ("iio: adc: ad7173: fix buffers enablement for ad7176-2")
> Signed-off-by: Dumitru Ceclan <dumitru.ceclan@analog.com>
How bad is this? If you can find out if writing those bits does anything
harmful (they are reserved and datasheet says should be written 0 I think)
That will help people decide whether to backport the fix?
> ---
> drivers/iio/adc/ad7173.c | 11 +++++++++--
> 1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iio/adc/ad7173.c b/drivers/iio/adc/ad7173.c
> index f6d29abe1d04..8a95b1391826 100644
> --- a/drivers/iio/adc/ad7173.c
> +++ b/drivers/iio/adc/ad7173.c
> @@ -145,6 +145,7 @@ struct ad7173_device_info {
> unsigned int id;
> char *name;
> bool has_temp;
> + bool has_input_buf;
> bool has_int_ref;
> bool has_ref2;
> u8 num_gpios;
> @@ -212,6 +213,7 @@ static const struct ad7173_device_info ad7173_device_info[] = {
> .num_configs = 4,
> .num_gpios = 2,
> .has_temp = true,
> + .has_input_buf = true,
> .has_int_ref = true,
> .clock = 2 * HZ_PER_MHZ,
> .sinc5_data_rates = ad7173_sinc5_data_rates,
> @@ -224,6 +226,7 @@ static const struct ad7173_device_info ad7173_device_info[] = {
> .num_configs = 8,
> .num_gpios = 4,
> .has_temp = false,
> + .has_input_buf = true,
> .has_ref2 = true,
> .clock = 2 * HZ_PER_MHZ,
> .sinc5_data_rates = ad7173_sinc5_data_rates,
> @@ -237,6 +240,7 @@ static const struct ad7173_device_info ad7173_device_info[] = {
> .num_configs = 8,
> .num_gpios = 4,
> .has_temp = true,
> + .has_input_buf = true,
> .has_int_ref = true,
> .has_ref2 = true,
> .clock = 2 * HZ_PER_MHZ,
> @@ -251,6 +255,7 @@ static const struct ad7173_device_info ad7173_device_info[] = {
> .num_configs = 4,
> .num_gpios = 2,
> .has_temp = true,
> + .has_input_buf = true,
> .has_int_ref = true,
> .clock = 16 * HZ_PER_MHZ,
> .sinc5_data_rates = ad7175_sinc5_data_rates,
> @@ -263,6 +268,7 @@ static const struct ad7173_device_info ad7173_device_info[] = {
> .num_configs = 8,
> .num_gpios = 4,
> .has_temp = true,
> + .has_input_buf = true,
> .has_int_ref = true,
> .has_ref2 = true,
> .clock = 16 * HZ_PER_MHZ,
> @@ -289,6 +295,7 @@ static const struct ad7173_device_info ad7173_device_info[] = {
> .num_configs = 4,
> .num_gpios = 2,
> .has_temp = true,
> + .has_input_buf = true,
> .has_int_ref = true,
> .clock = 16 * HZ_PER_MHZ,
> .odr_start_value = AD7177_ODR_START_VALUE,
> @@ -932,7 +939,7 @@ static int ad7173_fw_parse_channel_config(struct iio_dev *indio_dev)
> AD7173_CH_ADDRESS(chan_arr[chan_index].channel,
> chan_arr[chan_index].channel2);
> chan_st_priv->cfg.bipolar = false;
> - chan_st_priv->cfg.input_buf = true;
> + chan_st_priv->cfg.input_buf = st->info->has_input_buf;
> chan_st_priv->cfg.ref_sel = AD7173_SETUP_REF_SEL_INT_REF;
> st->adc_mode |= AD7173_ADC_MODE_REF_EN;
>
> @@ -989,7 +996,7 @@ static int ad7173_fw_parse_channel_config(struct iio_dev *indio_dev)
>
> chan_st_priv->ain = AD7173_CH_ADDRESS(ain[0], ain[1]);
> chan_st_priv->chan_reg = chan_index;
> - chan_st_priv->cfg.input_buf = true;
> + chan_st_priv->cfg.input_buf = st->info->has_input_buf;
> chan_st_priv->cfg.odr = 0;
>
> chan_st_priv->cfg.bipolar = fwnode_property_read_bool(child, "bipolar");
>
next prev parent reply other threads:[~2024-04-06 14:57 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-01 15:32 [PATCH 0/6] Add support for AD411x Dumitru Ceclan via B4 Relay
2024-04-01 15:32 ` [PATCH 1/6] dt-bindings: adc: ad7173: add support for ad411x Dumitru Ceclan via B4 Relay
2024-04-01 19:37 ` David Lechner
2024-04-01 20:22 ` David Lechner
2024-04-03 7:45 ` Ceclan, Dumitru
2024-04-03 10:08 ` Ceclan, Dumitru
2024-04-03 15:14 ` David Lechner
2024-04-01 21:16 ` David Lechner
2024-04-03 7:50 ` Ceclan, Dumitru
2024-04-03 15:22 ` David Lechner
2024-04-04 13:08 ` Ceclan, Dumitru
2024-04-06 14:26 ` Jonathan Cameron
2024-04-09 8:10 ` Ceclan, Dumitru
2024-04-03 7:43 ` Ceclan, Dumitru
2024-04-03 15:40 ` David Lechner
2024-04-06 14:53 ` Jonathan Cameron
2024-04-09 8:08 ` Ceclan, Dumitru
2024-04-13 10:49 ` Jonathan Cameron
2024-04-15 18:42 ` Ceclan, Dumitru
2024-04-20 14:33 ` Jonathan Cameron
2024-04-23 8:18 ` Ceclan, Dumitru
2024-04-28 17:13 ` Jonathan Cameron
2024-05-09 13:48 ` Ceclan, Dumitru
2024-05-15 21:42 ` David Lechner
2024-05-16 8:18 ` Ceclan, Dumitru
2024-04-01 15:32 ` [PATCH 2/6] iio: adc: ad7173: fix buffers enablement for ad7176-2 Dumitru Ceclan via B4 Relay
2024-04-01 19:38 ` David Lechner
2024-04-06 14:56 ` Jonathan Cameron [this message]
2024-04-08 16:40 ` Ceclan, Dumitru
2024-04-13 10:50 ` Jonathan Cameron
2024-04-01 15:32 ` [PATCH 3/6] iio: adc: ad7173: refactor channel configuration parsing Dumitru Ceclan via B4 Relay
2024-04-01 19:39 ` David Lechner
2024-04-03 10:01 ` Ceclan, Dumitru
2024-04-03 15:55 ` David Lechner
2024-04-01 15:32 ` [PATCH 4/6] iio: adc: ad7173: refactor ain and vref selection Dumitru Ceclan via B4 Relay
2024-04-01 19:40 ` David Lechner
2024-04-03 10:03 ` Ceclan, Dumitru
2024-04-03 16:02 ` David Lechner
2024-04-06 15:03 ` Jonathan Cameron
2024-04-01 15:32 ` [PATCH 5/6] iio: adc: ad7173: Remove index from temp channel Dumitru Ceclan via B4 Relay
2024-04-01 19:40 ` David Lechner
2024-04-01 15:32 ` [PATCH 6/6] iio: adc: ad7173: Add support for AD411x devices Dumitru Ceclan via B4 Relay
2024-04-01 19:45 ` David Lechner
2024-04-02 14:00 ` David Lechner
2024-04-03 9:55 ` Ceclan, Dumitru
2024-04-03 9:53 ` Ceclan, Dumitru
2024-04-03 16:37 ` David Lechner
2024-04-06 15:10 ` Jonathan Cameron
2024-05-14 7:28 ` Ceclan, Dumitru
2024-04-01 21:53 ` David Lechner
2024-04-03 8:15 ` Ceclan, Dumitru
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=20240406155646.694f710b@jic23-huawei \
--to=jic23@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=devnull+dumitru.ceclan.analog.com@kernel.org \
--cc=dlechner@baylibre.com \
--cc=dumitru.ceclan@analog.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mitrutzceclan@gmail.com \
--cc=robh@kernel.org \
/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