Re: [PATCH 2/2] iio: adc: ad9467: add support for ad9211

From: Andy Shevchenko

Date: Wed Dec 03 2025 - 07:48:41 EST


On Wed, Dec 03, 2025 at 12:20:34PM +0000, Tomas Melin wrote:
> The AD9211 is a 10-bit monolithic sampling analog-to-digital
> converter optimized for high performance, low power, and ease
> of use. The product operates at up to a 300 MSPS conversion
> rate and is optimized for outstanding dynamic performance
> in wideband carrier and broadband systems.
>
> The scale table implemented here is not an exact match with the
> datasheet as the table presented there is missing some information.
> The reference presents these values as being linear,
> but that does not add up. There is information missing in the table.
> Implemented scale table matches values at the middle and at the ends,
> smoothing the curve towards middle and end.
> Impact on end result from deviation in scale factor affects only software
> using it for scaling. All the possible hw-settings are also available with
> this implementation.

> Link: https://www.analog.com/media/en/technical-documentation/data-sheets/AD9211.pdf

Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/AD9211.pdf

> Signed-off-by: Tomas Melin <tomas.melin@xxxxxxxxxxx>

...

> +static const struct ad9467_chip_info ad9211_chip_tbl = {
> + .name = "ad9211",
> + .id = CHIPID_AD9211,
> + .max_rate = 300000000UL,

It's too many 0:s. Less error prone is to write it as

300 * HZ_PER_MHZ

> + .scale_table = ad9211_scale_table,
> + .num_scales = ARRAY_SIZE(ad9211_scale_table),
> + .channels = ad9211_channels,
> + .num_channels = ARRAY_SIZE(ad9211_channels),
> + .test_points = AD9647_MAX_TEST_POINTS,
> + .test_mask = GENMASK(AN877_ADC_TESTMODE_ONE_ZERO_TOGGLE,
> + AN877_ADC_TESTMODE_OFF),
> + .test_mask_len = AN877_ADC_TESTMODE_ONE_ZERO_TOGGLE + 1,
> + .default_output_mode = AD9211_DEF_OUTPUT_MODE,
> + .vref_mask = AD9211_REG_VREF_MASK,
> + .has_dco = true,
> +};

--
With Best Regards,
Andy Shevchenko