From: "Nuno Sá" <noname.nuno@gmail.com>
To: Angelo Dureghello <adureghello@baylibre.com>,
Lars-Peter Clausen <lars@metafoo.de>,
Michael Hennerich <Michael.Hennerich@analog.com>,
Jonathan Cameron <jic23@kernel.org>,
David Lechner <dlechner@baylibre.com>,
Nuno Sa <nuno.sa@analog.com>
Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/9] iio: dac: ad3552r-common: fix ad3541/2r ranges
Date: Mon, 13 Jan 2025 15:56:07 +0000 [thread overview]
Message-ID: <490b530b737cf2fb0be4830ae4f368569231df79.camel@gmail.com> (raw)
In-Reply-To: <20250110-wip-bl-ad3552r-axi-v0-iio-testing-carlos-v3-1-ab42aef0d840@baylibre.com>
On Fri, 2025-01-10 at 11:24 +0100, Angelo Dureghello wrote:
> From: Angelo Dureghello <adureghello@baylibre.com>
>
> Fix ad3541/2r voltage ranges to be as per ad3542r datasheet,
> rev. C, table 38 (page 57).
>
> The wrong ad354xr ranges was generating erroneous Vpp output.
>
> In more details:
> - fix wrong number of ranges, they are 5 ranges, not 6,
> - remove non-existent 0-3V range,
> - adjust order, since ad3552r_find_range() get a wrong index,
> producing a wrong Vpp as output.
>
> Retested all the ranges on real hardware, EVALAD3542RFMCZ:
>
> adi,output-range-microvolt (fdt):
> <(000000) (2500000)>; ok (Rfbx1, switch 10)
> <(000000) (5000000)>; ok (Rfbx1, switch 10)
> <(000000) (10000000)>; ok (Rfbx1, switch 10)
> <(-5000000) (5000000)>; ok (Rfbx2, switch +/- 5)
> <(-2500000) (7500000)>; ok (Rfbx2, switch -2.5/7.5)
>
> Fixes: 8f2b54824b28 ("drivers:iio:dac: Add AD3552R driver support")
> Reviewed-by: David Lechner <dlechner@baylibre.com>
> Signed-off-by: Angelo Dureghello <adureghello@baylibre.com>
> ---
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
> drivers/iio/dac/ad3552r-common.c | 5 ++---
> drivers/iio/dac/ad3552r.h | 8 +++-----
> 2 files changed, 5 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/iio/dac/ad3552r-common.c b/drivers/iio/dac/ad3552r-
> common.c
> index 0f495df2e5ce..03e0864f5084 100644
> --- a/drivers/iio/dac/ad3552r-common.c
> +++ b/drivers/iio/dac/ad3552r-common.c
> @@ -22,11 +22,10 @@ EXPORT_SYMBOL_NS_GPL(ad3552r_ch_ranges, "IIO_AD3552R");
>
> const s32 ad3542r_ch_ranges[AD3542R_MAX_RANGES][2] = {
> [AD3542R_CH_OUTPUT_RANGE_0__2P5V] = { 0, 2500 },
> - [AD3542R_CH_OUTPUT_RANGE_0__3V] = { 0, 3000 },
> [AD3542R_CH_OUTPUT_RANGE_0__5V] = { 0, 5000 },
> [AD3542R_CH_OUTPUT_RANGE_0__10V] = { 0, 10000 },
> - [AD3542R_CH_OUTPUT_RANGE_NEG_2P5__7P5V] = { -2500, 7500 },
> - [AD3542R_CH_OUTPUT_RANGE_NEG_5__5V] = { -5000, 5000 }
> + [AD3542R_CH_OUTPUT_RANGE_NEG_5__5V] = { -5000, 5000 },
> + [AD3542R_CH_OUTPUT_RANGE_NEG_2P5__7P5V] = { -2500, 7500 }
> };
> EXPORT_SYMBOL_NS_GPL(ad3542r_ch_ranges, "IIO_AD3552R");
>
> diff --git a/drivers/iio/dac/ad3552r.h b/drivers/iio/dac/ad3552r.h
> index fd5a3dfd1d1c..4b5581039ae9 100644
> --- a/drivers/iio/dac/ad3552r.h
> +++ b/drivers/iio/dac/ad3552r.h
> @@ -131,7 +131,7 @@
> #define AD3552R_CH1_ACTIVE BIT(1)
>
> #define AD3552R_MAX_RANGES 5
> -#define AD3542R_MAX_RANGES 6
> +#define AD3542R_MAX_RANGES 5
> #define AD3552R_QUAD_SPI 2
>
> extern const s32 ad3552r_ch_ranges[AD3552R_MAX_RANGES][2];
> @@ -189,16 +189,14 @@ enum ad3552r_ch_vref_select {
> enum ad3542r_ch_output_range {
> /* Range from 0 V to 2.5 V. Requires Rfb1x connection */
> AD3542R_CH_OUTPUT_RANGE_0__2P5V,
> - /* Range from 0 V to 3 V. Requires Rfb1x connection */
> - AD3542R_CH_OUTPUT_RANGE_0__3V,
> /* Range from 0 V to 5 V. Requires Rfb1x connection */
> AD3542R_CH_OUTPUT_RANGE_0__5V,
> /* Range from 0 V to 10 V. Requires Rfb2x connection */
> AD3542R_CH_OUTPUT_RANGE_0__10V,
> - /* Range from -2.5 V to 7.5 V. Requires Rfb2x connection */
> - AD3542R_CH_OUTPUT_RANGE_NEG_2P5__7P5V,
> /* Range from -5 V to 5 V. Requires Rfb2x connection */
> AD3542R_CH_OUTPUT_RANGE_NEG_5__5V,
> + /* Range from -2.5 V to 7.5 V. Requires Rfb2x connection */
> + AD3542R_CH_OUTPUT_RANGE_NEG_2P5__7P5V,
> };
>
> enum ad3552r_ch_output_range {
>
next prev parent reply other threads:[~2025-01-13 15:56 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-10 10:24 [PATCH v3 0/9] iio: ad3552r-hs: add support for ad3541/42r Angelo Dureghello Angelo Dureghello
2025-01-10 10:24 ` [PATCH v3 1/9] iio: dac: ad3552r-common: fix ad3541/2r ranges Angelo Dureghello
2025-01-13 15:56 ` Nuno Sá [this message]
2025-01-10 10:24 ` [PATCH v3 2/9] iio: dac: ad3552r-hs: clear reset status flag Angelo Dureghello
2025-01-12 15:04 ` Jonathan Cameron
2025-01-13 15:58 ` Nuno Sá
2025-01-13 16:57 ` Angelo Dureghello
2025-01-10 10:24 ` [PATCH v3 3/9] iio: dac: adi-axi-dac: modify stream enable Angelo Dureghello
2025-01-13 16:00 ` Nuno Sá
2025-01-10 10:24 ` [PATCH v3 4/9] iio: dac: adi-axi-dac: add bus mode setup Angelo Dureghello
2025-01-13 16:05 ` Nuno Sá
2025-01-10 10:24 ` [PATCH v3 5/9] iio: dac: ad3552r-hs: fix message on wrong chip id Angelo Dureghello
2025-01-13 16:07 ` Nuno Sá
2025-01-10 10:24 ` [PATCH v3 6/9] iio: dac: ad3552r-hs: use instruction mode for configuration Angelo Dureghello
2025-01-10 15:37 ` David Lechner
2025-01-13 16:08 ` Nuno Sá
2025-01-10 10:24 ` [PATCH v3 7/9] iio: dac: ad3552r: share model data structures Angelo Dureghello
2025-01-10 15:39 ` David Lechner
2025-01-13 16:10 ` Nuno Sá
2025-01-10 10:24 ` [PATCH v3 8/9] iio: dac: ad3552r-hs: add ad3541/2r support Angelo Dureghello
2025-01-10 16:12 ` David Lechner
2025-01-12 15:06 ` Jonathan Cameron
2025-01-10 10:24 ` [PATCH v3 9/9] iio: dac: ad3552r-hs: update function name (non functional) Angelo Dureghello
2025-01-10 16:14 ` David Lechner
2025-01-13 16:11 ` Nuno Sá
2025-01-13 20:55 ` Angelo Dureghello
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=490b530b737cf2fb0be4830ae4f368569231df79.camel@gmail.com \
--to=noname.nuno@gmail.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=Michael.Hennerich@analog.com \
--cc=adureghello@baylibre.com \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--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