[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6af326b1bf24faea652b4549ff5db24b96ee80c5.camel@gmail.com>
Date: Tue, 20 Feb 2024 11:38:25 +0100
From: Nuno Sá <noname.nuno@...il.com>
To: Dumitru Ceclan <mitrutzceclan@...il.com>
Cc: linus.walleij@...aro.org, brgl@...ev.pl, andy@...nel.org,
linux-gpio@...r.kernel.org, Lars-Peter Clausen <lars@...afoo.de>, Jonathan
Cameron <jic23@...nel.org>, Rob Herring <robh+dt@...nel.org>, Krzysztof
Kozlowski <krzysztof.kozlowski+dt@...aro.org>, Conor Dooley
<conor+dt@...nel.org>, Michael Walle <michael@...le.cc>, Andy Shevchenko
<andy.shevchenko@...il.com>, Arnd Bergmann <arnd@...db.de>, ChiaEn Wu
<chiaen_wu@...htek.com>, Niklas Schnelle <schnelle@...ux.ibm.com>, Leonard
Göhrs <l.goehrs@...gutronix.de>, Mike Looijmans
<mike.looijmans@...ic.nl>, Haibo Chen <haibo.chen@....com>, Hugo Villeneuve
<hvilleneuve@...onoff.com>, David Lechner <dlechner@...libre.com>, Ceclan
Dumitru <dumitru.ceclan@...log.com>, linux-iio@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v13 3/3] iio: adc: ad7173: add AD7173 driver
On Tue, 2024-02-20 at 11:43 +0200, Dumitru Ceclan wrote:
> The AD7173 family offer a complete integrated Sigma-Delta ADC solution
> which can be used in high precision, low noise single channel
> applications or higher speed multiplexed applications. The Sigma-Delta
> ADC is intended primarily for measurement of signals close to DC but also
> delivers outstanding performance with input bandwidths out to ~10kHz.
>
> Reviewed-by: Andy Shevchenko <andy@...nel.org> # for changes up until V12
> Reviewed-by: Michael Walle <michael@...le.cc> # for gpio-regmap
> Signed-off-by: Dumitru Ceclan <mitrutzceclan@...il.com>
> ---
>
Hi Dumitru,
Just a couple of things... With those addressed:
Reviewed-by: Nuno Sa <nuno.sa@...log.com>
..
>
> +static int ad7173_disable_all(struct ad_sigma_delta *sd)
> +{
> + struct ad7173_state *st = ad_sigma_delta_to_ad7173(sd);
> + int ret;
> + int i;
> +
> + for (i = 0; i < st->num_channels; i++) {
> + ret = ad_sd_write_reg(sd, AD7173_REG_CH(i), 2, 0);
> + if (ret < 0)
> + return ret;
> + }
> +
> + return 0;
> +}
> +
> +static struct ad_sigma_delta_info ad7173_sigma_delta_info = {
> + .set_channel = ad7173_set_channel,
> + .append_status = ad7173_append_status,
> + .disable_all = ad7173_disable_all,
> + .set_mode = ad7173_set_mode,
> + .has_registers = true,
> + .addr_shift = 0,
> + .read_mask = BIT(6),
> + .status_ch_mask = GENMASK(3, 0),
> + .data_reg = AD7173_REG_DATA,
> + .irq_flags = IRQF_TRIGGER_FALLING,
You need to rebase on the current testing (or maybe Jonathan can fix it if this get's
applied in this version). Basically, I would drop the above .irq_flags assigment. The
lib will now check if you gave the trigger over Firmware (like device tree) and use
it. And that#s how we should set the IRQ trigger type. I did not removed the variable
just for backward compatibility [1].
..
> +};
>
> + indio_dev->name = st->info->name;
> + indio_dev->modes = INDIO_DIRECT_MODE;
> + indio_dev->info = &ad7173_info;
> +
> + spi->mode = SPI_MODE_3;
> +
I don't think we need the above. We should just enforce it to SPI_CPOL| SPI_CPHA in
the bindings [2].
[1]: https://lore.kernel.org/linux-iio/20240117-dev_sigma_delta_no_irq_flags-v1-2-db39261592cf@analog.com/
[2]: https://elixir.bootlin.com/linux/latest/source/Documentation/devicetree/bindings/iio/imu/adi,adis16475.yaml#L45
- Nuno Sá
>
Powered by blists - more mailing lists