Re: [PATCH v2 2/2] iio: adc: ad7173: add support for additional models

From: David Lechner
Date: Mon Mar 04 2024 - 19:08:21 EST


On Wed, Feb 28, 2024 at 7:55 AM Dumitru Ceclan <mitrutzceclan@gmailcom> wrote:
>
> Add support for Analog Devices AD7172-2, AD7175-8, AD7177-2.
>
> Signed-off-by: Dumitru Ceclan <mitrutzceclan@xxxxxxxxx>
> ---
> drivers/iio/adc/ad7173.c | 82 ++++++++++++++++++++++++++++++++++++----
> 1 file changed, 74 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/iio/adc/ad7173.c b/drivers/iio/adc/ad7173.c
> index b42fbe28a325..e60ecce20e08 100644
> --- a/drivers/iio/adc/ad7173.c
> +++ b/drivers/iio/adc/ad7173.c
> @@ -1,6 +1,11 @@
> // SPDX-License-Identifier: GPL-2.0+
> /*
> - * AD7172-2/AD7173-8/AD7175-2/AD7176-2 SPI ADC driver
> + * AD717x family SPI ADC driver
> + *
> + * Supported devices:
> + * AD7172-2/AD7172-4/AD7173-8/AD7175-2
> + * AD7175-8/AD7176-2/AD7177-2
> + *
> * Copyright (C) 2015, 2024 Analog Devices, Inc.
> */
>
> @@ -61,10 +66,13 @@
> #define AD7173_AIN_TEMP_POS 17
> #define AD7173_AIN_TEMP_NEG 18
>
> -#define AD7172_ID 0x00d0
> -#define AD7173_ID 0x30d0
> -#define AD7175_ID 0x0cd0
> +#define AD7172_2_ID 0x00d0
> #define AD7176_ID 0x0c90
> +#define AD7175_2_ID 0x0cd0
> +#define AD7172_4_ID 0x2050
> +#define AD7173_ID 0x30d0
> +#define AD7175_8_ID 0x3cd0
> +#define AD7177_ID 0x4fd0

It would be nice to keep these sorted by name/number like they were.

> #define AD7173_ID_MASK GENMASK(15, 4)
>
> #define AD7173_ADC_MODE_REF_EN BIT(15)
> @@ -110,15 +118,19 @@
> #define AD7173_SETUP_REF_SEL_EXT_REF 0x0
> #define AD7173_VOLTAGE_INT_REF_uV 2500000
> #define AD7173_TEMP_SENSIIVITY_uV_per_C 477
> +#define AD7177_ODR_START_VALUE 0x07
>
> #define AD7173_FILTER_ODR0_MASK GENMASK(5, 0)
> #define AD7173_MAX_CONFIGS 8
>
> enum ad7173_ids {
> ID_AD7172_2,
> + ID_AD7172_4,
> ID_AD7173_8,
> ID_AD7175_2,
> + ID_AD7175_8,
> ID_AD7176_2,
> + ID_AD7177_2,
> };
>
> struct ad7173_device_info {
> @@ -190,7 +202,7 @@ static const unsigned int ad7175_sinc5_data_rates[] = {
> static const struct ad7173_device_info ad7173_device_info[] = {
> [ID_AD7172_2] = {
> .name = "ad7172-2",
> - .id = AD7172_ID,
> + .id = AD7172_2_ID,

It would be nice to put these renames in a separate patch since it is
unrelated to the parts being added.