From: Jonathan Cameron <jic23@kernel.org>
To: Pop Ioan Daniel <pop.ioan-daniel@analog.com>
Cc: "Lars-Peter Clausen" <lars@metafoo.de>,
"Michael Hennerich" <Michael.Hennerich@analog.com>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Sergiu Cuciurean" <sergiu.cuciurean@analog.com>,
"Dragos Bogdan" <dragos.bogdan@analog.com>,
"Antoniu Miclaus" <antoniu.miclaus@analog.com>,
"Olivier Moysan" <olivier.moysan@foss.st.com>,
"Javier Carrasco" <javier.carrasco.cruz@gmail.com>,
"Matti Vaittinen" <mazziesaccount@gmail.com>,
"Tobias Sperling" <tobias.sperling@softing.com>,
"Alisa-Dariana Roman" <alisadariana@gmail.com>,
"Marcelo Schmitt" <marcelo.schmitt@analog.com>,
"Matteo Martelli" <matteomartelli3@gmail.com>,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 4/4] iio: adc: ad7405: add ad7405 driver
Date: Sun, 11 May 2025 16:02:33 +0100 [thread overview]
Message-ID: <20250511160233.66bd8e71@jic23-huawei> (raw)
In-Reply-To: <20250508123107.3797042-5-pop.ioan-daniel@analog.com>
On Thu, 8 May 2025 15:30:57 +0300
Pop Ioan Daniel <pop.ioan-daniel@analog.com> wrote:
> Add support for the AD7405/ADUM770x, a high performance isolated ADC,
> 1-channel, 16-bit with a second-order Σ-Δ modulator that converts an
> analog input signal into a high speed, single-bit data stream.
>
> Signed-off-by: Pop Ioan Daniel <pop.ioan-daniel@analog.com>
Hi,
Just a few comments inline. In particular I'd avoid the gcc specific
behaviour unless we have it documented somewhere in the kernel that
static flexible array instantiation is allowed.
Doesn't make sense here anyway just make it 1 element.
Jonathan
> diff --git a/drivers/iio/adc/ad7405.c b/drivers/iio/adc/ad7405.c
> new file mode 100644
> index 000000000000..5fe36ce61819
> --- /dev/null
> +++ b/drivers/iio/adc/ad7405.c
> @@ -0,0 +1,264 @@
> +
> +struct ad7405_chip_info {
> + const char *name;
> + unsigned int max_rate;
> + struct iio_chan_spec channel[];
See below.
> +};
> +static int ad7405_read_avail(struct iio_dev *indio_dev,
> + struct iio_chan_spec const *chan,
> + const int **vals, int *type, int *length,
> + long info)
> +{
> + struct ad7405_state *st = iio_priv(indio_dev);
> +
> + switch (info) {
> + case IIO_CHAN_INFO_SAMP_FREQ:
> + *vals = st->sample_frequency_tbl;
1 tab only.
> + *length = ARRAY_SIZE(st->sample_frequency_tbl);
> + *type = IIO_VAL_INT;
> + return IIO_AVAIL_LIST;
> + default:
> + return -EINVAL;
> + }
> +}
> +
> +static const struct ad7405_chip_info ad7405_chip_info = {
> + .name = "AD7405",
> + .channel = {
> + AD7405_IIO_CHANNEL,
> + },
> +};
> +
> +static const struct ad7405_chip_info adum7701_chip_info = {
> + .name = "ADUM7701",
Convention here is 1 tab indent only.
> + .channel = {
This will look nicer without the array of 1 thing going on.
Interesting corner of the c spec to use a flexible array member
for this. Definitely don't do that as I hate reading that spec to
check corners like this. On this occasion I looked and could
not find an answer. There is a gcc extension that makes this work
though.
> + AD7405_IIO_CHANNEL,
> + },
> +};
prev parent reply other threads:[~2025-05-11 15:02 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-08 12:30 [PATCH v2 0/4] Add support for AD7405/ADUM770x Pop Ioan Daniel
2025-05-08 12:30 ` [PATCH v2 1/4] iio: backend: update iio_backend_oversampling_ratio_set Pop Ioan Daniel
2025-05-08 16:41 ` David Lechner
2025-05-09 10:10 ` kernel test robot
2025-05-09 10:21 ` kernel test robot
2025-05-09 18:03 ` kernel test robot
2025-05-08 12:30 ` [PATCH v2 2/4] iio: adc: adi-axi-adc: add set decimation rate Pop Ioan Daniel
2025-05-08 16:45 ` David Lechner
2025-05-08 12:30 ` [PATCH v2 3/4] dt-bindings: iio: adc: add ad7405 Pop Ioan Daniel
2025-05-08 14:41 ` Conor Dooley
2025-05-09 13:45 ` Rob Herring (Arm)
2025-05-08 12:30 ` [PATCH v2 4/4] iio: adc: ad7405: add ad7405 driver Pop Ioan Daniel
2025-05-08 17:08 ` David Lechner
2025-05-11 14:45 ` Jonathan Cameron
2025-05-09 11:45 ` kernel test robot
2025-05-11 15:02 ` Jonathan Cameron [this message]
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=20250511160233.66bd8e71@jic23-huawei \
--to=jic23@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=alisadariana@gmail.com \
--cc=andy@kernel.org \
--cc=antoniu.miclaus@analog.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=dragos.bogdan@analog.com \
--cc=javier.carrasco.cruz@gmail.com \
--cc=krzk+dt@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo.schmitt@analog.com \
--cc=matteomartelli3@gmail.com \
--cc=mazziesaccount@gmail.com \
--cc=nuno.sa@analog.com \
--cc=olivier.moysan@foss.st.com \
--cc=pop.ioan-daniel@analog.com \
--cc=robh@kernel.org \
--cc=sergiu.cuciurean@analog.com \
--cc=tobias.sperling@softing.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